/* CSS Variables */
:root {
  --primary-color: #1a237e;
  --primary-light: #534bae;
  --primary-dark: #000051;
  --accent-color: #ffd54f;
  --accent-dark: #c8a415;
  --success-color: #4caf50;
  --background-color: #0d1117;
  --surface-color: #161b22;
  --text-primary: #ffffff;
  --text-secondary: #8b949e;
  --card-width: 80px;
  --card-height: 112px;
  --card-gap: 8px;
  --header-height: 60px;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
}

body {
  font-family: 'Open Sans', sans-serif;
  background: var(--background-color);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3 {
  font-family: 'Playfair Display', serif;
}

/* Screen Management */
.screen {
  display: none;
  min-height: 100vh;
}

.screen.active {
  display: flex;
}

/* Menu Screen */
#menu-screen {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--background-color) 0%, var(--surface-color) 100%);
}

.menu-container {
  max-width: 500px;
  width: 100%;
  text-align: center;
}

.game-title {
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  color: var(--accent-color);
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.game-subtitle {
  color: var(--text-secondary);
  margin-bottom: 40px;
  font-size: 0.95rem;
}

.difficulty-section h2 {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.difficulty-buttons {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 15px;
}

.difficulty-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  background: var(--surface-color);
  border: 2px solid var(--primary-color);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.difficulty-btn:hover {
  background: var(--primary-color);
  border-color: var(--accent-color);
  transform: translateY(-2px);
}

.difficulty-btn .card-count {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
}

.difficulty-btn .tile-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 5px 0;
}

.difficulty-btn .difficulty-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-color);
  font-weight: 600;
}

.mobile-hint {
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-style: italic;
  margin-bottom: 30px;
}

.high-scores-section {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--surface-color);
}

.high-scores-section h3 {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 15px;
}

.high-scores {
  display: flex;
  justify-content: center;
  gap: 30px;
}

.score-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.score-item .score-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.score-item .score-value {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent-color);
}

/* Game Screen */
#game-screen {
  flex-direction: column;
  background: var(--background-color);
}

.game-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 15px;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.back-btn, .restart-btn {
  background: transparent;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.back-btn:hover, .restart-btn:hover {
  background: var(--accent-color);
  color: var(--primary-dark);
}

.score-display {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.score-display .score-label {
  font-size: 0.65rem;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.7);
}

.score-display .score-number {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent-color);
  line-height: 1;
}

/* Game Main */
.game-main {
  padding-top: calc(var(--header-height) + 10px);
  padding-bottom: 20px;
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

/* Game Board */
.game-board {
  display: grid;
  gap: var(--card-gap);
  padding: 10px;
  justify-content: center;
  align-content: start;
  width: 100%;
  max-width: 1000px;
}

/* Mobile-first grid columns based on card count */
.game-board[data-cards="20"] {
  grid-template-columns: repeat(4, var(--card-width));
}

.game-board[data-cards="40"] {
  grid-template-columns: repeat(5, var(--card-width));
}

.game-board[data-cards="60"] {
  grid-template-columns: repeat(6, var(--card-width));
}

/* Card Styles */
.card {
  width: var(--card-width);
  height: var(--card-height);
  perspective: 1000px;
  cursor: pointer;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease;
  transform-style: preserve-3d;
}

.card.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.card-back {
  background: url('../images/card-back.svg') center/cover;
  border: 2px solid #d4af37;
}

.card-front {
  transform: rotateY(180deg);
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Matched state */
.card.matched {
  pointer-events: none;
}

.card.matched .card-inner {
  animation: matchPulse 0.6s ease-out;
}

.card.matched .card-front {
  border: 3px solid var(--success-color);
  box-shadow: 0 0 15px rgba(76, 175, 80, 0.5);
}

@keyframes matchPulse {
  0% { transform: rotateY(180deg) scale(1); }
  50% { transform: rotateY(180deg) scale(1.08); }
  100% { transform: rotateY(180deg) scale(1); }
}

/* Disabled state during checking */
.card.disabled {
  pointer-events: none;
}

/* Victory Screen */
#victory-screen {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 40px 20px;
  background: linear-gradient(135deg, var(--background-color) 0%, var(--surface-color) 100%);
  overflow-y: auto;
}

.victory-container {
  max-width: 500px;
  width: 100%;
  text-align: center;
}

.trophy-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

.victory-title {
  font-size: 2rem;
  color: var(--accent-color);
  margin-bottom: 10px;
}

.victory-message {
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.final-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--surface-color);
  padding: 25px 40px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.final-score-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-secondary);
}

