:root {
  --sky-blue: #4D96FF;
  --mint-green: #6BCB77;
  --sunshine-yellow: #FFD93D;
  --coral-pink: #FF8B94;
  --lavender-purple: #C9B1FF;
  --cream-white: #FFF9E6;
  --light-gray: #F5F5F5;
  --text-gray: #555555;
  --success-green: #6BCB77;
  --error-red: #FF6B6B;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--cream-white);
  min-height: 100vh;
  color: var(--text-gray);
  overflow-x: hidden;
}

body.home-page,
body.game-page,
body.result-screen {
  display: flex;
  flex-direction: column;
}

body.home-page {
  background:
    radial-gradient(circle at top left, rgba(201, 177, 255, 0.22), transparent 28%),
    radial-gradient(circle at top right, rgba(255, 217, 61, 0.18), transparent 24%),
    linear-gradient(180deg, #fffdf4 0%, #fff7e7 100%);
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.decor-element {
  position: fixed;
  font-size: 30px;
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
}

.decor-cloud-1 { top: 5%; left: 5%; animation: float 8s ease-in-out infinite; }
.decor-cloud-2 { top: 15%; right: 10%; animation: float 10s ease-in-out infinite reverse; }
.decor-cloud-3 { bottom: 10%; left: 20%; animation: float 12s ease-in-out infinite; }
.decor-star-1 { top: 20%; left: 80%; animation: twinkle 2s ease-in-out infinite; }
.decor-star-2 { top: 60%; right: 5%; animation: twinkle 3s ease-in-out infinite; }
.decor-bubble-1 { top: 30%; left: 10%; animation: bounce 4s ease-in-out infinite; }
.decor-bubble-2 { bottom: 20%; right: 15%; animation: bounce 5s ease-in-out infinite; }
.decor-heart-1 { top: 70%; left: 15%; animation: float 6s ease-in-out infinite; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(5deg); }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.2); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(77, 150, 255, 0.1);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
}

.nav-home {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-gray);
  font-weight: 700;
  font-size: 16px;
  transition: all 0.3s ease;
}

.nav-home:hover {
  color: var(--sky-blue);
  transform: translateX(-2px);
}

.nav-icon {
  font-size: 20px;
}

.nav-brand {
  color: var(--sky-blue);
}

.container {
  max-width: 900px;
  margin: 20px auto 0;
  padding: 30px 20px;
  position: relative;
  z-index: 1;
  width: 100%;
}

.page {
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.btn {
  display: inline-block;
  padding: 12px 30px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
  position: relative;
}

.btn:hover {
  transform: translateY(-4px);
}

.btn:active {
  transform: translateY(-2px);
}

.btn-primary {
  background-color: var(--sky-blue);
}

.btn-secondary {
  background-color: var(--sky-blue);
}

.btn-danger {
  background-color: var(--sky-blue);
}

.btn-warning {
  background-color: var(--sky-blue);
  color: white;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn:disabled::after {
  display: none;
}

.card {
  background-color: white;
  border-radius: 20px;
  padding: 25px;
  border: 3px solid white;
}

.title {
  text-align: center;
  color: var(--text-gray);
  margin-bottom: 25px;
}

.title h1 {
  font-size: 44px;
  font-weight: 700;
  margin-bottom: 8px;
  text-shadow: 3px 3px 0 rgba(77, 150, 255, 0.08);
}

.title p {
  font-size: 16px;
  opacity: 0.8;
}

.home-shell {
  padding-top: 40px;
  padding-bottom: 40px;
}

.home-hero,
.selection-panel {
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 20px 50px rgba(77, 150, 255, 0.08);
}

.home-hero {
  margin-bottom: 24px;
  padding: 34px;
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.9fr);
  gap: 24px;
  align-items: stretch;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(77, 150, 255, 0.12);
  color: var(--sky-blue);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 18px;
}

.home-title {
  text-align: left;
  margin-bottom: 18px;
}

.hero-description {
  font-size: 18px;
  line-height: 1.7;
  max-width: 520px;
  color: #666;
}

.hero-features {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.hero-feature {
  padding: 10px 16px;
  border-radius: 999px;
  background: white;
  border: 1px solid rgba(77, 150, 255, 0.14);
  color: #666;
  font-size: 14px;
  font-weight: 600;
}

.home-card {
  height: 100%;
  margin-bottom: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 249, 230, 0.92) 100%);
  border: 1px solid rgba(77, 150, 255, 0.08);
}

