/* --- style.css --- */


/* --- Base Styles, Variables, Fonts --- */
:root {
  --bg-primary: #0f0f23;
  --bg-secondary: #1d1b35;
  --bg-card: rgba(29, 27, 53, 0.85);
  --bg-card-opaque: #1d1b35;
  --text-primary: #eaeaea;
  --text-secondary: #b0b0d0;
  --text-dark: #0f0f23; /* Dark color for text on light/bright backgrounds */
  --accent-primary: #ff00ff;
  --accent-secondary: #00ffff;
  --accent-tertiary: #ffd700;
  --accent-positive: #39ff14;
  --accent-negative: #ff3131;
  --border-color: rgba(0, 255, 255, 0.3);
  --border-color-strong: #00ffff;
  --font-body: "Poppins", sans-serif;
  --font-title: "Orbitron", sans-serif;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-color: rgba(0, 0, 0, 0.5);
  --shadow-interactive: 0 0 15px var(--accent-secondary);
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.2);
  --anim-fast: 0.2s;
  --anim-med: 0.4s;
  --anim-slow: 0.6s;
  --overlay-text-color: var(--text-primary);
  --overlay-text-color-rgb: 234, 234, 234;
  --bg-secondary-rgb: 29, 27, 53;
  --bg-primary-rgb: 15, 15, 35;
  --accent-tertiary-rgb: 255, 215, 0;
  --accent-primary-rgb: 255, 0, 255;
  --accent-secondary-rgb: 0, 255, 255;
  --pulse-shadow-orb: rgba(0, 255, 255, 0.5);
  --pulse-shadow-orb-glow: rgba(0, 255, 255, 0.3);
}

/* --- Reset & Body --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  font-size: 16px;
  height: 100%;
}
body {
  font-family: var(--font-body);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  padding: 0; 
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease,
    font-family 0.4s ease;
}

/* --- THEME-SPECIFIC BACKGROUND VISIBILITY FIX --- */
body.arcade-theme-active .comic-background-container,
body.comic-theme-active .grid-container {
    display: none;
}
body.arcade-theme-active .grid-container,
body.comic-theme-active .comic-background-container {
    display: grid; /* Or block, depending on the container type */
}


/* --- ARCADE BACKGROUND ANIMATION --- */
.grid-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -2;
}

.grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 200vw;
    height: 200vh;
    background-image: 
        linear-gradient(rgba(0, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: scrollGrid 30s linear infinite;
    transition: background-image 2s ease-in-out;
}

@keyframes scrollGrid {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(-50%, -50%);
    }
}


/* --- Layout Containers --- */
.page-wrapper {
  width: 100%;
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: clamp(15px, 3vw, 30px);
  position: relative;
  z-index: 1;
}
.container {
  width: 100%;
  max-width: 1600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
}

.card {
  background-color: var(--bg-card);
  backdrop-filter: blur(100px);
  -webkit-backdrop-filter: blur(10px);
  padding: clamp(25px, 4vw, 40px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card), 0 0 0 1px rgba(0, 255, 255, 0.1);
  border: 1px solid var(--border-color);
  text-align: center;
  width: 100%;
  max-width: 1200px;
  transition: opacity var(--anim-med) ease-out,
    transform var(--anim-med) ease-out, visibility var(--anim-med) step-end,
    background-color 0.4s ease, border 0.4s ease, box-shadow 0.4s ease,
    border-radius 0.4s ease, background-image 0.4s ease,
    backdrop-filter 0.4s ease, padding 0.4s ease;
}
.card.hidden {
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  visibility: hidden;
  display: none !important;
}

.card.slide-in {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
  animation: slideFadeIn var(--anim-slow) cubic-bezier(0.165, 0.84, 0.44, 1)
    forwards;
}
@keyframes slideFadeIn {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --- Typography --- */
h1.main-title {
  font-family: var(--font-title);
  font-weight: 900;
  font-size: clamp(2.5rem, 6vw, 3.8rem);
  color: var(--text-primary);
  margin-bottom: 15px;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 0 0 5px var(--accent-primary), 0 0 10px var(--accent-primary),
    0 0 20px var(--accent-primary), 0 0 40px rgba(255, 0, 255, 0.7);
  line-height: 1.1;
  transition: font-family 0.4s ease, color 0.4s ease, text-shadow 0.4s ease,
    letter-spacing 0.4s ease, padding 0.4s ease;
}
h1.main-title.small-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-bottom: 25px;
}
h2.section-title {
  font-family: var(--font-title);
  color: var(--accent-secondary);
  margin-top: 0;
  margin-bottom: 30px;
  font-weight: 500;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: font-family 0.4s ease, color 0.4s ease, border-color 0.4s ease,
    text-shadow 0.4s ease, letter-spacing 0.4s ease;
}

/* --- User Greeting Banner --- */
.user-greeting-banner {
  font-family: var(--font-body);
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  color: var(--accent-tertiary);
  padding: 8px 15px;
  margin: -5px auto 20px auto;
  background-color: rgba(var(--bg-primary-rgb), 0.7);
  border-radius: var(--radius-sm);
  max-width: fit-content;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(var(--accent-tertiary-rgb), 0.5);
  min-height: 1.5em;
  transition: font-family 0.4s ease, color 0.4s ease, background-color 0.4s ease,
    border 0.4s ease;
}
.user-greeting-banner.hidden {
  display: none !important;
}
.user-greeting-banner:empty {
  display: none;
}

/* --- Introductory Screen Styles --- */
#intro-screen-area.card {
  max-width: 600px;
}
h1.main-title.intro-game-title {
  font-size: clamp(3rem, 8vw, 4.5rem);
  margin-bottom: 25px;
}
.intro-subtitle {
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  color: var(--text-secondary);
  margin-bottom: 40px;
  font-weight: 400;
}
.intro-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
  width: 100%;
  max-width: 450px;
  margin: 0 auto;
}
.intro-label {
  font-size: 1.1rem;
  color: var(--accent-secondary);
  font-weight: 500;
}
#intro-nickname-input {
  padding: 16px 22px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color-strong);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 1.1rem;
  font-family: inherit;
  width: 100%;
  text-align: center;
  transition: border-color var(--anim-fast) ease,
    box-shadow var(--anim-fast) ease, font-family 0.4s ease,
    background-color 0.4s ease, color 0.4s ease, border-radius 0.4s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}
#intro-nickname-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.8;
  transition: opacity var(--anim-fast) ease-out;
}
#intro-nickname-input:focus::placeholder {
  color: transparent;
  opacity: 0;
}
#intro-nickname-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 15px 3px rgba(255, 0, 255, 0.7),
    inset 0 2px 4px rgba(0, 0, 0, 0.2);
}
.action-button.intro-button {
  padding: 16px 45px;
  font-size: 1.15rem;
  margin-top: 10px;
}
#intro-error-message {
  margin-top: 20px;
}

/* --- Main Menu Area --- */
#main-menu-area.card {
  max-width: 600px;
}
.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 20px 0 20px 0;
}
#main-menu-area .button-container {
  margin-top: 15px;
}

/* --- Settings Area --- */
#settings-area.card {
  max-width: 580px;
}
.settings-section-prompt {
  grid-column: 1 / -1;
  margin-bottom: 20px;
  padding: 15px;
  background-color: rgba(var(--bg-secondary-rgb), 0.5);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  transition: background-color 0.4s ease, border 0.4s ease, padding 0.4s ease,
    box-shadow 0.4s ease, transform 0.4s ease;
}
.settings-section-prompt p {
  margin-bottom: 10px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  transition: color 0.4s ease, font-weight 0.4s ease;
}
#private-room-password-option label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--text-secondary);
}
#private-room-password-option input[type="checkbox"] {
  margin-right: 5px;
  transform: scale(1.2);
  accent-color: var(--accent-primary);
}
#private-room-info-display {
  text-align: left;
  padding: 15px;
  background-color: rgba(var(--bg-primary-rgb), 0.6);
  border: 1px solid var(--accent-tertiary);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  transition: background-color 0.4s ease, border 0.4s ease, color 0.4s ease;
}
#private-room-info-display h4 {
  color: var(--accent-tertiary);
  margin-bottom: 10px;
  font-size: 1.1rem;
  text-align: center;
}
#private-room-info-display p {
  margin-bottom: 8px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#password-display-container.hidden {
  display: none !important;
}
#private-room-info-display strong {
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  margin-right: 10px;
  font-family: "Courier New", Courier, monospace;
  letter-spacing: 1px;
  transition: background-color 0.4s ease, color 0.4s ease, border 0.4s ease;
}
#private-room-info-display small {
  display: block;
  margin-top: 12px;
  color: var(--text-secondary);
  font-style: italic;
  text-align: center;
}

#private-room-info-display .action-button.small-btn {
  padding: 5px 10px;
  font-size: 0.8rem;
  margin-left: 10px;
  color: var(--text-dark);
}
#private-room-info-display .action-button.small-btn:hover {
  background-color: var(--accent-secondary);
  filter: brightness(1.1);
}

.settings-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px 15px;
  align-items: center;
  width: 100%;
  max-width: 480px;
  margin: 0 auto 35px auto;
}
.settings-grid label {
  text-align: right;
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.95rem;
}
.settings-grid select,
.settings-grid input[type="text"],
.settings-grid input[type="password"] {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  width: 100%;
  transition: border-color var(--anim-fast) ease,
    box-shadow var(--anim-fast) ease, font-family 0.4s ease,
    background-color 0.4s ease, color 0.4s ease, border-radius 0.4s ease,
    border 0.4s ease;
}
.settings-grid select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2300FFFF' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9em top 50%;
  background-size: 1em auto;
  cursor: pointer;
}
.settings-grid select:focus,
.settings-grid input[type="text"]:focus,
.settings-grid input[type="password"]:focus {
  outline: none;
  border-color: var(--accent-secondary);
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}
.settings-grid select:hover,
.settings-grid input[type="text"]:hover,
.settings-grid input[type="password"]:hover {
  border-color: var(--accent-secondary);
}
.settings-grid select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

#nickname-inputs-container {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 15px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}
#nickname-inputs-container.hidden,
.setting-local-game.hidden,
.setting-creator.hidden,
.setting-joiner.hidden,
.setting-common.hidden,
.settings-section-prompt.hidden,
#private-room-password-option.hidden,
#room-password-input-label.hidden,
#room-password-input.hidden,
#private-room-info-display.hidden {
  display: none !important;
}
.settings-grid label.setting-local-game.hidden,
.settings-grid label.setting-creator.hidden,
.settings-grid label.setting-joiner.hidden,
.settings-grid label.setting-common.hidden {
  display: none !important;
}

#nickname-inputs-container h3.nickname-header {
  grid-column: 1 / -1;
  text-align: left;
  color: var(--accent-tertiary);
  font-size: 1rem;
  margin-bottom: 5px;
  text-shadow: 2px 2px 0 var(--comic-shadow-strong-light), -0.5px -0.5px 0 var(--comic-shadow-strong-light), 0.5px -0.5px 0 var(--comic-shadow-strong-light), -0.5px 0.5px 0 var(--comic-shadow-strong-light), 0.5px 0.5px 0 var(--comic-shadow-strong-light);
}
#nickname-inputs-container label {
  color: var(--text-secondary);
}

.settings-grid input[readonly] {
  background-color: rgba(var(--bg-secondary-rgb), 0.6);
  color: var(--text-secondary);
  cursor: default;
  border-style: solid;
  opacity: 0.8;
}
.action-button.small-btn {
  padding: 8px 18px;
  font-size: 0.85rem;
}

/* --- Lobby Area --- */
#lobby-area.card {
  max-width: 650px;
}
#lobby-title {
  color: var(--accent-tertiary);
}
#lobby-player-list {
  margin: 25px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 250px;
  overflow-y: auto;
  padding: 15px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  transition: background-color 0.4s ease, border 0.4s ease;
}
.lobby-player-item {
  background-color: var(--bg-card-opaque);
  padding: 10px 15px;
  border-radius: var(--radius-sm);
  text-align: left;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: background-color 0.4s ease, border 0.4s ease, color 0.4s ease;
}
#lobby-controls {
  margin-top: 25px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

#refresh-lobby-btn {
    padding: 10px 24px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 140px;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.6);
    color: var(--accent-tertiary);
    border: 1.5px solid var(--accent-tertiary);
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

#refresh-lobby-btn:not(.comic-theme-active *) {
    font-family: var(--font-title);
}

#refresh-lobby-btn:hover {
    background-color: rgba(255, 195, 0, 0.15);
    box-shadow: 0 0 15px rgba(255, 195, 0, 0.3);
    transform: translateY(-2px);
}

@media (max-width: 480px) {
    #refresh-lobby-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
        min-width: 110px;
        gap: 8px;
    }
}

#refresh-lobby-btn i {
    font-size: 0.95rem;
    transition: transform 0.3s ease;
}

#refresh-lobby-btn.spinning i {
    animation: fa-spin 1s linear infinite;
}

@keyframes fa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