.final-score-number {
  font-size: 4rem;
  font-weight: 700;
  color: var(--accent-color);
  line-height: 1.2;
}

.final-score-unit {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.new-record {
  background: var(--success-color);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  font-weight: 600;
  margin-bottom: 30px;
  display: inline-block;
}

.matched-cards-section {
  margin: 30px 0;
  text-align: left;
}

.matched-cards-section h3 {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 15px;
  text-align: center;
}

.matched-cards-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.matched-card-item {
  background: var(--surface-color);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.matched-card-item:hover {
  background: var(--primary-color);
  color: var(--text-primary);
}

.victory-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.play-again-btn, .change-difficulty-btn {
  padding: 15px 30px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.play-again-btn {
  background: var(--accent-color);
  border: none;
  color: var(--primary-dark);
}

.play-again-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
}

.change-difficulty-btn {
  background: transparent;
  border: 2px solid var(--accent-color);
  color: var(--accent-color);
}

.change-difficulty-btn:hover {
  background: var(--accent-color);
  color: var(--primary-dark);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--surface-color);
  border-radius: 12px;
  max-width: 400px;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  z-index: 1;
}

.modal-card-image {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  background: #f0f0f0;
}

.modal-card-info {
  padding: 20px;
}

.modal-card-info h3 {
  color: var(--accent-color);
  margin-bottom: 8px;
}

.modal-card-set {
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 5px;
}

.modal-card-value {
  color: var(--success-color);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.modal-card-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-style: italic;
}

/* Responsive Breakpoints */

/* Small phones */
@media (max-width: 380px) {
  :root {
    --card-width: 65px;
    --card-height: 91px;
    --card-gap: 5px;
  }
}

/* Standard mobile */
@media (min-width: 381px) and (max-width: 480px) {
  :root {
    --card-width: 70px;
    --card-height: 98px;
    --card-gap: 6px;
  }
}

/* Large mobile / Small tablet */
@media (min-width: 481px) and (max-width: 767px) {
  :root {
    --card-width: 75px;
    --card-height: 105px;
    --card-gap: 8px;
  }

  .game-board[data-cards="20"] {
    grid-template-columns: repeat(5, var(--card-width));
  }

  .game-board[data-cards="40"] {
    grid-template-columns: repeat(6, var(--card-width));
  }

  .game-board[data-cards="60"] {
    grid-template-columns: repeat(6, var(--card-width));
  }
}

/* Tablet */
@media (min-width: 768px) {
  :root {
    --card-width: 90px;
    --card-height: 126px;
    --card-gap: 10px;
  }

  .difficulty-buttons {
    flex-direction: row;
    justify-content: center;
  }

  .difficulty-btn {
    flex: 1;
    max-width: 150px;
  }

  .game-board[data-cards="20"] {
    grid-template-columns: repeat(5, var(--card-width));
  }

  .game-board[data-cards="40"] {
    grid-template-columns: repeat(8, var(--card-width));
  }

  .game-board[data-cards="60"] {
    grid-template-columns: repeat(10, var(--card-width));
  }

  .victory-buttons {
    flex-direction: row;
    justify-content: center;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  :root {
    --card-width: 100px;
    --card-height: 140px;
    --card-gap: 12px;
  }

  .game-main {
    padding-top: calc(var(--header-height) + 20px);
  }
}

/* Landscape mode on mobile */
@media (max-height: 500px) and (orientation: landscape) {
  :root {
    --card-width: 55px;
    --card-height: 77px;
    --card-gap: 4px;
    --header-height: 50px;
  }

  .game-board[data-cards="20"] {
    grid-template-columns: repeat(5, var(--card-width));
  }

  .game-board[data-cards="40"] {
    grid-template-columns: repeat(8, var(--card-width));
  }

  .game-board[data-cards="60"] {
    grid-template-columns: repeat(10, var(--card-width));
  }
}

/* Touch optimization */
@media (hover: none) and (pointer: coarse) {
  .card {
    touch-action: manipulation;
  }

  .difficulty-btn:hover {
    background: var(--surface-color);
    border-color: var(--primary-color);
    transform: none;
  }

  .difficulty-btn:active {
    background: var(--primary-color);
    border-color: var(--accent-color);
  }
}

/* ===== GAME SELECTOR SCREEN ===== */

#game-selector-screen {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--background-color) 0%, var(--surface-color) 100%);
}

.selector-container {
  max-width: 600px;
  width: 100%;
  text-align: center;
}

.game-selector-tiles {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 40px;
}

.game-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 30px;
  background: var(--surface-color);
  border: 3px solid var(--primary-color);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  color: inherit;
}

