/* ========== Basic reset ========== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #050814;
  color: #f5f5f5;
  display: flex;
  justify-content: center;
  align-items: stretch;
}

/* ========== Root layout ========== */
#vsrdle-root {
  width: 100%;
  max-width: 900px;
  min-height: 100vh;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

/* ========== Header ========== */
.site-header {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-title-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.logo-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.site-header h1 {
  font-size: 1.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.streak-display {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Hamburger menu button on the left */
.menu-toggle {
  border: none;
  background: #252b4a;
  color: #f5f5f5;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: background 0.12s ease, transform 0.12s ease;
}

.menu-toggle:hover {
  background: #343b62;
  transform: translateY(-1px);
}

/* ========== Slide-out settings menu (left side) ========== */
.settings-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: min(320px, 85vw);
  height: 100vh;
  overflow-y: auto;
  padding: 12px 14px;
  border-radius: 0 12px 12px 0;
  background: #0e1327;
  box-shadow: 8px 0 30px rgba(0, 0, 0, 0.85);
  z-index: 100;
  font-size: 0.9rem;
}

.settings-menu h2 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.settings-section {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 8px;
  margin-top: 8px;
}

.settings-section:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 4px;
}

.settings-section h3 {
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  cursor: pointer;
}

.toggle-row input[type="checkbox"] {
  transform: scale(1.1);
}

/* Custom series section */
.custom-series-section {
  margin-top: 6px;
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.03);
}

.custom-series-section p {
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.series-list {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.series-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
}

/* Settings actions */
.settings-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

/* ========== Main ========== */
.site-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game-section {
  width: 100%;
}

/* ========== Pair layout (VS mode) ========== */
.pair-container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  margin-bottom: 12px;
}

.vs-label {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1;
  color: #ffdf6b;
}

/* ========== Cards ========== */
.vs-card {
  border: none;
  border-radius: 12px;
  background: radial-gradient(circle at top, #1b2340, #0b0f1f);
  color: inherit;
  padding: 12px;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 10px 24px rgba(0, 0, 0, 0.6);
  transition: transform 0.12s ease, box-shadow 0.12s ease,
    background 0.12s ease, opacity 0.12s ease;
}

.vs-card:disabled {
  cursor: default;
  opacity: 0.8;
}

.vs-card:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.7);
  background: radial-gradient(circle at top, #222b4f, #0b0f1f);
}

.vs-card.vs-card-correct {
  box-shadow: 0 0 0 2px #35d07f, 0 14px 32px rgba(0, 0, 0, 0.8);
}

.vs-card.vs-card-incorrect {
  box-shadow: 0 0 0 2px #e04545, 0 14px 32px rgba(0, 0, 0, 0.8);
}

/* Card content */
.card-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-name {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
}

.card-origin {
  font-size: 0.85rem;
  opacity: 0.8;
}

.card-image-wrapper {
  border-radius: 8px;
  overflow: hidden;
  background: #050814;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;

  max-height: 350px;   
  max-width: 100%;     
}


.card-image-placeholder {
  font-size: 0.8rem;
  opacity: 0.7;
  padding: 12px;
}

.card-tier {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.8rem;
  margin-top: 4px;
}

.card-main-tier,
.card-sub-tier {
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.card-main-tier {
  font-weight: 600;
}

/* ========== Info row & panel ========== */
.info-row {
  margin-top: 8px;
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.info-button {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: #252b4a;
  color: #f5f5f5;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
  transition: background 0.12s ease, transform 0.12s ease;
}

.info-button:hover {
  background: #343b62;
  transform: translateY(-1px);
}

.info-panel {
  flex: 1;
  background: #0e1323;
  border-radius: 10px;
  padding: 10px;
  font-size: 0.86rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  transition: opacity 0.15s ease;
}

.info-panel[hidden] {
  display: none !important;
  opacity: 0;
}

.info-side h3 {
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.info-side p {
  margin-bottom: 4px;
}

.info-side a {
  color: #7dd6ff;
  text-decoration: none;
  font-size: 0.8rem;
}

.info-side a:hover {
  text-decoration: underline;
}

/* ========== Controls ========== */
.controls {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  justify-content: center;
}

.control-button {
  padding: 8px 16px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  background: #252b4a;
  color: #f5f5f5;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: background 0.12s ease, transform 0.12s ease;
}

.control-button:hover {
  background: #343b62;
  transform: translateY(-1px);
}

/* ========== Footer ========== */
.site-footer {
  margin-top: 16px;
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.65;
}

/* ========== Odd One Out section ========== */

#odd-mode-section {
  display: none; /* shown when odd mode is active */
}

.odd-card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
}

/* Odd cards share the same .vs-card styles, but text-centered is nice */
.odd-card-grid .vs-card {
  min-height: 80px;
  padding: 10px;
}

.odd-card-grid .card-inner {
  align-items: center;
  text-align: center;
}

/* ========== Responsive tweaks ========== */

@media (max-width: 700px) {
  .pair-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .vs-label {
    order: -1;
    margin-bottom: 4px;
  }

  .info-panel {
    grid-template-columns: 1fr;
  }

  .site-header {
    align-items: center;
    flex-wrap: wrap;
  }

  .header-left {
    width: 100%;
  }

  .streak-display {
    text-align: left;
  }

  .odd-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* -------------------- LIGHT THEME -------------------- */

body.light-theme {
  background: #006cb0;
  color: #021522;
}

body.light-theme #vsrdle-root {
  /* Let body color bleed through */
  background: transparent;
}

/* Cards */
body.light-theme .vs-card {
  background: #d4e6f7;
  color: #021522;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04),
              0 10px 24px rgba(0, 0, 0, 0.25);
}

body.light-theme .vs-card.vs-card-correct {
  box-shadow: 0 0 0 2px #1a8b52, 0 14px 32px rgba(0, 0, 0, 0.3);
}

body.light-theme .vs-card.vs-card-incorrect {
  box-shadow: 0 0 0 2px #c43434, 0 14px 32px rgba(0, 0, 0, 0.3);
}

/* Info panel */
body.light-theme .info-panel {
  background: #c4ddf3;
  color: #021522;
}

/* Buttons */
body.light-theme .control-button,
body.light-theme .menu-toggle,
body.light-theme .info-button {
  background: #0b4f82;
  color: #e8f3ff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

body.light-theme .control-button:hover,
body.light-theme .menu-toggle:hover,
body.light-theme .info-button:hover {
  background: #0f629f;
}

/* Settings menu */
body.light-theme .settings-menu {
  background: #c4ddf3;
  color: #021522;
  box-shadow: 8px 0 30px rgba(0, 0, 0, 0.6);
}

/* Footer */
body.light-theme .site-footer {
  opacity: 0.9;
}

/* Odd One Out specific image sizing */
.odd-card-grid .odd-card-image-wrapper {
  min-height: 80px;
  max-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.odd-card-grid .odd-card-image {
  max-height: 80px;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* ========== Rules modal ========== */

.rules-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
}

.rules-modal[hidden] {
  display: none !important;
}

.rules-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.rules-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  background: #0e1327;
  color: #f5f5f5;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
  font-size: 0.9rem;
}

.rules-content h2 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.rules-content h3 {
  font-size: 1rem;
  margin-top: 8px;
  margin-bottom: 4px;
}

.rules-content p {
  margin-bottom: 6px;
}

.rules-note {
  font-size: 0.8rem;
  opacity: 0.85;
}

/* Light theme version */
body.light-theme .rules-content {
  background: #c4ddf3;
  color: #021522;
}