body.comic-theme-active #refresh-lobby-btn {
    background-color: var(--comic-accent-cyan-light);
    color: var(--comic-text-on-cyan-light);
    border: 2px solid var(--comic-border-strong-light);
    box-shadow: 2px 2px 0 var(--comic-shadow-strong-light);
    font-family: var(--comic-font-main);
    font-weight: bold;
    text-shadow: 
        -0.5px -0.5px 0 var(--comic-border-strong-light), 
         0.5px -0.5px 0 var(--comic-border-strong-light), 
        -0.5px  0.5px 0 var(--comic-border-strong-light), 
         0.5px  0.5px 0 var(--comic-border-strong-light);
}

body.comic-theme-active #refresh-lobby-btn:hover {
    background-color: var(--comic-accent-cyan-hover-light);
}
/* Make lobby player names bold in Arcade mode */
body:not(.comic-theme-active) .lobby-player-item {
  font-weight: bold;
}
/* ============================ */
/* NEW LOBBY INFO STYLES (Refined Design) */
/* ============================ */

/* The main container row */
.lobby-info-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    width: 100%;
    margin-bottom: 15px;
    /* Removed the grey background box so the individual items pop more */
    background: transparent;
    padding: 0;
    border: none;
    flex-wrap: wrap;
    align-items: center;
}

/* Individual Data Blocks (e.g. "ID:", "Grid:", "Players:") */
.lobby-info-item {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px; /* Space between label and the value box */
}

/* THE VALUE BOXES (ID, 15x9, 2/4) - Applying your requested Arcade Style */
.lobby-info-item .info-val {
    font-family: var(--font-body);
    font-weight: 700;
    color: var(--accent-tertiary);
    background-color: var(--bg-primary); /* Darker background inside the badge */
    user-select: all;
    display: inline-block;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    /* The distinctive dashed look you wanted */
    border: 1px dashed var(--accent-tertiary);
    transition: all 0.4s ease;
    min-width: 60px;
    text-align: center;
}

/* ARCADE HOVER ANIMATION (Applied to ALL info items, including ID) */
.lobby-info-item .info-val:hover {
    border-style: solid;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
    background-color: rgba(255, 215, 0, 0.05);
    cursor: default;
    transform: translateY(-1px);
}


/* --- COMIC THEME OVERRIDES --- */

/* Comic Mode - Main Lobby Title text shadow fix from your snippet */
body.comic-theme-active #lobby-area p:first-of-type,
body.comic-theme-active #lobby-title + p {
  font-family: var(--font-title);
  color: var(--comic-text-primary-light);
  text-shadow: 1px 1.5px 0 #ffc300;
}

/* Comic Mode - Container */
body.comic-theme-active .lobby-info-container {
    background: transparent;
    border: none;
    transform: none; /* Removed tilt from container, looks cleaner */
}

/* Comic Mode - Text Labels */
body.comic-theme-active .lobby-info-item {
    color: var(--comic-text-primary-light);
    font-family: var(--font-title);
    font-size: 1.1rem;
}

/* Comic Mode - Value Badges (Using your requested specific design) */
body.comic-theme-active .lobby-info-item .info-val {
    font-family: var(--font-title);
    background-color: var(--comic-lobby-id-bg-light);
    color: var(--comic-lobby-id-text-light);
    /* Your requested solid comic border and shadow */
    border: 2px solid var(--comic-border-strong-light);
    box-shadow: 1px 1px 0 var(--comic-border-strong-light);
    text-shadow: 
        -0.5px -0.5px 0 var(--comic-border-strong-light), 
        0.5px -0.5px 0 var(--comic-border-strong-light), 
        -0.5px 0.5px 0 var(--comic-border-strong-light), 
        0.5px 0.5px 0 var(--comic-border-strong-light);
    border-radius: var(--radius-sm);
    padding: 4px 12px;
}

/* COMIC HOVER ANIMATION */
body.comic-theme-active .lobby-info-item .info-val:hover {
    transform: translateY(-2px) translateX(-1px);
    box-shadow: 3px 3px 0 var(--comic-border-strong-light);
}

/* --- Buttons (Default Theme) --- */
.action-button {
  font-family: var(--font-title);
  font-weight: 700;
  cursor: pointer;
  padding: 14px 30px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  transition: all 0.25s ease-in-out;
  margin: 8px 5px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
  z-index: 1;
  display: inline-block;
  color: var(--text-primary);
  background-color: var(--accent-secondary);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
  border: 2px solid transparent;
}
.action-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.6s ease;
  z-index: -1;
}
.action-button:hover::before {
  left: 100%;
}

.action-button:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
  animation: button-click-flash 0.15s ease-out;
}
@keyframes button-click-flash {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(0.75) saturate(1.2);
  }
}

.action-button.menu-button {
  width: 100%;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.05rem;
  background: transparent;
  border: 2px solid var(--accent-secondary);
  color: var(--accent-secondary);
  text-shadow: none;
}
.action-button.menu-button:hover {
  background: rgba(var(--accent-secondary-rgb), 0.1);
}

.action-button.menu-button.primary-button {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}
.action-button.menu-button.primary-button:hover {
  background: rgba(var(--accent-primary-rgb), 0.1);
}

#quick-match-btn.action-button.menu-button {
  border-color: var(--accent-tertiary);
  color: var(--accent-tertiary);
}
#quick-match-btn.action-button.menu-button:hover {
  background: rgba(var(--accent-tertiary-rgb), 0.1);
}

.action-button.primary-button:not(.menu-button) {
  background-color: var(--accent-primary);
  border-color: transparent;
  color: var(--text-primary);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}
.action-button.primary-button:not(.menu-button):hover {
  background-color: #e600e6;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4), 0 0 10px var(--accent-primary);
}

.action-button.secondary-button:not(.menu-button) {
  background-color: var(--accent-negative);
  border-color: transparent;
  color: var(--text-primary);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}
.action-button.secondary-button:not(.menu-button):hover {
  background-color: #e02121;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4), 0 0 10px var(--accent-negative);
}

.theme-toggle-btn.action-button {
  background-color: var(--accent-secondary);
  color: var(--text-dark);
  text-shadow: none;
  border-color: transparent;
}
.theme-toggle-btn.action-button i {
  color: var(--text-dark);
}
.theme-toggle-btn.action-button:hover {
    background-color: #00e0e0;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4), 0 0 10px var(--accent-secondary);
}

.button-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-top: 25px;
  flex-wrap: wrap;
}

/* --- Message Texts --- */
.message-text {
  font-weight: 500;
  margin-top: 20px;
  min-height: 1.2em;
  font-size: 0.9rem;
  transition: opacity var(--anim-fast) ease-in-out;
  opacity: 0;
  width: 100%;
}
#error-message-settings.error-text,
#main-menu-message.error-text,
#intro-error-message.error-text {
  color: var(--accent-negative);
  opacity: 1;
}
#game-message {
  text-align: center;
  width: 100%;
  min-height: 1.2em;
  margin-top: auto;
  padding: 10px 0;
  border-top: 1px solid var(--border-color);
  opacity: 1;
  font-weight: 500;
  transition: opacity var(--anim-fast) ease-in-out,
    color var(--anim-fast) ease-in-out, border-color 0.4s ease;
}

/* --- Game Area LAYOUT STYLES (Default Theme) --- */
#game-area.card {
  max-width: none;
  min-width: 300px;
  padding: clamp(15px, 2vw, 20px);
}
.game-layout-wrapper {
  display: flex;
  flex-direction: row;
  gap: clamp(15px, 2vw, 25px);
  width: 100%;
  align-items: stretch;
}
#info-panel-side {
  flex: 0 0 clamp(200px, 20vw, 280px);
  display: flex;
  flex-direction: column;
  gap: 15px;
  background-color: var(--bg-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: clamp(15px, 2vw, 25px);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-secondary) var(--bg-secondary);
  transition: filter var(--anim-slow) ease-in-out,
    opacity var(--anim-slow) ease-in-out, background-color 0.4s ease,
    border 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}
#info-panel-side.game-over-effect {
  filter: blur(2px);
  opacity: 0.5;
}
#info-panel-side::-webkit-scrollbar {
  width: 8px;
}
#info-panel-side::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}
#info-panel-side::-webkit-scrollbar-thumb {
  background-color: var(--accent-secondary);
  border-radius: 4px;
  border: 2px solid var(--bg-secondary);
}

#turn-info-container {
  width: 100%;
}
#turn-info {
  font-family: var(--font-title);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  font-weight: 700;
  letter-spacing: 0.5px;
  display: block;
  width: 100%;
  padding: 10px 15px;
  border-radius: var(--radius-md);
  transition: all var(--anim-fast) ease, font-family 0.4s ease,
    background-color 0.4s ease, color 0.4s ease, border 0.4s ease,
    box-shadow 0.4s ease, text-shadow 0.4s ease;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
  text-align: center;
  box-shadow: 0 3px 7px rgba(0, 0, 0, 0.4);
  word-wrap: break-word;
  color: var(--text-primary);
  border-width: 2px;
  border-style: solid;
}
@keyframes active-turn-pulse-strong {
  0% {
    box-shadow: 0 3px 7px rgba(0, 0, 0, 0.4), 0 0 10px currentColor,
      0 0 5px currentColor inset;
    transform: scale(1);
  }
  50% {
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.5), 0 0 20px currentColor,
      0 0 10px currentColor inset;
    transform: scale(1.02);
  }
  100% {
    box-shadow: 0 3px 7px rgba(0, 0, 0, 0.4), 0 0 10px currentColor,
      0 0 5px currentColor inset;
    transform: scale(1);
  }
}
#turn-info.active-turn-banner {
  animation: active-turn-pulse-strong 1.8s infinite ease-in-out;
}

#player-statuses {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.player-status-item {
  padding: 8px 15px;
  border-radius: var(--radius-md);
  font-size: clamp(0.85rem, 1.3vw, 1rem);
  font-weight: 500;
  transition: transform var(--anim-fast) ease-in-out,
    box-shadow var(--anim-fast) ease-in-out, opacity var(--anim-med) ease-out,
    background-color var(--anim-fast) ease-in-out,
    color var(--anim-fast) ease-in-out,
    border-color var(--anim-fast) ease-in-out, font-family 0.4s ease,
    border 0.4s ease;
  text-align: left;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  word-break: break-word;
  overflow: hidden;
  position: relative;
  color: var(--text-primary) !important;
  border-width: 3px;
  border-style: solid;
}
.player-status-item .player-status-text-wrapper {
  position: relative;
  z-index: 2;
}

.player-status-item.active-turn {
  font-weight: 700;
  z-index: 5;
  box-shadow: 0 0 8px 2px var(--active-player-glow, var(--accent-tertiary)),
    0 0 16px 4px rgba(var(--active-player-glow-rgb, 255, 215, 0), 0.55),
    inset 0 0 4px rgba(255, 255, 255, 0.1);
}

.player-status-item.eliminated {
  opacity: 0.6;
  background-color: rgba(50, 50, 60, 0.7) !important;
  color: var(--text-secondary) !important;
  border-color: #444 !important;
  transform: scale(0.98);
  box-shadow: none;
  font-style: italic;
}

#game-board-main-area {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}
#game-board-container {
  width: 100%;
  max-height: 100%;
  margin: auto;
  padding: clamp(5px, 0.8vw, 8px);
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  position: relative;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: filter var(--anim-slow) ease-in-out, background-color 0.4s ease;
  z-index: 1;
}
#game-board-container.game-over-effect {
  filter: blur(5px);
}
#game-board {
  display: grid;
  width: 100%;
  height: 100%;
  border: 2px solid var(--border-color-strong);
  background-color: var(--bg-primary);
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.6);
  border-radius: calc(var(--radius-md) - 6px);
  overflow: hidden;
  transition: border 0.4s ease, background-color 0.4s ease;
}