.game-tile:hover {
  background: var(--primary-color);
  border-color: var(--accent-color);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.game-tile-icon {
  font-size: 3rem;
  margin-bottom: 15px;
}

.game-tile-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Playfair Display', serif;
}

.game-tile-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 8px;
}

@media (min-width: 768px) {
  .game-selector-tiles {
    flex-direction: row;
    justify-content: center;
  }

  .game-tile {
    flex: 1;
    max-width: 250px;
  }
}

/* Back to selector buttons */
.back-to-selector-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 8px 12px;
  margin-bottom: 20px;
  transition: color 0.2s ease;
  font-family: inherit;
}

.back-to-selector-btn:hover {
  color: var(--accent-color);
}

/* ===== VALUATION MENU SCREEN ===== */

#valuation-menu-screen {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--background-color) 0%, var(--surface-color) 100%);
}

.mode-buttons {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 20px;
}

.mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  background: var(--surface-color);
  border: 2px solid var(--primary-color);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  color: inherit;
  text-align: center;
}

.mode-btn:hover {
  background: var(--primary-color);
  border-color: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.mode-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.mode-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

@media (min-width: 768px) {
  .mode-buttons {
    flex-direction: row;
  }

  .mode-btn {
    flex: 1;
  }
}

/* ===== VALUATION GAME SCREEN ===== */

#valuation-game-screen {
  flex-direction: column;
  background: var(--background-color);
}

.valuation-main {
  padding-top: calc(var(--header-height) + 20px);
  padding-left: 20px;
  padding-right: 20px;
  padding-bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

.valuation-mode {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.instruction {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 30px;
  text-align: center;
}

/* Toggle Switch */
.toggle-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.toggle-switch input {
  display: none;
}

.toggle-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--text-secondary);
  border-radius: 12px;
  transition: background 0.3s ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  top: 2px;
  left: 2px;
  transition: transform 0.3s ease;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent-color);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.toggle-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Valuation Cards */
.valuation-card {
  display: flex;
  flex-direction: column;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.valuation-card img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
  border-radius: 8px 8px 0 0;
}

.card-name-label {
  background: rgba(0, 0, 0, 0.85);
  padding: 8px 6px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-primary);
  font-weight: 500;
  line-height: 1.2;
  border-radius: 0 0 8px 8px;
}

.card-name-line {
  line-height: 1.3;
}

.card-name-line.player {
  font-weight: 600;
  margin-bottom: 2px;
}

.card-name-line.set {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 2px;
}

.card-name-line.grade {
  font-size: 0.75rem;
  color: var(--accent-color);
  font-weight: 600;
}