.panel-heading {
  margin-bottom: 18px;
}

.panel-heading h2,
.panel-heading h3 {
  margin-bottom: 6px;
}

.panel-heading p {
  color: #888;
  font-size: 14px;
}

.panel-heading-center {
  text-align: center;
}

.difficulty-selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 28px;
  width: 100%;
}

.difficulty-card {
  background: linear-gradient(180deg, #ffffff 0%, #fffdfa 100%);
  border-radius: 25px;
  padding: 24px 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  min-width: 0;
  border: 4px solid transparent;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.05);
}

.difficulty-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 18px 34px rgba(77, 150, 255, 0.12);
}

.difficulty-card.selected {
  background-color: var(--cream-white);
  transform: translateY(-8px);
  border-color: rgba(77, 150, 255, 0.4);
  box-shadow: 0 22px 36px rgba(77, 150, 255, 0.16);
}

.difficulty-card:focus-visible {
  outline: 3px solid rgba(77, 150, 255, 0.45);
  outline-offset: 4px;
}

.difficulty-card.easy .icon { color: var(--mint-green); font-size: 40px; }
.difficulty-card.medium .icon { color: var(--sunshine-yellow); font-size: 40px; }
.difficulty-card.hard .icon { color: var(--coral-pink); font-size: 40px; }

.difficulty-card h3 {
  margin-top: 15px;
  font-size: 20px;
  color: var(--text-gray);
}

.difficulty-meta {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.difficulty-meta span {
  display: block;
  padding: 8px 10px;
  border-radius: 12px;
  background-color: rgba(77, 150, 255, 0.06);
  font-size: 14px;
  color: #777;
}

.high-scores {
  background-color: rgba(255, 255, 255, 0.6);
  border-radius: 25px;
  padding: 25px;
  margin-bottom: 25px;
}

.high-scores h3 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 24px;
  color: var(--text-gray);
}

.home-card.high-scores {
  margin-bottom: 0;
}

.home-card .panel-heading {
  text-align: center;
}