/* Grid Cell & Orb Styles - Default Theme */
.grid-cell {
  border: 1px solid rgba(0, 255, 255, 0.35);
  background-color: rgba(255, 255, 255, 0.02);
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  aspect-ratio: 1 / 1;
  transition: background-color var(--anim-fast) ease-out,
    border-color var(--anim-fast) ease-out, box-shadow var(--anim-fast) ease-out,
    transform var(--anim-fast) ease-out, border 0.4s ease;
  overflow: visible;
  cursor: default;
}
.grid-cell.human-turn-hoverable:hover {
  background-color: rgba(0, 255, 255, 0.15);
  box-shadow: inset 0 0 10px rgba(0, 255, 255, 0.6);
  border-color: var(--accent-secondary);
  transform: scale(1.02);
  z-index: 1;
}
.grid-cell.clicked-feedback {
  animation: click-pulse var(--anim-fast) ease-out forwards;
}
@keyframes click-pulse {
  0% {
    background-color: rgba(0, 255, 255, 0.3);
    transform: scale(0.95);
  }
  100% {
    background-color: transparent;
    transform: scale(1);
  }
}
.shake-error {
  animation: shake var(--anim-med) cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
@keyframes shake {
  10%,
  90% {
    transform: translate3d(-1px, 0, 0);
  }
  20%,
  80% {
    transform: translate3d(2px, 0, 0);
  }
  30%,
  50%,
  70% {
    transform: translate3d(-3px, 0, 0);
  }
  40%,
  60% {
    transform: translate3d(3px, 0, 0);
  }
}
.grid-cell.near-critical {
  position: relative;
}
.grid-cell.near-critical::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border: 2px solid var(--critical-glow-color, var(--accent-secondary));
  border-radius: 2px;
  animation: pulse-glow 1.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
  opacity: 0.8;
  transition: border 0.4s ease;
}
@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 4px 0px var(--critical-glow-color, var(--accent-secondary));
    opacity: 0.7;
  }
  50% {
    box-shadow: 0 0 10px 3px var(--critical-glow-color, var(--accent-secondary));
    opacity: 1;
  }
  100% {
    box-shadow: 0 0 4px 0px var(--critical-glow-color, var(--accent-secondary));
    opacity: 0.7;
  }
}
.grid-cell .explosion-effect {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20%;
  height: 20%;
  background-color: var(--explosion-color, var(--accent-tertiary));
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.1);
  opacity: 0;
  animation: cell-burst-enhanced 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  pointer-events: none;
  z-index: 5;
}
@keyframes cell-burst-enhanced {
  0% {
    transform: translate(-50%, -50%) scale(0.2) rotate(0deg);
    opacity: 0.9;
    box-shadow: 0 0 5px 2px var(--explosion-color);
  }
  20% {
    transform: translate(-50%, -50%) scale(1.2) rotate(45deg);
    opacity: 0.8;
    box-shadow: 0 0 18px 6px var(--explosion-color);
  }
  70% {
    transform: translate(-50%, -50%) scale(3.5) rotate(100deg);
    opacity: 0.3;
    box-shadow: 0 0 30px 10px var(--explosion-color);
  }
  100% {
    transform: translate(-50%, -50%) scale(4.5) rotate(135deg);
    opacity: 0;
    box-shadow: 0 0 15px 5px transparent;
  }
}
.orb-display.emptying .orb {
  animation: orb-shrink-fade-out 0.2s ease-out forwards !important;
}
@keyframes orb-shrink-fade-out {
  from {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  to {
    transform: translate(-50%, -50%) scale(0.1);
    opacity: 0;
  }
}
.orb-display {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 3;
  display: flex;
  justify-content: center;
  align-items: center;
}
.orb-display.multi-orb-animate {
  animation: slow-spin 8s linear infinite;
  /* Will-change assists browser compositing for continuous spin */
  will-change: transform;
}
@keyframes slow-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
.orb {
  width: clamp(10px, 40%, 20px);
  height: clamp(10px, 40%, 20px);
  max-width: 22px;
  max-height: 22px;
  border-radius: 50%;
  position: absolute;
  transform-origin: center center;
  transition: transform var(--anim-fast) ease-out,
    background-color 0.2s linear, border 0.4s ease,
    box-shadow 0.4s ease, background-image 0.4s ease;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.7), inset 0 0 5px rgba(0, 0, 0, 0.6),
    0px 2px 5px rgba(0, 0, 0, 0.4), 0 0 8px 1px currentColor;
  background-image: radial-gradient(
    circle at 30% 28%,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(255, 255, 255, 0.3) 45%,
    rgba(0, 0, 0, 0) 65%,
    rgba(0, 0, 0, 0.2) 100%
  );
}

/* --- UPDATE: Flying Orb styling to match the regular orb in Arcade mode --- */
.flying-orb {
    width: clamp(10px, 40%, 20px);
    height: clamp(10px, 40%, 20px);
    max-width: 22px;
    max-height: 22px;
    border-radius: 50%;
    position: absolute;
    /* Use 'fixed' so we calculate absolute window positions easier or 
       'absolute' if attached to game-board. Let's assume attached to body 
       or game-area with high z-index */
    z-index: 9999; 
    pointer-events: none;
    /* Match the .orb style: thin black boundary + slight flight glow */
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.7), 
                inset 0 0 5px rgba(0, 0, 0, 0.6), 
                0 0 12px 2px currentColor; 
    
    background-image: radial-gradient(
        circle at 30% 28%,
        rgba(255, 255, 255, 0.9) 0%,
        rgba(255, 255, 255, 0.3) 45%,
        rgba(0, 0, 0, 0) 65%,
        rgba(0, 0, 0, 0.2) 100%
    );
    transform: translate(-50%, -50%); /* Center based on left/top coordinates */
}

/* When Comic mode active */
body.comic-theme-active .flying-orb {
    border: 1.5px solid var(--border-color-strong);
    box-shadow: 0 0 0 0.5px rgba(0,0,0,0.7);
}

.orb.orb-pop-in-direct {
  animation: orb-pop-direct 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
}
@keyframes orb-pop-direct {
  0% {
    transform: translate(-50%, -50%) scale(0.05) rotate(-45deg);
    opacity: 0.1;
  }
  70% {
    transform: translate(-50%, -50%) scale(1.18) rotate(10deg);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    opacity: 1;
  }
}
.orb.orb-arrive-from-explosion {
  animation: orb-fly-in-effect 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.15s
    forwards;
  opacity: 0;
}
@keyframes orb-fly-in-effect {
  0% {
    transform: translate(-50%, -50%) scale(0.3) rotate(720deg);
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  70% {
    transform: translate(-50%, -50%) scale(1.15) rotate(10deg);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    opacity: 1;
  }
}
.orb-count-text {
  position: absolute;
  bottom: 5%;
  right: 8%;
  font-size: clamp(0.6rem, 2vw, 0.8rem);
  font-weight: 700;
  font-family: var(--font-title);
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 1px 4px;
  border-radius: 3px;
  line-height: 1;
  z-index: 4;
  transition: font-family 0.4s ease, background-color 0.4s ease, color 0.4s ease;
}

/* --- Board Overlay for GAME OVER message (Default Theme) --- */
#board-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(10, 10, 25, 0.82);
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--anim-med) ease-in-out,
    visibility var(--anim-med) ease-in-out, background-color 0.4s ease;
  padding: 20px;
  text-align: center;
  pointer-events: none;
}
#board-overlay.locked {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#overlay-message-content-wrapper {
  font-family: var(--font-title);
  opacity: 0;
  transform: scale(0.7);
  animation: overlay-message-game-over 0.5s
    cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.2s forwards;
  margin-bottom: 25px;
  position: relative;
  z-index: 101;
}
#game-over-title {
  display: block;
  font-size: clamp(2.4em, 6vw, 3.3em);
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--overlay-text-color);
  text-shadow: 0 0 5px rgba(var(--overlay-text-color-rgb), 0.6),
    2px 2px 3px rgba(0, 0, 0, 0.3);
  margin-bottom: 8px;
  line-height: 1.2;
}
#winner-name-display {
  display: block;
  font-size: clamp(2em, 5vw, 2.8em);
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--overlay-text-color);
  text-shadow: 0 0 8px var(--overlay-text-color),
    0 0 12px rgba(var(--overlay-text-color-rgb), 0.4),
    2px 2px 3px rgba(0, 0, 0, 0.4);
  line-height: 1.1;
  word-wrap: break-word;
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
}
@keyframes overlay-message-game-over {
  0% {
    opacity: 0;
    transform: scale(0.7) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0px);
  }
}

#board-overlay .button-container {
  margin-top: 20px;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUpIn var(--anim-med) ease-out forwards;
  animation-delay: 0.6s;
  position: relative;
  z-index: 101;
  width: auto;
}
#board-overlay #quit-game-overlay-btn {
  padding: 12px 28px;
  font-size: 1rem;
  background-color: var(--accent-negative);
  color: var(--text-primary);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
#board-overlay #quit-game-overlay-btn:hover {
  background-color: #d32f2f;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5);
}

@keyframes fadeUpIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
#quit-game-btn {
  padding: 10px 25px;
  font-size: 0.9rem;
}

/* --- Leaderboard Screen LAYOUT STYLES (Default Theme) --- */
#leaderboard-screen-area.card {
  max-width: 750px;
  padding: clamp(25px, 4vw, 40px);
}
#leaderboard-screen-area .main-title.small-title {
  color: var(--accent-tertiary);
  text-shadow: 0 0 8px var(--accent-tertiary),
    0 0 15px rgba(var(--accent-tertiary-rgb), 0.5);
  margin-bottom: 30px;
}
.podium-container {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 15px;
  margin: 40px auto;
  min-height: 280px;
  position: relative;
  width: 100%;
  max-width: 650px;
}
.podium-step {
  border: 2px solid var(--border-color);
  border-bottom-width: 8px;
  border-radius: var(--radius-md) var(--radius-md) 6px 6px;
  padding: 15px;
  text-align: center;
  width: clamp(140px, 28%, 190px);
  max-width: 190px;
  min-width: 120px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  opacity: 0;
  transform: translateY(100px) scale(0.8);
  animation: podium-step-appear 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
  transition: transform 0.3s ease, box-shadow 0.3s ease,
    background-color 0.4s ease, border 0.4s ease, color 0.4s ease;
  padding-bottom: 20px;
}
.podium-step:hover {
  transform: translateY(-10px) scale(1.03);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.35);
}
.podium-step.hidden {
  display: none !important;
}

.podium-step.first-place {
  background: linear-gradient(145deg, #ffed87, #ffd700, #e5c100);
  border-color: #b8860b;
  color: #423a00;
  min-height: 250px;
  padding-top: 35px;
  animation-delay: 0.4s;
  z-index: 10;
  position: relative;
  order: 0;
}
.podium-step.second-place {
  background: linear-gradient(145deg, #f0f0f0, #c0c0c0, #a9a9a9);
  border-color: #707070;
  color: var(--text-dark);
  min-height: 210px;
  animation-delay: 0s;
  order: -1;
}
.podium-step.third-place {
  background: linear-gradient(145deg, #e8a368, #cd7f32, #a0522d);
  border-color: #8b4513;
  color: var(--text-primary);
  min-height: 170px;
  animation-delay: 0.2s;
  order: 1;
}
@keyframes podium-step-appear {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.podium-medal {
  font-size: clamp(2.5rem, 6vw, 3rem);
  line-height: 1;
  margin-bottom: 10px;
  position: relative;
}
.podium-player-orb,
.lb-other-orb {
  width: clamp(65px, 13vw, 80px);
  height: clamp(65px, 13vw, 80px);
  border-radius: 50%;
  border: 4px solid white;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.6), 0 1px 3px rgba(0, 0, 0, 0.3);
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  background-clip: padding-box;
  transition: transform 0.3s ease, border 0.4s ease;
  overflow: visible;
}
.podium-player-orb {
  margin-top: 25px;
}

/* --- REVERTED/SIMPLIFIED ORB FACE STYLES --- */
.orb-face {
  position: absolute;
  width: 60%;
  height: 55%;
  top: 25%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  pointer-events: none;
  z-index: 1;
}
.orb-eyes-container {
  display: flex;
  justify-content: space-between;
  width: 100%;
  height: 35%;
  overflow: visible;
}
.eye {
  width: 28%;
  height: 100%;
  background-color: #222;
  border-radius: 50%;
  position: relative;
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.4);
  overflow: visible;
}
.eye.left {
  margin-left: 8%;
}
.eye.right {
  margin-right: 8%;
}
.eye::before {
  content: "";
  position: absolute;
  width: 35%;
  height: 35%;
  background-color: white;
  border-radius: 50%;
  top: 20%;
  left: 20%;
  box-shadow: 0 0 2px white;
}
.mouth {
  width: 55%;
  height: 30%;
  background-color: #222;
  position: relative;
  transition: all 0.2s ease-out;
}
.mouth.very-happy {
  border-radius: 0 0 100px 100px / 0 0 90px 90px;
  height: 45%;
  background-color: #222;
}
.mouth.very-happy::after {
  content: "";
  position: absolute;
  width: 65%;
  height: 55%;
  background-color: #e91e63;
  border-radius: 0 0 20px 20px;
  bottom: 5%;
  left: 50%;
  transform: translateX(-50%);
}
.mouth.happy {
  border-radius: 0 0 25px 25px;
  height: 35%;
}
.mouth.neutral {
  border-radius: 3px;
  height: auto;
  width: 45%;
  align-self: center;
  background-color: transparent;
  border-bottom: 3px solid #222;
  padding-bottom: 3px;
}
.mouth.neutral.pleased {
  border-radius: 0 0 10px 10px / 0 0 5px 5px;
  height: 20%;
  background-color: #222;
  border-bottom: none;
  padding-bottom: 0;
}
.mouth.sad {
  border-radius: 25px 25px 0 0;
  height: 35%;
}
.eye.crying::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 12px;
  background: linear-gradient(
    180deg,
    rgba(0, 200, 255, 0.7),
    rgba(0, 150, 255, 0.9)
  );
  border-radius: 50% 50% 50% 0;
  bottom: -5px;
  left: 60%;
  transform-origin: top center;
  transform: translateX(-50%) rotate(25deg) scale(0);
  opacity: 0;
  box-shadow: 0px 1px 2px rgba(0, 100, 150, 0.5);
  animation: drip-and-fade 2.5s infinite ease-out;
  animation-delay: var(--drip-delay, 0s);
}
.eye.left.crying::after {
  --drip-delay: 0.2s;
}
.eye.right.crying::after {
  --drip-delay: 0s;
}
@keyframes drip-and-fade {
  0% {
    transform: translateX(-50%) rotate(25deg) scale(0);
    opacity: 0;
  }
  20% {
    transform: translateX(-50%) rotate(20deg) scale(1);
    opacity: 0.9;
  }
  50% {
    transform: translateX(-50%) translateY(8px) rotate(15deg) scale(0.9);
    opacity: 0.7;
  }
  80% {
    transform: translateX(-50%) translateY(16px) rotate(10deg) scale(0.5);
    opacity: 0.3;
  }
  100% {
    transform: translateX(-50%) translateY(20px) rotate(5deg) scale(0.2);
    opacity: 0;
  }
}

/* FIX for smaller orbs in the 'other players' list */
.lb-other-orb .orb-face {
    width: 65%;
    height: 60%;
    top: 22%;
}
.lb-other-orb .eye {
    width: 25%;
}
.lb-other-orb .mouth {
    width: 50%;
}
.lb-other-orb .eye.crying::after {
    width: 5px;
    height: 8px;
    bottom: -5px;
    animation-name: lb-other-drip-and-fade;
}
@keyframes lb-other-drip-and-fade {
    0% { transform: translateX(-50%) rotate(25deg) scale(0); opacity: 0; }
    20% { transform: translateX(-50%) rotate(20deg) scale(1); opacity: 0.9; }
    50% { transform: translateX(-50%) translateY(5px) rotate(15deg) scale(0.9); opacity: 0.7; }
    80% { transform: translateX(-50%) translateY(10px) rotate(10deg) scale(0.5); opacity: 0.3; }
    100% { transform: translateX(-50%) translateY(12px) rotate(5deg) scale(0.2); opacity: 0; }
}
/* --- END OF FACE STYLE FIXES --- */

.podium-player-orb .orb-player-count-display {
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(0.8rem, 1.4vw, 1rem);
  font-weight: 700;
  font-family: var(--font-title);
  color: var(--text-primary);
  background-color: rgba(0, 0, 0, 0.75);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  z-index: 2;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.podium-crown {
  width: clamp(40px, 8vw, 60px);
  height: clamp(30px, 6vw, 45px);
  background-image: url("images/Crown.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  position: absolute;
  top: -25%;
  left: 15%;
  transform: translateX(-50%) translateY(-15%) rotate(-30deg);
  z-index: 3;
  pointer-events: none;
  line-height: initial;
}
.podium-player-orb .orb-count-text,
.lb-other-orb .orb-count-text {
  display: none !important;
}
@keyframes bounce-very-happy {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  30% {
    transform: translateY(-25px) scale(1.08) rotate(-3deg);
  }
  50% {
    transform: translateY(0px) scale(0.95) rotate(2deg);
  }
  70% {
    transform: translateY(-15px) scale(1.03) rotate(-2deg);
  }
  90% {
    transform: translateY(0px) scale(0.98) rotate(1deg);
  }
}
.first-place .podium-player-orb {
  animation: bounce-very-happy 1.6s infinite cubic-bezier(0.45, 0, 0.55, 1);
}
@keyframes bounce-moderate {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-15px) scale(1.02);
  }
}
.second-place .podium-player-orb {
  animation: bounce-moderate 1.8s infinite ease-in-out;
}
@keyframes bounce-minimal {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}
.third-place .podium-player-orb {
  animation: bounce-minimal 2.2s infinite ease-in-out;
}
@keyframes bounce-subtle-sad {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-2px) rotate(-0.5deg);
  }
  75% {
    transform: translateY(-2px) rotate(0.5deg);
  }
}