/* 3-Card Mode */
.card-selection-area {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.selectable-card {
  width: 120px;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.2s ease;
}

.selectable-card:hover {
  transform: scale(1.05);
  border-color: var(--primary-light);
}

.selectable-card.selected {
  border-color: var(--accent-color);
  box-shadow: 0 0 20px rgba(255, 213, 79, 0.5);
  transform: scale(1.05);
}

.selectable-card.placed {
  opacity: 0.4;
}

.position-slots {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.position-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.position-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.slot-content {
  width: 130px;
  min-height: 182px;
  border: 2px dashed var(--text-secondary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(22, 27, 34, 0.5);
}

.slot-content:hover {
  border-color: var(--accent-color);
  background: rgba(255, 213, 79, 0.1);
}

.slot-content .valuation-card {
  width: 120px;
}

.submit-btn {
  padding: 15px 40px;
  font-size: 1rem;
  font-weight: 600;
  background: var(--accent-color);
  border: none;
  border-radius: 8px;
  color: var(--primary-dark);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  align-self: center;
  margin-top: 10px;
}

.submit-btn:disabled {
  background: var(--text-secondary);
  cursor: not-allowed;
  opacity: 0.5;
}

.submit-btn:not(:disabled):hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 213, 79, 0.3);
}

/* 2-Card Mode */
.two-card-area {
  display: flex;
  gap: 40px;
  justify-content: center;
  flex-wrap: wrap;
}

.two-card-choice {
  width: 160px;
}

/* 1-Card Mode */
.single-card-area {
  margin-bottom: 40px;
  display: flex;
  justify-content: center;
  width: 100%;
}

.display-card {
  width: 200px;
}

.value-options {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
  max-width: 350px;
  align-items: center;
}

.value-option-btn {
  padding: 18px 25px;
  font-size: 1.1rem;
  font-weight: 600;
  background: var(--surface-color);
  border: 2px solid var(--primary-color);
  border-radius: 10px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  width: 100%;
  max-width: 350px;
}

.value-option-btn:hover {
  background: var(--primary-color);
  border-color: var(--accent-color);
}

/* Answer Reveal States */
.answer-correct {
  border-color: var(--success-color) !important;
  box-shadow: 0 0 20px rgba(76, 175, 80, 0.5) !important;
}

.answer-incorrect {
  border-color: #f44336 !important;
  box-shadow: 0 0 20px rgba(244, 67, 54, 0.5) !important;
}

.value-reveal {
  background: rgba(0, 0, 0, 0.9);
  padding: 8px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--accent-color);
  font-weight: 700;
  border-radius: 0 0 8px 8px;
  margin-top: auto;
}

/* ===== VALUATION RESULTS SCREEN ===== */

#valuation-results-screen {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 40px 20px;
  background: linear-gradient(135deg, var(--background-color) 0%, var(--surface-color) 100%);
  overflow-y: auto;
}

.round-summary-list {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.round-summary-item {
  padding: 15px;
  background: var(--surface-color);
  border-radius: 8px;
  border-left: 4px solid var(--text-secondary);
}

.round-summary-item.correct {
  border-left-color: var(--success-color);
}

.round-summary-item.partial {
  border-left-color: #ff9800;
}

.round-summary-item.incorrect {
  border-left-color: #f44336;
}

.round-label {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.round-cards {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.round-cards span {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */

@media (max-width: 480px) {
  .selectable-card {
    width: 100px;
  }

  .two-card-choice {
    width: 130px;
  }

  .display-card {
    width: 160px;
  }

  .position-slots {
    gap: 10px;
  }

  .slot-content {
    width: 110px;
    min-height: 154px;
  }

  .slot-content .valuation-card {
    width: 100px;
  }

  .game-tile {
    padding: 30px 20px;
  }

  .game-tile-icon {
    font-size: 2.5rem;
  }
}

@media (min-width: 768px) {
  .two-card-area {
    gap: 60px;
  }
}

/* ===== GUESS GAME STYLES ===== */

/* Guess Menu Screen */
#guess-menu-screen {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--background-color) 0%, var(--surface-color) 100%);
}

.game-info-text {
  background: var(--surface-color);
  padding: 20px;
  border-radius: 8px;
  border: 2px solid var(--primary-color);
  margin-bottom: 20px;
}

.game-info-text p {
  color: var(--text-primary);
  margin: 8px 0;
  font-size: 0.95rem;
}

.start-game-btn {
  width: 100%;
  padding: 15px 30px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: var(--text-primary);
  border: 2px solid var(--accent-color);
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.start-game-btn:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--accent-color));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 213, 79, 0.3);
}