.home-card.high-scores h3 {
  margin-bottom: 6px;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.score-item {
  text-align: center;
  background-color: white;
  padding: 18px 16px;
  border-radius: 20px;
  border: 1px solid rgba(77, 150, 255, 0.08);
  min-width: 0;
  overflow: hidden;
}

.score-item .label {
  font-size: 14px;
  opacity: 0.7;
  margin-bottom: 8px;
  white-space: nowrap;
}

.score-item .value {
  display: block;
  width: 100%;
  font-size: clamp(24px, 2.8vw, 34px);
  font-weight: 700;
  color: var(--text-gray);
  line-height: 1;
  white-space: nowrap;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.selection-panel {
  padding: 32px;
}

.home-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.home-start-btn {
  font-size: 20px;
  padding: 15px 60px;
  box-shadow: 0 16px 30px rgba(77, 150, 255, 0.24);
}

.home-tip {
  text-align: center;
  color: #888;
  font-size: 14px;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: white;
  border-radius: 25px;
  padding: 15px 25px;
  margin-bottom: 25px;
  border: 3px dashed rgba(77, 150, 255, 0.3);
  flex-wrap: wrap;
  gap: 15px;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
  flex: 1;
  min-width: 0;
}

.score-display, .combo-display, .timer-display {
  text-align: center;
  background-color: var(--light-gray);
  padding: 10px 20px;
  border-radius: 15px;
  min-width: 80px;
  max-width: 126px;
  min-height: 70px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.score-display.score-card {
  min-width: 108px;
  max-width: 148px;
}

.score-display.progress-card {
  min-width: 96px;
  max-width: 132px;
}

.score-display .label, .combo-display .label, .timer-display .label {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.score-display .value {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700;
  color: var(--sky-blue);
}

.combo-display .value {
  font-size: clamp(18px, 2.6vw, 22px);
  font-weight: 700;
  color: var(--coral-pink);
}

.score-display .value,
.combo-display .value,
.timer-display .value {
  width: 100%;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.timer-display .value {
  font-size: clamp(18px, 2.8vw, 24px);
  font-weight: 700;
  color: var(--text-gray);
}

.timer-display.warning .value {
  color: var(--error-red);
  animation: pulse 0.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.game-main {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 25px;
  flex: 1;
}

.game-board {
  background-color: white;
  border-radius: 30px;
  padding: 0;
  border: 4px solid var(--sky-blue);
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.game-hint {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 8px;
  padding: 2px 2px;
  margin-bottom: 10px;
  color: #888;
  font-size: 14px;
  width: calc(100% - 40px);
  flex-wrap: nowrap;
}

.game-hint .power-ups {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
}

.game-hint .power-up-btn {
  padding: 6px 12px;
  width: auto;
  flex-wrap: nowrap;
}

.game-hint .power-up-btn .icon {
  font-size: 16px;
}

.game-hint .power-up-btn .count {
  font-size: 11px;
  margin-top: 0;
}

.board-container {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: calc(100% - 40px);
  max-width: 500px;
  padding: 0 20px 20px;
  margin: 0 auto;
}

.board-container[data-difficulty="medium"] {
  max-width: 560px;
}

.board-container[data-difficulty="hard"] {
  max-width: 660px;
}

.game-card {
  width: 100%;
  min-width: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: white;
  border: 4px solid var(--light-gray);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.game-card:hover {
  transform: translateY(-6px) rotate(2deg);
}

.game-card.selected {
  background-color: var(--sunshine-yellow);
  border-color: #FFB800;
  transform: translateY(-8px) rotate(-2deg) scale(1.08);
}

.game-card.matched {
  opacity: 0;
  pointer-events: none;
  cursor: default;
}

.game-card.error {
  background-color: #FFE5E5;
  border-color: var(--error-red);
  animation: cardError 0.5s ease-in-out;
}

@keyframes cardError {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.game-card.hint-flash {
  animation: hintFlash 1.5s ease-in-out;
}

@keyframes hintFlash {
  0%, 100% { border-color: var(--light-gray); }
  25%, 75% { border-color: var(--sky-blue); }
}

.card-text {
  display: block;
  width: 100%;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  padding: 10px;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: clip;
}

.card-text.english {
  color: var(--sky-blue);
}

.card-text.chinese {
  color: var(--mint-green);
}

.game-card.difficulty-medium .card-text,
.game-card.difficulty-hard .card-text {
  white-space: nowrap;
}

.game-card.difficulty-medium .card-text.english {
  letter-spacing: -0.03em;
}

.game-card.difficulty-hard .card-text.english {
  letter-spacing: -0.05em;
}

.sidebar {
  background-color: white;
  border-radius: 30px;
  padding: 30px;
  border: 4px solid var(--sky-blue);
  width: 100%;
}

.sidebar h3 {
  font-size: 18px;
  margin-bottom: 15px;
  color: var(--text-gray);
  border-bottom: 3px dashed var(--lavender-purple);
  padding-bottom: 10px;
}

.word-list {
  list-style: none;
  max-height: 250px;
  overflow-y: auto;
}

.word-item {
  padding: 12px 15px;
  margin-bottom: 8px;
  border-radius: 15px;
  background-color: var(--light-gray);
  transition: all 0.3s ease;
}

.word-item.completed {
  background-color: #E8F5E9;
  border: 2px solid var(--mint-green);
}

.word-item .word {
  font-weight: 600;
  font-size: 16px;
  color: var(--sky-blue);
}

.word-item .meaning {
  font-size: 12px;
  color: #666;
  margin-top: 3px;
}

.power-ups {
  display: flex;
  gap: 15px;
  margin-top: 20px;
  justify-content: center;
}

.power-up-btn {
  flex: 1;
  padding: 10px 15px;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: center;
  display: flex;
  align-items: center;
  gap: 5px;
}

.power-up-btn:hover:not(:disabled) {
  transform: translateY(-6px) scale(1.05);
}

.power-up-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.power-up-btn.hint {
  background-color: var(--sky-blue);
  color: white;
}

.power-up-btn.undo {
  background-color: var(--sky-blue);
  color: white;
}

.power-up-btn .icon {
  font-size: 20px;
  display: inline-block;
}

.power-up-btn .count {
  font-size: 14px;
  font-weight: 700;
  margin-top: 0;
}

.result-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: calc(100vh - 72px);
  padding: 20px;
  position: relative;
  z-index: 1;
}

.result-card {
  background-color: white;
  border-radius: 30px;
  padding: 50px;
  text-align: center;
  max-width: 500px;
  width: 100%;
  border: 4px solid var(--sky-blue);
  position: relative;
}

.result-card::before {
  content: '🎊';
  position: absolute;
  top: -20px;
  left: -20px;
  font-size: 40px;
}

.result-card::after {
  content: '🎉';
  position: absolute;
  bottom: -20px;
  right: -20px;
  font-size: 40px;
}

.result-title {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 10px;
}

.result-title.success { color: var(--mint-green); }
.result-title.failure { color: var(--error-red); }

.result-subtitle {
  font-size: 16px;
  color: #888;
  margin-bottom: 30px;
}

.score-circle {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background-color: var(--sky-blue);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 30px;
  color: white;
  border: 6px solid white;
  position: relative;
}

.score-circle::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 4px dashed rgba(255, 255, 255, 0.5);
  animation: spin 10s linear infinite;
}

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

.score-circle .number {
  max-width: 100%;
  padding: 0 14px;
  font-size: clamp(32px, 7vw, 52px);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.score-circle .label {
  font-size: 14px;
  opacity: 0.9;
}

.stars {
  font-size: 52px;
  margin-bottom: 30px;
}

.stars .star {
  margin: 0 8px;
  animation: starPop 0.5s ease-out forwards;
}

.stars .star:nth-child(2) { animation-delay: 0.1s; }
.stars .star:nth-child(3) { animation-delay: 0.2s; }

@keyframes starPop {
  0% { transform: scale(0); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.stars .star.filled { color: var(--sunshine-yellow); }
.stars .star.empty { color: #ddd; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 30px;
}

.stat-item {
  background-color: var(--light-gray);
  padding: 15px;
  border-radius: 15px;
}

.stat-item .value {
  font-size: 24px;
  font-weight: 700;
  color: var(--sky-blue);
}

.stat-item .label {
  font-size: 12px;
  color: #888;
  margin-top: 5px;
}

.result-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.site-footer {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 16px 20px 22px;
  text-align: center;
  color: #888;
  font-size: 13px;
}

.site-footer p {
  margin: 0;
}

.pause-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.pause-content {
  background-color: white;
  border-radius: 30px;
  padding: 45px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  animation: scaleIn 0.3s ease;
  border: 4px solid var(--sky-blue);
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

.pause-content h2 {
  font-size: 28px;
  margin-bottom: 30px;
  color: var(--text-gray);
}

.pause-buttons {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.combo-animation {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 80px;
  font-weight: 700;
  color: var(--coral-pink);
  pointer-events: none;
  animation: comboText 0.8s ease-out forwards;
  z-index: 999;
  text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.1);
}

@keyframes comboText {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
  40% { opacity: 1; transform: translate(-50%, -50%) scale(1.4); }
  100% { opacity: 0; transform: translate(-50%, -120%) scale(1); }
}

.success-effect {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

.particle {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  animation: particleAnim 1s ease-out forwards;
}

@keyframes particleAnim {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-120px) scale(0); }
}

@media (max-width: 768px) {
  .container {
    padding: 22px 16px;
  }

  .home-hero,
  .selection-panel {
    padding: 24px;
  }

  .hero-layout {
    grid-template-columns: 1fr;
  }

  .home-title {
    text-align: center;
  }

  .hero-copy {
    align-items: center;
    text-align: center;
  }

  .hero-badge {
    align-self: center;
  }

  .hero-description {
    font-size: 16px;
  }

  .hero-features {
    justify-content: center;
  }

  .score-grid {
    grid-template-columns: 1fr;
  }

  .title h1 {
    font-size: 36px;
  }
  
  .board-container {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    max-width: 100%;
    padding: 0 12px 16px;
  }
  
  .game-card {
    width: 100%;
    height: 55px;
  }
  
  .game-hint .power-up-btn {
    width: auto;
  }
  
  .card-text {
    font-size: 14px;
  }
  
  .game-header {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "left right"
      "center center";
    padding: 12px 20px;
    justify-content: initial;
    align-items: start;
  }

  .header-left,
  .header-right {
    width: auto;
  }

  .header-left {
    grid-area: left;
    justify-content: flex-start;
  }

  .header-right {
    grid-area: right;
    justify-content: flex-end;
  }

  .header-center {
    grid-area: center;
    grid-column: 1 / -1;
    width: 100%;
    justify-content: space-between;
  }
  
  .score-display, .combo-display, .timer-display {
    padding: 8px 15px;
    min-width: 65px;
    max-width: 110px;
    min-height: 62px;
  }

  .score-display.score-card {
    min-width: 96px;
    max-width: 128px;
  }

  .score-display.progress-card {
    min-width: 88px;
    max-width: 118px;
  }
  
  .score-display .value {
    font-size: clamp(18px, 4vw, 22px);
  }
  
  .combo-display .value {
    font-size: clamp(16px, 3.6vw, 18px);
  }
  
  .timer-display .value {
    font-size: clamp(16px, 3.8vw, 20px);
  }
  
  .difficulty-card {
    padding: 20px 18px;
  }

  .sidebar {
    padding: 24px 22px;
    border-radius: 24px;
  }

  .result-page {
    padding: 16px;
  }

  .result-card {
    padding: 40px 28px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  
  .stat-item {
    padding: 12px;
  }
  
  .stat-item .value {
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 14px 12px 20px;
  }

  .home-shell {
    padding-top: 18px;
    padding-bottom: 24px;
  }

  .home-hero,
  .selection-panel {
    padding: 20px 16px;
    border-radius: 22px;
  }
  
  .title h1 {
    font-size: 28px;
  }
  
  .title p {
    font-size: 14px;
  }
  
  .game-board {
    border-radius: 20px;
  }

  .game-main {
    gap: 16px;
  }

  .game-hint {
    width: 100%;
    justify-content: center;
    padding: 10px 12px 0;
    margin-bottom: 6px;
  }

  .game-hint .power-ups {
    width: 100%;
    justify-content: center;
    gap: 8px;
  }

  .game-hint .power-up-btn {
    flex: 1;
    justify-content: center;
    padding: 8px 10px;
  }

  .board-container {
    width: 100%;
    gap: 8px;
    padding: 0 10px 14px;
  }

  .game-card {
    width: 100%;
    height: 48px;
    border-width: 3px;
    border-radius: 20px;
  }

  .card-text {
    font-size: 12px;
    padding: 4px 3px;
  }
  
  .game-header {
    padding: 12px;
    gap: 10px;
  }

  .header-left, .header-right {
    width: auto;
  }

  .header-center {
    width: 100%;
    gap: 8px;
  }
  
  .score-display, .combo-display, .timer-display {
    flex: 1 1 calc(50% - 8px);
    padding: 8px 10px;
    min-width: 0;
    max-width: none;
    min-height: 54px;
  }

  .score-display.score-card {
    min-width: 0;
    max-width: none;
  }

  .score-display.progress-card {
    min-width: 0;
    max-width: none;
  }
  
  .score-display .value {
    font-size: 16px;
  }
  
  .combo-display .value {
    font-size: 14px;
  }
  
  .timer-display .value {
    font-size: 16px;
  }
  
  .result-card {
    padding: 28px 16px;
    border-radius: 20px;
  }

  .result-card::before,
  .result-card::after {
    font-size: 28px;
  }
  
  .score-circle {
    width: 120px;
    height: 120px;
  }
  
  .score-circle .number {
    font-size: clamp(28px, 9vw, 36px);
  }
  
  .stars {
    font-size: 36px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .stat-item .value {
    font-size: 18px;
  }

  .result-buttons {
    flex-direction: column;
  }

  .result-buttons .btn {
    width: 100%;
  }
  
  .btn {
    padding: 10px 20px;
    font-size: 14px;
  }

  .header-left .btn,
  .header-right .btn {
    min-width: 96px;
    padding: 10px 14px;
  }
  
  .difficulty-selector {
    grid-template-columns: 1fr;
  }

  .difficulty-card {
    padding: 18px 16px;
  }
  
  .difficulty-card .icon {
    font-size: 30px;
  }
  
  .difficulty-card h3 {
    font-size: 16px;
  }
  
  .difficulty-meta span {
    font-size: 12px;
  }

  .home-start-btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 18px;
  }

  .site-footer {
    padding: 14px 16px 18px;
    font-size: 12px;
  }
}

@media (max-width: 360px) {
  .card-text {
    font-size: 10px;
  }
  
  .board-container {
    gap: 6px;
    padding: 0 8px 12px;
  }

  .game-card {
    height: 42px;
  }

  .score-display, .combo-display, .timer-display {
    padding: 7px 8px;
  }
}