.podium-player-name {
  font-family: var(--font-title);
  font-size: clamp(1rem, 1.9vw, 1.15rem);
  font-weight: 600;
  word-break: break-word;
  margin-bottom: 4px;
  line-height: 1.25;
  transition: font-family 0.4s ease, color 0.4s ease, text-shadow 0.4s ease;
}
.podium-player-score {
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  font-weight: 500;
  margin-top: 5px;
  transition: font-family 0.4s ease, color 0.4s ease;
}
.first-place .podium-player-score,
.first-place .podium-player-name {
  color: #3a2e00;
}
.second-place .podium-player-score,
.second-place .podium-player-name {
  color: var(--text-dark);
}
/* Leaderboard Arcade Specifics */
body:not(.comic-theme-active) .leaderboard-others-list {
    background: rgba(15, 15, 35, 0.95);
    border: 2px solid var(--accent-secondary); 
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.15),
                inset 0 0 30px rgba(0, 255, 255, 0.05);
    padding: 0;
    border-radius: var(--radius-md);
    overflow: hidden; 
}
body:not(.comic-theme-active) .leaderboard-others-list h4 {
    border-bottom: 2px solid var(--accent-secondary);
    background: rgba(0, 255, 255, 0.1);
    margin: 0;
    padding: 15px;
    color: var(--accent-secondary);
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 2px;
}
body:not(.comic-theme-active) .leaderboard-other-item {
    display: grid;
    grid-template-columns: 50px 60px 1fr 100px;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
    margin: 0;
    background: transparent;
}
body:not(.comic-theme-active) .leaderboard-other-item:last-child {
    border-bottom: none;
}
body:not(.comic-theme-active) .lb-rank {
    text-align: center;
    width: 100%;
    color: var(--accent-tertiary);
    font-family: var(--font-title);
    display: inline-block;
    font-weight: bold;
    flex-shrink: 0;
}
body:not(.comic-theme-active) .lb-other-orb {
    margin: 0 auto;
}
body:not(.comic-theme-active) .lb-other-item-score-column {
    background-color: transparent;
    border: 1px solid var(--accent-secondary);
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.3);
    color: var(--accent-secondary);
}
/* Make leaderboard names bold in Arcade mode */
body:not(.comic-theme-active) .leaderboard-other-item .lb-name {
  font-weight: bold;
}
/* Comic Specifics need to ensure they don't break, they use the general classes below if not targeted */
.leaderboard-others-list {
  margin-top: 40px;
  text-align: left;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  padding: 15px;
  background-color: rgba(var(--bg-secondary-rgb), 0.3);
  border-radius: var(--radius-md);
  transition: background-color 0.4s ease, border 0.4s ease;
}
.leaderboard-others-list h4 {
  color: var(--accent-secondary);
  margin-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  text-align: center;
  font-size: 1.1rem;
}
/* General fallbacks for Comic Mode handled via class selectors not wrapped in body:not(...) above */
.leaderboard-other-item {
  padding: 8px 10px;
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(var(--border-color), 0.5);
  display: flex;
  align-items: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease-out, transform 0.3s ease-out,
    font-family 0.4s ease, border-color 0.4s ease;
  gap: 8px;
}
.leaderboard-other-item:last-child {
  border-bottom: none;
}
.leaderboard-other-item .lb-rank {
  display: inline-block;
  width: 25px;
  font-weight: bold;
  color: var(--text-secondary);
  text-align: right;
  flex-shrink: 0;
}
.lb-other-orb {
  width: clamp(35px, 7vw, 45px);
  height: clamp(35px, 7vw, 45px);
  border: 2px solid rgba(255, 255, 255, 0.7);
  flex-shrink: 0;
  margin-bottom: 0;
}

.leaderboard-other-item .lb-name {
  font-weight: 500;
  flex-grow: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-left: 2px;
  display: block;
  min-width: 0;
}
.lb-other-item-score-column {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  background-color: rgba(var(--bg-primary-rgb), 0.5);
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  min-width: 40px;
  text-align: center;
  flex-shrink: 0;
}
.leaderboard-other-item .lb-score-separator,
.leaderboard-other-item .lb-score {
  display: none;
}

/*
======================================================================
MOBILE RESPONSIVE FIXES (TABLET AND PHONE)
======================================================================
*/

/* Responsive Adjustments */
@media (max-width: 768px) {
  .info-container {
    flex-direction: column;
  }
  .mobile-tips-container {
    flex-direction: column; /* Stack on medium screens as well for better flow */
  }
/* --- PASTE THIS NEW CODE IN ITS PLACE --- */
  
  /* NEW: Expand the game area to use the full screen width on mobile */
  body #game-area.card {
    width: 95vw;
    max-width: none;
    padding: 15px; /* Adjust padding for smaller screen */
  }

  /* REVISED: Stack game layout vertically */
  .game-layout-wrapper {
    flex-direction: column;
    gap: 15px;
  }
  
  #info-panel-side {
    flex: 0 0 auto; /* Prevent panel from shrinking */
    max-width: 100%;
    order: -1; /* Move info panel to the top */
  }
  
  /* REVISED: This is the core of the scaling fix */
  #game-board-main-area {
    width: 100%;
    flex-grow: 1; /* Allow it to take up available vertical space */
    display: flex; /* Use flexbox to center the board container */
    justify-content: center;
    align-items: center;
    min-height: 300px; /* Give it some minimum height */
  }
  
  #game-board-container {
    width: 100%; /* Take up full width of its parent */
    height: auto; /* Height will be determined by aspect ratio */
    max-height: 100%; /* Don't grow taller than the parent area */
    position: relative; /* Keep for overlays */
    /* The 'aspect-ratio' property will be set by JavaScript */
  }

  #game-board {
    /* Make the grid fill its container perfectly */
    width: 100%;
    height: 100%;
  }
  h1.main-title {
    font-size: clamp(2rem, 8vw, 2.8rem);
  }
  h1.main-title.intro-game-title {
    font-size: clamp(2.5rem, 10vw, 3.5rem);
  }
  .intro-subtitle {
    font-size: clamp(1rem, 2vw, 1.3rem);
  }
  h2.section-title {
    font-size: clamp(1.1rem, 4vw, 1.3rem);
    margin-bottom: 20px;
  }
  .action-button {
    padding: 12px 25px;
    font-size: 0.9rem;
  }
  #quit-game-btn {
    padding: 8px 20px;
    font-size: 0.8rem;
  }
  #game-over-title {
    font-size: clamp(1.8em, 5vw, 2.5em);
  }
  #winner-name-display {
    font-size: clamp(2.2em, 6.5vw, 3.5em);
  }
  .settings-grid {
    max-width: 100%;
  }
  #nickname-inputs-container {
    grid-template-columns: auto 1fr;
  }
  .podium-container {
    flex-direction: column;
    align-items: center;
    gap: 20px;
    min-height: auto;
  }
  .podium-step {
    width: 80%;
    max-width: 250px;
    height: auto !important;
    animation-delay: 0s !important;
  }
  .podium-step.second-place {
    order: 1;
    min-height: 170px;
  }
  .podium-step.first-place {
    order: 0;
    min-height: 190px;
  }
  .podium-step.third-place {
    order: 2;
    min-height: 150px;
  }
  .leaderboard-other-item {
    gap: 8px;
  }
  /* Arcade Mobile Specifics */
  body:not(.comic-theme-active) .leaderboard-other-item {
      display: grid;
      grid-template-columns: 35px 45px 1fr 60px;
      align-items: center;
      gap: 10px;
      padding: 10px 15px;
  }
  
  .lb-other-orb {
    margin-right: 8px;
  }
  .lb-other-item-score-column {
    font-size: 0.8rem;
    padding: 2px 5px;
    min-width: 30px;
  }
}
@media (max-width: 480px) {
  .page-wrapper {
    padding: 10px 5px;
  }
  .card {
    padding: 15px;
  }
  #info-panel-side {
    padding: 10px;
    gap: 8px;
  }
  .player-status-item {
    padding: 4px 8px;
    font-size: 0.75rem;
  }
  #turn-info {
    font-size: 0.9rem;
    padding: 6px 10px;
  }
  .settings-grid {
    gap: 12px 10px;
    grid-template-columns: 1fr;
  }
  .settings-grid label {
    text-align: left;
  }
  #nickname-inputs-container {
    grid-template-columns: 1fr;
  }
  #nickname-inputs-container label {
    text-align: left;
  }
  .settings-grid select,
  .settings-grid input[type="text"],
  .settings-grid input[type="password"] {
    padding: 10px 15px;
  }
  .action-button {
    padding: 10px 20px;
    font-size: 0.8rem;
  }
  .action-button.menu-button {
    font-size: 0.9rem;
    padding: 12px 20px;
  }
  #quit-game-btn {
    padding: 8px 16px;
    font-size: 0.75rem;
  }
  #game-over-title {
    font-size: clamp(1.5em, 4.5vw, 2em);
  }
  #winner-name-display {
    font-size: clamp(1.8em, 5.5vw, 2.5em);
  }
  .menu-buttons {
    gap: 12px;
  }
  .user-greeting-banner {
    font-size: 0.85rem;
    padding: 6px 10px;
    margin-bottom: 15px;
  }
  h1.main-title.intro-game-title {
    font-size: clamp(2.2rem, 9vw, 3rem);
  }
  .intro-subtitle {
    font-size: clamp(0.9rem, 1.8vw, 1.1rem);
    margin-bottom: 25px;
  }
  #intro-nickname-input {
    padding: 12px 18px;
    font-size: 1rem;
  }
  .action-button.intro-button {
    padding: 12px 30px;
    font-size: 1rem;
  }
  .podium-medal {
    font-size: 2rem;
  }
  .podium-player-orb {
    width: 50px;
    height: 50px;
    margin-bottom: 25px;
  }
  .lb-other-orb {
    width: 30px;
    height: 30px;
  }
  .podium-crown {
    width: 30px;
    height: 22px;
    top: -45%;
    transform: translateX(-50%) translateY(-5%) rotate(-10deg);
  }
  .orb-player-count-display {
    display: none;
  }
  .podium-player-name {
    font-size: 1rem;
  }
  .podium-player-score {
    font-size: 0.8rem;
  }
  .leaderboard-others-list {
    padding: 10px;
  }
  .lb-other-item-score-column {
    font-size: 0.75rem;
    padding: 2px 4px;
    min-width: 35px;
  }
}