/* Guess Game Screen */
#guess-game-screen {
  flex-direction: column;
  background: linear-gradient(135deg, var(--background-color) 0%, var(--surface-color) 100%);
}

.guess-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 20px;
  padding-top: calc(var(--header-height) + 20px);
  overflow-y: auto;
}

.guess-card-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.guess-card-display {
  width: 300px;
  max-width: 90vw;
  aspect-ratio: 5/7;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  background: var(--surface-color);
}

.blurred-card {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(20px);
  transition: filter 0.5s ease-in-out, opacity 0.2s ease-in-out;
}

.blurred-card.revealed {
  filter: blur(0px);
}

/* Attempts Indicator */
.attempts-indicator {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.attempt-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-color);
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(255, 213, 79, 0.4);
}

.attempt-dot.used {
  background: var(--text-secondary);
  opacity: 0.3;
  box-shadow: none;
}

/* Input Area */
.guess-input-area {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.instruction {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 5px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.input-group input {
  padding: 12px 16px;
  font-size: 1rem;
  background: var(--surface-color);
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  color: var(--text-primary);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  font-family: inherit;
}

.input-group input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(255, 213, 79, 0.1);
}

.input-group input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

/* Chrome, Safari, Edge, Opera - Remove number input spinners */
.input-group input::-webkit-outer-spin-button,
.input-group input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox - Remove number input spinners */
.input-group input[type=number] {
  -moz-appearance: textfield;
}

.submit-btn {
  padding: 14px 30px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: var(--text-primary);
  border: 2px solid var(--accent-color);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 10px;
}

.submit-btn:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--accent-color));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 213, 79, 0.3);
}

.submit-btn:active {
  transform: translateY(0);
}

/* Guess Feedback */
.guess-feedback {
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  animation: slideIn 0.3s ease;
  border: 2px solid;
  display: none;
}

.guess-feedback.correct {
  background: rgba(76, 175, 80, 0.15);
  border-color: var(--success-color);
  color: var(--success-color);
}

.guess-feedback.partial {
  background: rgba(255, 152, 0, 0.15);
  border-color: #ff9800;
  color: #ff9800;
}

.guess-feedback.incorrect {
  background: rgba(244, 67, 54, 0.15);
  border-color: #f44336;
  color: #f44336;
}

.guess-feedback strong {
  display: block;
  margin-bottom: 5px;
  font-size: 1.05rem;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Guess Results Screen */
#guess-results-screen {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 40px 20px;
  background: linear-gradient(135deg, var(--background-color) 0%, var(--surface-color) 100%);
  overflow-y: auto;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  .guess-card-display {
    width: 250px;
  }

  .guess-main {
    gap: 20px;
    padding: 15px;
    padding-top: calc(var(--header-height) + 15px);
  }

  .guess-input-area {
    max-width: 100%;
  }

  .game-info-text {
    padding: 15px;
  }

  .game-info-text p {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .guess-card-display {
    width: 220px;
  }

  .attempt-dot {
    width: 14px;
    height: 14px;
  }

  .input-group input {
    font-size: 0.95rem;
    padding: 10px 14px;
  }

  .submit-btn {
    padding: 12px 24px;
    font-size: 0.95rem;
  }
}