/*
======================================================================
COMIC THEME STYLES (Overrides)
======================================================================
*/

body.comic-theme-active {
  --comic-font-main: "Comic Neue", cursive;
  font-weight: bold;
  --comic-font-title: "Bangers", cursive;
  --comic-bg-page-light: #f0f0f0;
  --comic-bg-dots-light: #d0d0d0;
  --comic-bg-card-light: rgba(255, 255, 255, 0.97);
  --comic-text-primary-light: #181818;
  --comic-text-secondary-light: #3a3a3a;
  --comic-border-strong-light: #000000;
  --comic-border-subtle-light: #a0a0a0;
  --comic-shadow-strong-light: #000000;
  --comic-shadow-faint-light: rgba(0, 0, 0, 0.1);
  --comic-accent-red-light: #e63946;
  --comic-accent-blue-light: #1d3557;
  --comic-accent-yellow-text-light: #e6b800;
  --comic-accent-yellow-bg-light: #ffc300;
  --comic-accent-cream-light: #fffacd;
  --comic-accent-purple-light: #8338ec;
  --comic-accent-cyan-light: #4ecdc4;
  --comic-accent-cyan-hover-light: #2bb7ae;
  --comic-accent-positive-light: #06d6a0;
  --comic-text-on-red-light: #ffffff;
  --comic-text-on-cyan-light: #000000;
  --comic-text-on-yellow-bg-light: #000000;
  --comic-text-on-cream-light: var(--comic-accent-yellow-text-light);
  --comic-text-on-purple-light: #ffffff;
  --comic-overlay-bg: rgba(255, 255, 255, 0.85);
  --comic-lobby-id-bg-light: #e0e0e0;
  --comic-lobby-id-text-light: var(--comic-accent-yellow-text-light);

  --font-body: var(--comic-font-main);
  --font-title: var(--comic-font-title);
  --bg-primary: var(--comic-bg-page-light);
  --bg-secondary: #e8e8e8;
  --bg-card: var(--comic-bg-card-light);
  --bg-card-opaque: var(--comic-bg-card-light);
  --text-primary: var(--comic-text-primary-light);
  --text-secondary: var(--comic-text-secondary-light);
  --text-dark: var(--comic-text-primary-light);
  --border-color: var(--comic-border-subtle-light);
  --border-color-strong: var(--comic-border-strong-light);
  --shadow-color: var(--comic-shadow-faint-light);
  --shadow-card: 4px 4px 0 var(--comic-shadow-strong-light);
  --accent-primary: var(--comic-accent-red-light);
  --accent-secondary: var(--comic-accent-blue-light);
  --accent-tertiary: var(--comic-accent-yellow-bg-light);
  --accent-positive: var(--comic-accent-positive-light);
  --accent-negative: var(--comic-accent-red-light);
  --overlay-text-color: var(--comic-text-primary-light);
  --overlay-text-color-rgb: 24, 24, 24;
  --pulse-shadow-orb: rgba(0, 0, 0, 0.3);
  --pulse-shadow-orb-glow: rgba(0, 0, 0, 0.1);
}

/* --- General Comic Theme Overrides --- */
body.comic-theme-active {
  background-image: radial-gradient(
      var(--comic-bg-dots-light) 8%,
      transparent 9%
    ),
    radial-gradient(var(--comic-bg-dots-light) 8%, transparent 9%);
  background-size: 25px 25px;
  background-position: 0 0, 12.5px 12.5px;
  background-attachment: fixed;
  letter-spacing: 0.2px;
}

body.comic-theme-active,
body.comic-theme-active p, 
body.comic-theme-active label,
body.comic-theme-active .button-container button, 
body.comic-theme-active .settings-grid select,
body.comic-theme-active .settings-grid input,
body.comic-theme-active .message-text,
body.comic-theme-active .lobby-player-item .player-status-text-wrapper, 
body.comic-theme-active .player-status-item .player-status-text-wrapper,
body.comic-theme-active .podium-player-score, 
body.comic-theme-active .leaderboard-other-item,
body.comic-theme-active #private-room-info-display p,
body.comic-theme-active #private-room-info-display small {
  font-family: var(--font-body);
  font-weight: bold;
}
body.comic-theme-active h1,
body.comic-theme-active h2,
body.comic-theme-active h3,
body.comic-theme-active h4,
body.comic-theme-active .action-button,
body.comic-theme-active #turn-info,
body.comic-theme-active .podium-player-name,
body.comic-theme-active #game-over-title,
body.comic-theme-active .lb-other-item-score-column,
body.comic-theme-active #lobby-area p:first-of-type,
body.comic-theme-active #lobby-room-id {
  font-family: var(--font-title);
}
body.comic-theme-active #winner-name-display {
  font-family: var(--font-body);
  font-weight: bold;
}

body.comic-theme-active .card {
  border-radius: 10px;
  border: 3px solid var(--border-color-strong);
  box-shadow: var(--shadow-card);
  transform: rotate(-0.7deg);
  background-image: none;
  padding: clamp(18px, 2.5vw, 28px);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body.comic-theme-active .card:hover {
  transform: rotate(0.1deg) translateY(-1px);
  box-shadow: 5px 5px 0 var(--border-color-strong);
}

body.comic-theme-active #game-area.card {
  padding: clamp(15px, 2vw, 20px);
}
body.comic-theme-active #leaderboard-screen-area.card {
  padding: clamp(25px, 4vw, 40px);
}

body.comic-theme-active h1.main-title {
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  color: var(--comic-accent-red-light);
  text-shadow: 2px 2px 0 var(--comic-shadow-strong-light),
    -0.5px -0.5px 0 var(--comic-shadow-strong-light),
    0.5px -0.5px 0 var(--comic-shadow-strong-light),
    -0.5px 0.5px 0 var(--comic-shadow-strong-light),
    0.5px 0.5px 0 var(--comic-shadow-strong-light);
  letter-spacing: 1px;
  padding: 6px 18px;
  margin-bottom: 18px;
}

body.comic-theme-active h1.main-title::before {
  border: 3px solid var(--border-color-strong);
  border-radius: 10px;
  background: var(--comic-accent-yellow-bg-light);
  transform: rotate(-2deg);
}

body.comic-theme-active h2.section-title {
  color: var(--comic-accent-purple-light);
  border-bottom: 3px solid var(--accent-primary);
  letter-spacing: 0.8px;
  text-shadow: 1px 1px 0 var(--comic-shadow-strong-light);
  padding-bottom: 6px;
  margin-bottom: 18px;
}

body.comic-theme-active .settings-section-prompt {
  background-color: rgba(255, 255, 255, 0.9);
  border: 2px dashed var(--comic-border-strong-light);
  padding: 12px;
  box-shadow: 2px 2px 0px var(--comic-shadow-faint-light);
  transform: rotate(0.5deg);
}
body.comic-theme-active .settings-section-prompt p {
  color: var(--comic-text-primary-light);
  font-size: 0.9rem;
  font-weight: bold;
}
body.comic-theme-active #private-room-info-display {
  background-color: rgba(255, 220, 150, 0.9);
  border: 2px solid var(--comic-border-strong-light);
  color: var(--comic-text-primary-light);
}
body.comic-theme-active #private-room-info-display h4 {
  color: var(--comic-accent-red-light);
}
body.comic-theme-active #private-room-info-display strong {
  background-color: var(--comic-bg-page-light);
  color: var(--comic-text-primary-light);
  border: 1px solid var(--comic-border-subtle-light);
}

body.comic-theme-active .user-greeting-banner {
  font-family: var(--font-title);
  background-color: var(--comic-accent-yellow-bg-light);
  color: var(--comic-text-on-yellow-bg-light);
  border: 3px solid var(--comic-border-strong-light);
  box-shadow: 3px 3px 0 var(--comic-shadow-strong-light);
  transform: rotate(1deg);
  padding: 6px 20px;
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  letter-spacing: 1px;
}

body.comic-theme-active .action-button {
  font-weight: normal;
  border: 2px solid var(--border-color-strong);
  border-radius: 20px;
  padding: 8px 18px;
  letter-spacing: 0.8px;
  text-shadow: 0.5px 0.5px 0 var(--comic-shadow-strong-light),
    -0.5px -0.5px 0 var(--comic-shadow-strong-light),
    0.5px -0.5px 0 var(--comic-shadow-strong-light),
    -0.5px 0.5px 0 var(--comic-shadow-strong-light);
  box-shadow: 2px 2px 0 var(--comic-shadow-strong-light);
}
body.comic-theme-active .action-button:hover {
  transform: translateY(-1px) translateX(-1px);
  box-shadow: 3px 3px 0 var(--comic-shadow-strong-light);
}
body.comic-theme-active .action-button:active {
  transform: translateY(0) translateX(0);
  box-shadow: 1px 1px 0 var(--comic-shadow-strong-light);
}

body.comic-theme-active .menu-buttons .action-button {
  background-color: var(--comic-accent-red-light);
  color: var(--comic-text-on-red-light);
}
body.comic-theme-active .menu-buttons .action-button:hover {
  background-color: #ff5c5c;
}

body.comic-theme-active .menu-buttons #quick-match-btn {
  background-color: var(--comic-accent-cream-light);
  color: var(--comic-text-on-cream-light);
  text-shadow: -1px -1px 0 var(--comic-border-strong-light),
    1px -1px 0 var(--comic-border-strong-light),
    -1px 1px 0 var(--comic-border-strong-light),
    1px 1px 0 var(--comic-border-strong-light), 1px 1px 0px rgba(0, 0, 0, 0.2);
}
body.comic-theme-active .menu-buttons #quick-match-btn:hover {
  background-color: #fff0b3;
}

body.comic-theme-active .menu-buttons #local-game-btn {
  background-color: var(--comic-accent-cyan-light);
  color: var(--comic-text-on-cyan-light);
  text-shadow: 0.5px 0.5px 0 rgba(0, 0, 0, 0.2);
}
body.comic-theme-active .menu-buttons #local-game-btn:hover {
  background-color: var(--comic-accent-cyan-hover-light);
}

body.comic-theme-active .action-button.primary-button:not(.menu-button) {
  background-color: var(--comic-accent-cyan-light);
  color: var(--comic-text-on-cyan-light);
  text-shadow: 0.5px 0.5px 0 rgba(0, 0, 0, 0.2);
}
body.comic-theme-active .action-button.primary-button:not(.menu-button):hover {
  background-color: var(--comic-accent-cyan-hover-light);
}

body.comic-theme-active .action-button.secondary-button:not(.menu-button) {
  background-color: var(--comic-accent-red-light);
  color: var(--comic-text-on-red-light);
}
body.comic-theme-active
  .action-button.secondary-button:not(.menu-button):hover {
  background-color: #ff5c5c;
}

/* CORRECTED: Comic Theme Toggle Button styling */
body.comic-theme-active .theme-toggle-btn.action-button {
  background-color: var(--comic-accent-purple-light);
  color: var(--comic-text-on-purple-light);
  font-family: var(--font-title);
  border: 2px solid var(--comic-border-strong-light);
  border-radius: 20px;
  box-shadow: 2px 2px 0 var(--comic-shadow-strong-light);
  text-shadow:
    -1px -1px 0 var(--comic-border-strong-light),
     1px -1px 0 var(--comic-border-strong-light),
    -1px  1px 0 var(--comic-border-strong-light),
     1px  1px 0 var(--comic-border-strong-light);
}
body.comic-theme-active .theme-toggle-btn.action-button i {
  color: var(--comic-text-on-purple-light);
}
body.comic-theme-active .theme-toggle-btn.action-button:hover {
  background-color: #7a28d8;
  transform: translateY(-1px) translateX(-1px);
  box-shadow: 3px 3px 0 var(--comic-border-strong-light);
}

body.comic-theme-active #private-room-info-display .action-button.small-btn {
  background-color: var(--comic-accent-red-light);
  color: var(--comic-text-on-red-light);
  padding: 5px 12px;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}
body.comic-theme-active
  #private-room-info-display
  .action-button.small-btn:hover {
  background-color: #ff5c5c;
}

body.comic-theme-active #intro-screen-area .intro-label {
  font-family: var(--font-title);
  font-size: 1.3rem;
  color: var(--comic-accent-blue-light);
  text-shadow: 1px 1px 0px #fff;
}
body.comic-theme-active #intro-nickname-input {
  font-family: var(--font-title);
  font-size: 1.5rem;
  text-transform: uppercase;
  color: var(--comic-accent-yellow-text-light);
  text-shadow: -1px -1px 0 var(--comic-border-strong-light),
    1px -1px 0 var(--comic-border-strong-light),
    -1px 1px 0 var(--comic-border-strong-light),
    1px 1px 0 var(--comic-border-strong-light),
    2px 2px 0 var(--comic-accent-red-light);

  border: 3px solid var(--comic-border-strong-light);
  border-radius: 8px;
  box-shadow: 2px 2px 0 var(--comic-shadow-strong-light);
  transform: rotate(-1deg);
  padding: 12px 20px;
  background-color: #fff;
}
body.comic-theme-active #intro-nickname-input:focus {
  box-shadow: 2px 2px 0 var(--comic-shadow-strong-light),
    0 0 0 3px var(--comic-accent-yellow-bg-light);
  outline: none;
  transform: rotate(0deg);
}

body.comic-theme-active #intro-nickname-input::placeholder {
  color: var(--comic-border-subtle-light);
  opacity: 0.8;
  text-shadow: -1px -1px 0 var(--comic-border-strong-light),
    1px -1px 0 var(--comic-border-strong-light),
    -1px 1px 0 var(--comic-border-strong-light),
    1px 1px 0 var(--comic-border-strong-light),
    1.5px 1.5px 0 var(--comic-accent-red-light);
}

body.comic-theme-active #intro-nickname-input:focus::placeholder {
  color: transparent;
  opacity: 0;
}
body.comic-theme-active .action-button.intro-button {
  font-size: 1.2rem;
  padding: 14px 40px;
}

body.comic-theme-active .settings-grid select,
body.comic-theme-active .settings-grid input[type="text"],
body.comic-theme-active .settings-grid input[type="password"] {
  border: 2px solid var(--border-color-strong);
  border-radius: 6px;
  box-shadow: inset 1px 1px 0px rgba(0, 0, 0, 0.1);
  padding: 8px 12px;
  background-color: #fdfdfd;
  color: var(--text-primary);
}
body.comic-theme-active .settings-grid select:focus,
body.comic-theme-active .settings-grid input[type="text"]:focus,
body.comic-theme-active .settings-grid input[type="password"]:focus {
  box-shadow: inset 1px 1px 0px rgba(0, 0, 0, 0.1),
    0 0 0 2px var(--accent-tertiary);
  outline: none;
}
body.comic-theme-active .settings-grid select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%23000000' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-size: 0.8em auto;
}

body.comic-theme-active #turn-info {
  border: 2px solid var(--border-color-strong);
  border-radius: 8px;
  box-shadow: 2px 2px 0 var(--comic-shadow-strong-light) !important;
  animation: none !important;
  color: var(--comic-text-on-red-light) !important;
  text-shadow: 1px 1px 0 var(--comic-shadow-strong-light),
    -1px -1px 0 var(--comic-shadow-strong-light);
}
body.comic-theme-active .player-status-item {
  font-weight: 700;
  border: 2px solid var(--border-color-strong);
  border-radius: 6px;
  box-shadow: 1px 1px 0 var(--comic-shadow-strong-light);
  color: var(--comic-text-on-red-light) !important;
  text-shadow: 0.5px 0.5px 0 var(--comic-shadow-strong-light),
    -0.5px -0.5px 0 var(--comic-shadow-strong-light);
  position: relative;
  overflow: hidden;
}
body.comic-theme-active .player-status-item .player-status-text-wrapper {
  position: relative;
  z-index: 2;
}
body.comic-theme-active .player-status-item.active-turn::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(rgba(0, 0, 0, 0.3) 20%, transparent 21%);
  background-size: 4px 4px;
  animation: comic-dots-scroll 10s linear infinite;
  z-index: 1;
  border-radius: inherit;
}
@keyframes comic-dots-scroll {
  from {
    background-position: 0 0;
  }
  to {
    background-position: -50px 50px;
  }
}
body.comic-theme-active .player-status-item.active-turn {
  box-shadow: 1px 1px 0 var(--comic-shadow-strong-light),
    0 0 8px 1px var(--active-player-glow, var(--accent-tertiary)) !important;
  transform: scale(1.02);
}
body.comic-theme-active .player-status-item.eliminated {
  color: var(--comic-text-secondary-light) !important;
  text-shadow: none;
  opacity: 0.7;
}
body.comic-theme-active .player-status-item.eliminated::after {
  display: none;
}

body.comic-theme-active #game-board {
  border: 3px solid var(--border-color-strong);
  background-color: var(--comic-bg-page-light);
}
body.comic-theme-active .grid-cell {
  border: 1px solid var(--comic-border-subtle-light);
  background-color: transparent;
}
body.comic-theme-active .grid-cell.near-critical::before {
  border: 2px solid var(--critical-glow-color, var(--accent-primary));
  animation: comic-pulse-glow 1.2s ease-in-out infinite;
}
@keyframes comic-pulse-glow {
  0% {
    box-shadow: 0 0 2px 0px var(--critical-glow-color),
      inset 0 0 1px var(--critical-glow-color);
    opacity: 0.6;
  }
  50% {
    box-shadow: 0 0 6px 1px var(--critical-glow-color),
      inset 0 0 3px var(--critical-glow-color);
    opacity: 1;
  }
  100% {
    box-shadow: 0 0 2px 0px var(--critical-glow-color),
      inset 0 0 1px var(--critical-glow-color);
    opacity: 0.6;
  }
}

body.comic-theme-active .orb {
  border: 1.5px solid var(--border-color-strong) !important;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.7),
    inset 0.5px 0.5px 1px rgba(0, 0, 0, 0.3), 0.5px 0.5px 1px rgba(0, 0, 0, 0.4) !important;
  background-image: radial-gradient(
    circle at 30% 28%,
    rgba(255, 255, 255, 0.6) 0%,
    rgba(255, 255, 255, 0.1) 40%,
    transparent 60%
  ) !important;
}
body.comic-theme-active .orb-count-text {
  background-color: var(--border-color-strong);
  color: var(--accent-tertiary);
  text-shadow: none;
  padding: 0px 2px;
  border-radius: 1.5px;
  font-size: clamp(0.45rem, 1.5vw, 0.6rem);
}

body.comic-theme-active #lobby-title {
  color: var(--comic-accent-red-light);
  text-shadow: 2px 2px 0 var(--comic-border-strong-light),
    -2px -2px 0 var(--comic-border-strong-light),
    2px -2px 0 var(--comic-border-strong-light),
    -2px 2px 0 var(--comic-border-strong-light),
    3px 3px 0px var(--comic-accent-yellow-bg-light);
  font-size: clamp(2rem, 5vw, 2.8rem);
  margin-bottom: 15px;
}
body.comic-theme-active #lobby-area p:first-of-type {
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: var(--comic-text-primary-light);
  text-shadow: 1px 1.5px 0 #ffc300;
}
body.comic-theme-active #lobby-area h2.section-title {
  color: var(--comic-accent-purple-light);
  border-bottom: 3px solid var(--comic-accent-red-light);
  text-shadow: 1.5px 1.5px 0 var(--comic-border-strong-light);
  font-size: clamp(1.3rem, 2.8vw, 1.7rem);
  padding-bottom: 8px;
  margin-bottom: 20px;
}
body.comic-theme-active #lobby-player-list {
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid var(--comic-border-strong-light);
  border-radius: var(--radius-sm);
  box-shadow: 2px 2px 0 var(--comic-shadow-faint-light);
  padding: 10px;
}
body.comic-theme-active .lobby-player-item {
  background-color: transparent;
  border: 2px dashed var(--comic-border-subtle-light);
  color: var(--comic-text-primary-light) !important;
  font-family: var(--font-body);
  font-weight: bold;
  text-shadow: 0.5px 0.5px 0 #fff, -0.5px -0.5px 0 #fff, 0.5px -0.5px 0 #fff,
    -0.5px 0.5px 0 #fff, 0.5px 0.5px 1px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  padding: 8px 12px;
  box-shadow: none;
}
body.comic-theme-active .lobby-player-item[style*="color"] {
  color: var(--comic-text-primary-light) !important;
}
body.comic-theme-active .lobby-player-item[style*="border-left"] {
  border-left-width: 4px !important;
}
body.comic-theme-active #lobby-controls .action-button {
  background-color: var(--comic-accent-red-light);
  color: var(--comic-text-on-red-light);
}
body.comic-theme-active #lobby-controls .action-button:hover {
  background-color: #ff5c5c;
}
body.comic-theme-active #lobby-controls #start-game-host-btn {
  background-color: var(--comic-accent-positive-light);
  color: var(--comic-text-on-yellow-bg-light);
}
body.comic-theme-active #lobby-controls #start-game-host-btn:hover {
  background-color: #05c880;
}

body.comic-theme-active #board-overlay {
  background-color: var(--comic-overlay-bg);
}
body.comic-theme-active #overlay-message-content-wrapper {
  font-family: var(--font-title);
}
body.comic-theme-active #game-over-title {
  color: var(--comic-accent-red-light);
  text-shadow: 2px 2px 0 var(--comic-shadow-strong-light),
    -1px -1px 0 var(--comic-shadow-strong-light),
    1px -1px 0 var(--comic-shadow-strong-light),
    -1px 1px 0 var(--comic-shadow-strong-light),
    1px 1px 0 var(--comic-shadow-strong-light);
}
body.comic-theme-active #winner-name-display {
  font-weight: bold;
  color: var(--overlay-text-color);
  text-shadow: 1px 1px 0 var(--comic-shadow-strong-light),
    -1px -1px 0 var(--comic-shadow-strong-light);
}
body.comic-theme-active #board-overlay #quit-game-overlay-btn {
  background-color: var(--comic-accent-red-light);
  color: var(--comic-text-on-red-light);
  padding: 10px 25px;
  font-size: 0.9rem;
}
body.comic-theme-active #board-overlay #quit-game-overlay-btn:hover {
  background-color: #d4303e;
}

body.comic-theme-active #leaderboard-screen-area .main-title.small-title {
  color: var(--comic-accent-red-light);
  text-shadow: 1.5px 1.5px 0 var(--comic-border-strong-light),
    -1.5px -1.5px 0 var(--comic-border-strong-light),
    1.5px -1.5px 0 var(--comic-border-strong-light),
    -1.5px 1.5px 0 var(--comic-border-strong-light);
}

body.comic-theme-active #leaderboard-screen-area .podium-player-name {
  color: var(--comic-text-primary-light) !important;
  text-shadow: -0.5px -0.5px 0 #fff, 0.5px -0.5px 0 #fff, -0.5px 0.5px 0 #fff,
    0.5px 0.5px 0 #fff, 0.5px 0.5px 1px rgba(0, 0, 0, 0.3);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: clamp(1.1rem, 2vw, 1.25rem);
}
body.comic-theme-active .first-place .podium-player-name,
body.comic-theme-active .second-place .podium-player-name,
body.comic-theme-active .third-place .podium-player-name {
  color: var(--comic-text-primary-light) !important;
}

body.comic-theme-active #leaderboard-screen-area .leaderboard-other-item {
  padding: 8px 10px;
  border-bottom: 1.5px dashed var(--comic-border-strong-light);
  display: flex;
  align-items: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease-out, transform 0.3s ease-out,
    font-family 0.4s ease, border-color 0.4s ease;
  gap: 8px;
}

body.comic-theme-active
  #leaderboard-screen-area
  .leaderboard-other-item
  .lb-name {
  color: var(--comic-text-primary-light) !important;
  font-weight: bold;
  text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff,
    1px 1px 0 #fff, 1px 1px 1px rgba(0, 0, 0, 0.2);
  flex-grow: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-left: 2px;
  display: block;
  min-width: 0;
}

body.comic-theme-active .lb-other-item-score-column {
  text-shadow: -0.5px -0.5px 0 #fff, 0.5px -0.5px 0 #fff, -0.5px 0.5px 0 #fff, 0.5px 0.5px 0 #fff, 0.5px 0.5px 1px rgba(0, 0, 0, 0.3);
}

body.comic-theme-active #leaderboard-screen-area .podium-step {
  border: 3px solid var(--border-color-strong);
}
body.comic-theme-active #leaderboard-screen-area .podium-step.first-place {
  background: var(--accent-tertiary);
}

body.comic-theme-active #leaderboard-screen-area .podium-player-orb {
  border: 2px solid var(--border-color-strong) !important;
}
body.comic-theme-active #leaderboard-screen-area .leaderboard-others-list {
  background: rgba(250, 250, 250, 0.9);
  border: 2px solid var(--border-color-strong);
}
body.comic-theme-active #leaderboard-screen-area .leaderboard-other-item {
  border-bottom: 1.5px dashed var(--comic-border-strong-light);
}

.comic-background-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(4, 1fr);
  grid-gap: 6px;
  padding: 6px;
  z-index: -1;
  border: 2px solid var(--border-color-strong);
  background-color: var(--bg-secondary);
  opacity: 0;
  transition: opacity 0.5s ease-in-out, border-color 0.4s ease,
    background-color 0.4s ease;
  overflow: hidden;
}

body.comic-theme-active .comic-background-container {
  opacity: 0.25;
}

.comic-background-container .panel {
  position: relative;
  overflow: hidden;
  border-radius: 3px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
  border: 2px solid var(--border-color-strong);
  transition: border-color 0.4s ease;
}

.comic-background-container .panel.bg-col-1 {
  background: #ff6b6b;
}
.comic-background-container .panel.bg-col-2 {
  background: #4ecdc4;
}
.comic-background-container .panel.bg-col-3 {
  background: #ffd166;
}
.comic-background-container .panel.bg-col-4 {
  background: #06d6a0;
}
.comic-background-container .panel.bg-col-5 {
  background: #118ab2;
}
.comic-background-container .panel.bg-col-6 {
  background: #9b5de5;
}
.comic-background-container .panel.bg-col-7 {
  background: #ef476f;
}

.comic-background-container .orb-bg-anim {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
  pointer-events: none;
  border: 2px solid var(--border-color-strong);
  transform-origin: center center;
  transition: background-color 0.4s ease, box-shadow 0.4s ease,
    border-color 0.4s ease;
}

.comic-background-container .bounce .orb-bg-anim {
  animation: bounce-improved 4s infinite cubic-bezier(0.5, 0.05, 0.5, 0.95);
}
.comic-background-container .diagonal .orb-bg-anim {
  animation: diagonal-improved 5s infinite linear;
}
.comic-background-container .fade .orb-bg-anim {
  animation: fade-improved 3s infinite ease-in-out;
}
.comic-background-container .pulse .orb-bg-anim {
  animation: pulse-improved 2s infinite ease-in-out;
}
.comic-background-container .pop .orb-bg-anim {
  animation: pop-improved 1.5s infinite ease-out;
}
.comic-background-container .zigzag .orb-bg-anim {
  animation: zigzag-improved 5s infinite ease-in-out;
}
.comic-background-container .float .orb-bg-anim {
  animation: float-improved 6s infinite ease-in-out;
}
.comic-background-container .shake .orb-bg-anim {
  animation: shake-improved 0.5s infinite ease-in-out;
}
.comic-background-container .orbit .orb-bg-anim {
  animation: orbit-improved 8s infinite linear;
}
.comic-background-container .wave .orb-bg-anim {
  animation: wave-improved 7s infinite ease-in-out;
}
.comic-background-container .dvd-bounce .orb-bg-anim {
  animation: dvd-bounce-improved 6s infinite linear;
}

@keyframes bounce-improved {
  0%,
  100% {
    transform: translate(0px, 0px) scale(1) rotate(0deg);
  }
  25% {
    transform: translate(30px, 40px) scale(1.1, 0.9) rotate(15deg);
  }
  50% {
    transform: translate(-20px, -10px) scale(0.9, 1.1) rotate(-10deg);
  }
  75% {
    transform: translate(10px, -30px) scale(1.1, 0.9) rotate(5deg);
  }
}
@keyframes diagonal-improved {
  0% {
    transform: translate(-25px, -25px) rotate(0deg);
    opacity: 0.7;
  }
  50% {
    transform: translate(25px, 25px) rotate(180deg);
    opacity: 1;
  }
  100% {
    transform: translate(-25px, -25px) rotate(360deg);
    opacity: 0.7;
  }
}
@keyframes fade-improved {
  0%,
  100% {
    opacity: 0.1;
    transform: scale(0.7) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.1) rotate(15deg);
  }
  75% {
    opacity: 0.8;
    transform: scale(1) rotate(-5deg);
  }
}
@keyframes pulse-improved {
  0%,
  100% {
    transform: scale(0.9);
    box-shadow: 0 0 8px var(--pulse-shadow-orb);
  }
  50% {
    transform: scale(1.3);
    box-shadow: 0 0 15px var(--pulse-shadow-orb-glow);
  }
}
@keyframes pop-improved {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  30% {
    transform: scale(1.2);
    opacity: 1;
  }
  60% {
    transform: scale(0.9);
    opacity: 1;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}
@keyframes zigzag-improved {
  0%,
  100% {
    transform: translate(0px, 0px) rotate(0deg);
  }
  25% {
    transform: translate(35px, 15px) rotate(10deg);
  }
  50% {
    transform: translate(-15px, 30px) rotate(-10deg);
  }
  75% {
    transform: translate(20px, -25px) rotate(5deg);
  }
}
@keyframes float-improved {
  0%,
  100% {
    transform: translate(0px, 0px) rotate(0deg);
  }
  25% {
    transform: translate(8px, -25px) rotate(3deg);
  }
  50% {
    transform: translate(0px, -35px) rotate(0deg);
  }
  75% {
    transform: translate(-8px, -10px) rotate(-3deg);
  }
}
@keyframes shake-improved {
  0%,
  100% {
    transform: translate(0, 0) rotate(0);
  }
  10% {
    transform: translate(-3px, -2px) rotate(-0.8deg);
  }
  20% {
    transform: translate(3px, 2px) rotate(0.8deg);
  }
  30% {
    transform: translate(-3px, 2px) rotate(0.8deg);
  }
  40% {
    transform: translate(3px, -2px) rotate(-0.8deg);
  }
  50% {
    transform: translate(-2px, -3px) rotate(0.4deg);
  }
  60% {
    transform: translate(2px, 3px) rotate(-0.4deg);
  }
  70% {
    transform: translate(-2px, 3px) rotate(-0.8deg);
  }
  80% {
    transform: translate(2px, -3px) rotate(0.8deg);
  }
  90% {
    transform: translate(0, 0) rotate(0);
  }
}
@keyframes orbit-improved {
  0% {
    transform: rotate(0deg) translateX(30px) translateY(0px) rotate(0deg);
  }
  100% {
    transform: rotate(360deg) translateX(30px) translateY(0px) rotate(-360deg);
  }
}
@keyframes wave-improved {
  0%,
  100% {
    transform: translate(0px, 0px) skewX(0deg) scaleY(1);
  }
  25% {
    transform: translate(15px, -12px) skewX(-10deg) scaleY(1.05);
  }
  50% {
    transform: translate(30px, 0px) skewX(0deg) scaleY(1);
  }
  75% {
    transform: translate(15px, 12px) skewX(10deg) scaleY(0.95);
  }
}
@keyframes dvd-bounce-improved {
  0% {
    left: 5%;
    top: 5%;
    transform: rotate(0deg);
  }
  25% {
    left: calc(95% - var(--orb-size, 25px));
    top: 5%;
    transform: rotate(5deg);
  }
  50% {
    left: calc(95% - var(--orb-size, 25px));
    top: calc(95% - var(--orb-size, 25px));
    transform: rotate(0deg);
  }
  75% {
    left: 5%;
    top: calc(95% - var(--orb-size, 25px));
    transform: rotate(-5deg);
  }
  100% {
    left: 5%;
    top: 5%;
    transform: rotate(0deg);
  }
}

/*
======================================================================
NEW: INFO, DEMO & FOOTER SECTIONS (REVISED)
======================================================================
*/

/* Container for the info sections, appears below the intro card */
.main-content {
  position: relative;
  width: 100%;
  margin-top: 40px; 
  padding: 0;
}
.main-content.hidden {
  display: none !important;
}

.info-container {
  display: flex;
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
  align-items: flex-start;
  position: relative;
  z-index: 1;
}

.info-card {
  flex: 1;
  min-width: 0;
  background-color: var(--bg-card);
  backdrop-filter: blur(100px);
  padding: clamp(20px, 3vw, 30px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  transition: all 0.3s ease-out;
}

body:not(.comic-theme-active) .info-card {
    transform: translateY(0);
}
body:not(.comic-theme-active) .info-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}

.info-card h2 {
  font-family: var(--font-title);
  color: var(--accent-secondary);
  font-size: clamp(1.3rem, 4vw, 1.6rem);
  letter-spacing: 1px;
  margin-top: 0;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 20px;
  transition: all 0.4s ease;
}

.info-card h2 i {
  margin-right: 12px;
}
.info-card p,
.info-card ol,
.info-card ul {
  text-align: left;
  line-height: 1.7;
  font-size: clamp(0.9rem, 2vw, 1rem);
  color: var(--text-secondary);
}
.info-card ol, .info-card ul {
  padding-left: 20px;
}
.info-card li {
  margin-bottom: 15px;
}
.info-card strong {
  color: var(--accent-secondary);
  font-weight: 600;
}

@media (max-width: 820px) {
  .info-container {
    flex-direction: column;
  }
}

/* Gameplay Demo Styles (Shared) */
#demo-status-box {
  margin-top: 20px;
  padding: 15px;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.4),
    rgba(40, 38, 70, 0.3)
  );
  border-radius: 10px;
  min-height: 2.5em;
  color: var(--accent-tertiary);
  font-weight: 600;
  text-align: center;
  border: 2px solid rgba(255, 215, 0, 0.3);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
  font-size: 1.1rem;
}
#replay-demo-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 20px auto 0 auto;
  font-family: var(--font-body);
  font-weight: bold;
  cursor: pointer;
  padding: 12px 24px;
  border: 2px solid var(--border-color-strong);
  background: linear-gradient(
    135deg,
    rgba(0, 255, 255, 0.1),
    rgba(255, 0, 255, 0.1)
  );
  color: var(--text-primary);
  border-radius: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
}
#replay-demo-btn:hover {
  background: linear-gradient(
    135deg,
    rgba(0, 255, 255, 0.2),
    rgba(255, 0, 255, 0.2)
  );
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 255, 255, 0.3);
}
#replay-demo-btn:active {
  transform: scale(0.98) translateY(0);
}

.demo-wrapper {
  background: var(--border-color-strong);
  padding: 4px;
  border-radius: 12px;
  margin-top: 30px;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}
.gameplay-demo-container {
  padding: 20px;
  background-color: var(--bg-secondary);
  border-radius: 8px;
  /* NEW: Force content centering */
  display: flex;
  flex-direction: column;
  align-items: center; 
  justify-content: center;
  /* Ensure it doesn't overflow parent */
  width: 100%;
  box-sizing: border-box; 
}
/* Update these specific blocks in style.css */

#demo-grid {
  display: grid;
  /* Change to 3 columns for 3x3 */
  grid-template-columns: repeat(3, 1fr);
  /* Increase size to accommodate 3x3 cleanly */
  /* NEW: Responsive sizing */
  width: 100%;           /* Fill container... */
  max-width: 240px;      /* ...but stop at 240px */
  aspect-ratio: 1 / 1;   /* Keep perfectly square regardless of width */
  height: auto;          /* Let aspect-ratio handle the height */
  margin: 0 auto;
  gap: 4px;
  background: var(--border-color-strong);
  padding: 6px;
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.4),
    inset 0 0 10px rgba(0, 255, 255, 0.2);
}

.demo-cell {
  background-color: var(--bg-primary);
  position: relative;
  border-radius: 6px; /* Slightly smaller radius for denser grid */
  border: 2px solid var(--border-color); /* Thinner border */
  transition: all 0.3s ease;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
  overflow: hidden; /* Ensure particles don't spill visibly */
  /* Make sure internal content stays centered relative to dynamic size */
  display: block; 
  width: 100%;
  height: 100%;
}

.demo-orb {
  width: 45%;
  height: 45%;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.8),
    inset 0 0 8px rgba(0, 0, 0, 0.6), 0 3px 8px rgba(0, 0, 0, 0.5),
    0 0 12px 2px currentColor;
  background-image: radial-gradient(
    circle at 30% 25%,
    rgba(255, 255, 255, 0.95) 0,
    rgba(255, 255, 255, 0.4) 35%,
    rgba(255, 255, 255, 0.1) 55%,
    rgba(0, 0, 0, 0) 70%,
    rgba(0, 0, 0, 0.3) 100%
  );
  transition: all 0.2s ease;
}
/* Add/Replace these lines in style.css */

.demo-orb-wrapper {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: center;
  /* Will contain the orbs */
}

@keyframes demo-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.demo-orb-wrapper.spinning {
  animation: demo-spin 8s linear infinite;
}

.demo-cell.near-critical {
  animation: cell-glow-pulse 1.5s ease-in-out infinite;
}
.demo-cell.near-critical::before {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border: 3px solid var(--critical-glow-color, var(--accent-primary));
  animation: pulse-glow 1.5s ease-in-out infinite;
  border-radius: 12px;
  box-shadow: 0 0 15px var(--critical-glow-color, var(--accent-primary));
}
.explosion-effect {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 25%;
  height: 25%;
  background: radial-gradient(
    circle,
    var(--explosion-color, var(--accent-tertiary)),
    transparent 70%
  );
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.1);
  opacity: 0;
  animation: cell-burst-enhanced 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  box-shadow: 0 0 20px var(--explosion-color, var(--accent-tertiary));
}
.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--explosion-color, var(--accent-tertiary));
  border-radius: 50%;
  pointer-events: none;
  animation: particle-burst 0.8s ease-out forwards;
}
@keyframes particle-burst {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--particle-x, 0), var(--particle-y, 0)) scale(0);
    opacity: 0;
  }
}

.anim-pop-in {
  animation: orb-pop-direct 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.anim-fly-in {
  animation: orb-fly-in-effect 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s forwards;
  opacity: 0;
}

/* --- PREFERENCES/MOBILE TIPS SECTION --- */
.mobile-tips-container {
    display: flex;
    flex-direction: column; 
    align-items: center;
    gap: 15px;
    margin-top: 25px;
    text-align: left;
}

.mobile-steps {
    list-style-type: none;
    padding-left: 0;
    width: 100%;
    order: -1; 
}

.mobile-steps li {
    font-size: 0.85rem;
    margin-bottom: 10px;
}
.mobile-steps li strong {
    color: var(--text-primary);
}
.mobile-steps li i {
    color: var(--accent-tertiary);
    width: 20px; 
    text-align: center;
}

.phone-animation {
    flex-shrink: 0;
    width: 60px;
    height: 120px;
    background: #333;
    border: 3px solid #ccc;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    animation: rotate-phone 4s ease-in-out infinite;
    margin-top: 20px; 
}
.phone-animation::before { /* Earpiece */
    content: '';
    position: absolute;
    bottom: 8px;
    width: 25px;
    height: 4px;
    background: #555;
    border-radius: 2px;
}
.phone-speaker { /* Bottom Detail */
    content: '';
    position: absolute;
    top: 8px;
    width: 5px;
    height: 5px;
    background: #555;
    border-radius: 50%;
}
.phone-screen {
    width: 88%;
    height: 90%;
    background: var(--bg-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--accent-secondary);
    font-size: 1.5rem;
    overflow: hidden;
}

@keyframes rotate-phone {
    0%, 20% {
        transform: rotate(0deg);
    }
    40%, 60% {
        transform: rotate(-90deg);
    }
    80%, 100% {
        transform: rotate(0deg);
    }
}


/* Footer Styles */
footer {
  width: 100%;
  background-color: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  padding: 20px 0;
  text-align: center;
  z-index: 10;
  transition: background-color 0.4s ease, border-color 0.4s ease;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.footer-partner {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 600;
}

footer .footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

footer .footer-links li {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

@media (max-width: 767px) {
  body.arcade-theme-active footer .footer-content,
  body.comic-theme-active footer .footer-content {
    gap: 8px;
  }

  body.arcade-theme-active footer .footer-links,
  body.comic-theme-active footer .footer-links {
    gap: 8px 12px;
  }

  body.arcade-theme-active footer .footer-links .footer-mute-item,
  body.comic-theme-active footer .footer-links .footer-mute-item {
    flex-basis: 100%;
    justify-content: center;
    margin-top: 2px;
  }

  body.arcade-theme-active footer .footer-links .footer-mute-item .sound-toggle-btn,
  body.comic-theme-active footer .footer-links .footer-mute-item .sound-toggle-btn {
    width: fit-content;
  }
}

footer a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease-in-out;
}

footer a:hover {
  color: var(--accent-secondary);
}

/* Comic Theme Overrides for New Sections */
body.comic-theme-active .main-content {
    margin-top: 40px;
}

body.comic-theme-active .info-card {
  border-width: 3px;
  border-radius: 10px;
  font-family: var(--comic-font-main);
  background-color: var(--comic-accent-cream-light);
  transform: rotate(-0.7deg);
}
body.comic-theme-active .info-card:hover {
  transform: translateY(-2px) rotate(0.1deg);
  box-shadow: 6px 6px 0 var(--comic-border-strong-light);
}
body.comic-theme-active .info-card h2 {
  font-family: var(--font-title);
  color: var(--comic-accent-blue-light);
  text-shadow: 1px 1px 0 #fff;
  border-color: var(--comic-accent-red-light);
}
body.comic-theme-active .info-card strong {
  color: var(--comic-accent-red-light);
}
body.comic-theme-active .demo-wrapper {
  border: 3px solid var(--comic-border-strong-light);
  padding: 2px;
  border-radius: 10px;
  box-shadow: 2px 2px 0 var(--comic-border-strong-light);
  background: var(--comic-border-strong-light);
}
body.comic-theme-active .gameplay-demo-container {
  border-radius: 6px;
}
body.comic-theme-active #demo-grid {
  border: 3px solid var(--comic-border-strong-light);
  box-shadow: none;
  padding: 4px;
}
body.comic-theme-active .demo-cell {
  border-radius: 5px;
  border-width: 2px;
  border-color: var(--comic-border-strong-light);
  box-shadow: none;
}
body.comic-theme-active .demo-orb {
  border: 1.5px solid var(--border-color-strong);
  box-shadow: inset 1px 1px 1px rgba(0, 0, 0, 0.4);
  background-image: radial-gradient(
    circle at 30% 28%,
    rgba(255, 255, 255, 0.6) 0%,
    rgba(255, 255, 255, 0.1) 40%,
    transparent 60%
  );
}
body.comic-theme-active .demo-cell.near-critical {
  animation: none;
}
body.comic-theme-active .demo-cell.near-critical::before {
  border-width: 2.5px;
  animation-name: pulse-glow-comic;
  box-shadow: none;
}
body.comic-theme-active #demo-status-box {
  border-width: 3px;
  border-color: var(--comic-accent-blue-light);
  background: #fff;
  color: var(--comic-accent-blue-light);
  font-family: var(--comic-font-main);
  box-shadow: none;
  font-weight: bold;
}
body.comic-theme-active #replay-demo-btn {
  font-family: var(--comic-font-title);
  color: #ffffff;
  background: var(--comic-accent-red-light);
  border-color: var(--comic-border-strong-light);
  border-radius: 20px;
  box-shadow: 2px 2px 0 var(--comic-shadow-strong-light);
  text-shadow: -0.5px 0.5px 0 var(--comic-border-strong-light),
    -0.5px -0.5px 0 var(--comic-border-strong-light),
    0.5px -0.5px 0 var(--comic-border-strong-light),
    -0.5px 0.5px 0 var(--comic-border-strong-light),
    0.5px 0.5px var(--comic-border-strong-light),
    -0.5px -0.5px 0 var(--comic-border-strong-light),
    0.5px -0.5px 0 var(--comic-border-strong-light),
    -0.5px 0.5px 0 var(--comic-border-strong-light);
  transition: transform 0.2s ease, background 0.3s ease;
}
body.comic-theme-active footer {
  background-color: #e8e8e8;
  border-top-color: var(--comic-border-subtle-light);
  border-top-width: 2px;
}
body.comic-theme-active footer a {
  padding: 4px 8px;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
body.comic-theme-active footer a:hover {
  color: #ffffff;
  background-color: var(--comic-accent-red-light);
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
  box-shadow: 0 4px 8px rgba(230, 57, 70, 0.4);
  transform: translateY(-2px);
}
@keyframes pulse-glow-comic {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}
body.comic-theme-active .mobile-tips-container i {
    color: var(--comic-accent-red-light);
}

body.comic-theme-active .phone-animation {
    background: #333;
    border: 3px solid black;
    animation-name: rotate-phone-comic;
}

@keyframes rotate-phone-comic {
    0%, 20% { transform: rotate(1deg); }
    40%, 60% { transform: rotate(-89deg); }
    80%, 100% { transform: rotate(1deg); }
}

/*
======================================================================
CREDIT CARD PAGE STYLES
======================================================================
*/

.credit-card {
  background: rgba(29, 27, 53, 0.85);
  backdrop-filter: blur(100px);
  border-radius: 24px;
  padding: clamp(30px, 5vw, 50px); /* Responsive padding */
  max-width: 550px;
  width: 95%; /* Better width for mobile */
  margin: 20px;
  box-shadow: 
      0 25px 50px rgba(0, 0, 0, 0.1),
      0 0 0 1px rgba(255, 255, 255, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  z-index: 1;
  border: 1px solid var(--border-color);
  transition: box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.credit-card:hover {
  box-shadow: 
      0 35px 60px rgba(0, 0, 0, 0.15),
      0 0 0 1px rgba(255, 255, 255, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.9),
      0 0 20px rgba(0, 255, 255, 0.3);
}

.credit-header {
    text-align: center;
    margin-bottom: 35px;
}

.credit-title {
    font-family: var(--font-title);
    font-size: clamp(1.8rem, 6vw, 2.5rem); /* Responsive text size */
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
    text-shadow: 0 0 5px var(--accent-primary), 0 0 10px var(--accent-primary),
    0 0 20px var(--accent-primary), 0 0 40px rgba(255, 0, 255, 0.7);
    line-height: 1.2;
}

.credit-subtitle {
    font-family: var(--font-title);
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 500;
}

.creator-info {
    text-align: center;
    margin-bottom: 35px;
}

.creator-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 36px;
    color: white;
    font-weight: 700;
    font-family: var(--font-title);
    text-shadow: 1px 1px 1px rgb(0, 0, 0);
    box-shadow: 0 10px 30px rgba(0,0,0, 0.2);
}

.creator-name {
    font-family: var(--font-title);
    font-size: clamp(1.5rem, 5vw, 2rem);
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.creator-role, .creator-description, .made-with-love {
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-weight: 500;
}

.creator-description {
    font-size: 14px;
    line-height: 1.6;
    max-width: 400px;
    margin: 0 auto;
    font-weight: 400;
}

.project-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 15px;
    font-family: var(--font-title);
    box-shadow: 0 4px 15px rgba(0,0,0, 0.3);
    text-shadow: 1px 1px 1px rgb(0, 0, 0);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-primary));
    color: white;
    text-decoration: none;
    font-size: 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(0,0,0, 0.2);
    border: 1px solid var(--border-color);
}
.social-link i {
    transition: transform 0.3s ease;
}

.social-link:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 35px rgba(0, 255, 255, 0.2);
    border-color: var(--accent-secondary);
}

.social-link:hover i {
    transform: scale(1.1);
}

.contact-info {
    background: rgba(0,0,0, 0.1);
    border-radius: 20px;
    padding: 25px 15px; /* Reduce side padding for mobile */
    margin-top: 30px;
    text-align: center;
    border: 1px solid var(--border-color);
    width: 100%; /* Ensure container doesn't collapse */
    overflow: hidden; /* Safety measure */
}

.contact-title {
    font-family: var(--font-title);
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 12px;
}

.contact-email {
    color: var(--accent-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    
    /* --- FIX FOR MOBILE OVERFLOW --- */
    word-break: break-all;     /* Forces string to break if it hits edge */
    display: inline-block;     /* Ensures it respects width rules */
    max-width: 100%;          /* Max width 100% of parent */
    /* ------------------------------ */
}

.contact-email:hover {
    text-decoration: underline;
    color: #fff;
}

.made-with-love {
    text-align: center;
    margin-top: 25px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 400;
}

.heart {
    color: var(--accent-negative);
    animation: heartbeat 2s ease-in-out infinite;
    display: inline-block;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.1); }
    50% { transform: scale(1); }
    75% { transform: scale(1.05); }
}

/* Comic Theme Overrides for Credit Card Page */
body.comic-theme-active .credit-card {
    background: var(--comic-accent-cream-light);
    color: var(--comic-text-primary-light);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: rotate(-0.7deg);
    box-shadow: 4px 4px 0 var(--comic-shadow-strong-light);
}
body.comic-theme-active .credit-card:hover {
  transform: rotate(0.1deg) translateY(-1px);
  box-shadow: 5px 5px 0 var(--border-color-strong);
}

body.comic-theme-active .credit-title {
    color: var(--comic-accent-red-light);
    text-shadow: 2px 2px 0 var(--comic-border-strong-light);
    -webkit-text-fill-color: unset;
    background: none;
    animation: none;
}

body.comic-theme-active .credit-subtitle {
    color: var(--comic-text-secondary-light);
}

body.comic-theme-active .credit-subtitle::after {
    background: var(--comic-accent-red-light);
}

body.comic-theme-active .creator-avatar {
    background: var(--comic-accent-blue-light);
    color: #fff;
    border: 3px solid var(--comic-border-strong-light);
    box-shadow: 3px 3px 0 var(--comic-shadow-strong-light);
}
body.comic-theme-active .creator-avatar:hover {
    transform: scale(1.05) rotate(0deg);
}

body.comic-theme-active .creator-name {
    color: var(--comic-accent-blue-light);
}

body.comic-theme-active .creator-role,
body.comic-theme-active .creator-description,
body.comic-theme-active .made-with-love {
    color: var(--comic-text-secondary-light);
}

body.comic-theme-active .project-badge {
    background: var(--comic-accent-red-light);
    color: #fff;
    border: 2px solid var(--comic-border-strong-light);
    box-shadow: 2px 2px 0 var(--comic-shadow-strong-light);
    border-radius: 8px;
    text-shadow: 1px 1px 0 var(--comic-border-strong-light);
}

body.comic-theme-active .social-link {
    background: var(--comic-accent-blue-light);
    border: 2px solid var(--comic-border-strong-light);
    box-shadow: 2px 2px 0 var(--comic-shadow-strong-light);
    border-radius: 8px;
}
body.comic-theme-active .social-link:hover {
    transform: translateY(-2px) translateX(-2px);
    box-shadow: 4px 4px 0 var(--comic-shadow-strong-light);
}
body.comic-theme-active .social-link i {
    color: #fff;
}

body.comic-theme-active .contact-info {
    background: rgba(255,255,255,0.7);
    border: 2px dashed var(--comic-border-strong-light);
}

body.comic-theme-active .contact-title {
    color: var(--comic-accent-blue-light);
}

body.comic-theme-active .contact-email {
    color: var(--comic-accent-red-light);
    font-weight: bold;
}
body.comic-theme-active .contact-email:hover {
    color: #000;
}
/* --- Global Sound Toggle Button --- */
.sound-toggle-btn {
  position: static;
  z-index: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-color-strong);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 1;
  box-shadow: none;
  transition: background-color var(--anim-fast) ease, color var(--anim-fast) ease,
    border-color var(--anim-fast) ease, transform var(--anim-fast) ease;
}

.sound-toggle-btn:hover,
.sound-toggle-btn:focus-visible,
.sound-toggle-btn.is-active {
  color: var(--accent-secondary);
  border-color: var(--border-color-strong);
  background-color: var(--bg-card);
  transform: translateY(-1px);
}

.sound-toggle-btn:active {
  transform: scale(0.97);
}

.sound-toggle-btn i {
  pointer-events: none;
}

body.comic-theme-active .sound-toggle-btn {
  background-color: #ffffff;
  border-color: var(--comic-border-strong-light, #1a1a1a);
  color: var(--comic-accent-blue-light, #1a1a1a);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
}
