/* ==========================================================================
   MEMORY MATCH - MODERN ARCADE THEME (PURPLE & BLUE)
   ========================================================================== */

:root {
  /* Palette */
  --bg-dark: #090514;
  --bg-gradient: radial-gradient(circle at 50% 20%, #1e0d3b 0%, #0d061e 50%, #06020c 100%);
  --panel-bg: rgba(26, 15, 52, 0.72);
  --panel-border: rgba(168, 85, 247, 0.35);

  --neon-purple: #a855f7;
  --neon-purple-glow: rgba(168, 85, 247, 0.45);
  --neon-blue: #00f0ff;
  --neon-blue-glow: rgba(0, 240, 255, 0.45);
  --electric-violet: #8b5cf6;
  --cyber-cyan: #06b6d4;
  --hot-pink: #ec4899;
  --arcade-gold: #facc15;

  --card-back-bg: linear-gradient(135deg, #1f1147 0%, #12092b 100%);
  --card-front-bg: linear-gradient(145deg, #2a1254 0%, #160833 100%);
  --card-matched-bg: linear-gradient(145deg, #0f2b46 0%, #0d1e38 100%);

  --text-primary: #ffffff;
  --text-secondary: #c4b5fd;
  --text-muted: #8b83ba;

  --font-display: 'Orbitron', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Rajdhani', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-neon-blue: 0 0 20px rgba(0, 240, 255, 0.3);
  --shadow-neon-purple: 0 0 20px rgba(168, 85, 247, 0.35);

  --vh: 100vh;
}

/* Base Reset & Typography */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  background: var(--bg-dark);
  background-image: var(--bg-gradient);
  color: var(--text-primary);
  touch-action: manipulation;
}

/* Background Cyber Grid Lines */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(168, 85, 247, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* Scanline Overlay (Retro Arcade Atmosphere) */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.12) 0px,
    rgba(0, 0, 0, 0.12) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  z-index: 1;
}

/* Canvas for Confetti */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 900;
  width: 100%;
  height: 100%;
}

/* Main Container */
.game-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1000px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: 10px 16px;
}

/* Header & Controls */
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  gap: 12px;
}

.brand-wrapper {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.game-title {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3.5vw, 1.8rem);
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #00f0ff 0%, #a855f7 50%, #f43f5e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.4));
}

.arcade-badge {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #00f0ff;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.4);
  padding: 3px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Arcade Buttons */
.btn-arcade-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(30, 16, 60, 0.8);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn-arcade-icon:hover {
  background: rgba(45, 25, 90, 0.9);
  border-color: var(--neon-blue);
  box-shadow: 0 0 12px var(--neon-blue-glow);
  transform: translateY(-2px);
}

.btn-arcade-icon:active {
  transform: translateY(1px);
}

.btn-arcade-text {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: rgba(30, 16, 60, 0.8);
  border: 1px solid var(--panel-border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-arcade-text:hover {
  background: rgba(45, 25, 90, 0.9);
  color: #ffffff;
  border-color: var(--neon-purple);
  box-shadow: 0 0 12px var(--neon-purple-glow);
  transform: translateY(-2px);
}

/* In-Game HUD (Status Bar) */
.game-hud {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 6px 0 12px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 8px 20px rgba(0, 0, 0, 0.4);
}

.hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hud-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.hud-value {
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 2.2vw, 1.25rem);
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

#hud-timer {
  color: #00f0ff;
  text-shadow: 0 0 10px var(--neon-blue-glow);
}

#hud-score {
  color: #facc15;
  text-shadow: 0 0 10px rgba(250, 204, 21, 0.4);
}

.hud-badge {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.badge-easy {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.6);
  color: #34d399;
}

.badge-medium {
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.6);
  color: #60a5fa;
}

.badge-hard {
  background: rgba(236, 72, 153, 0.18);
  border: 1px solid rgba(236, 72, 153, 0.6);
  color: #f472b6;
}

/* Card Playfield Area */
.playfield-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 0;
  padding: 4px 0 10px;
}

.card-grid {
  display: grid;
  gap: clamp(8px, 1.6vw, 16px);
  width: 100%;
  height: 100%;
  max-height: 100%;
  justify-content: center;
  align-content: center;
  perspective: 1000px;
}

/* Dynamic Grid Dimensions */
.card-grid[data-difficulty="easy"] {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
  max-width: 620px;
  max-height: 520px;
}

.card-grid[data-difficulty="medium"] {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  max-width: 640px;
  max-height: 600px;
}

.card-grid[data-difficulty="hard"] {
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(4, 1fr);
  max-width: 880px;
  max-height: 600px;
}

/* Individual Arcade Card */
.arcade-card {
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1.15;
  min-height: 60px;
  cursor: pointer;
  outline: none;
  border-radius: var(--radius-md);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.arcade-card:focus-visible {
  box-shadow: 0 0 0 3px #00f0ff, 0 0 15px rgba(0, 240, 255, 0.7);
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.45s cubic-bezier(0.34, 1.4, 0.64, 1);
  transform-style: preserve-3d;
  border-radius: var(--radius-md);
}

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

/* Card Faces */
.card-front, .card-back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
}

/* Card Front (Face Down State) */
.card-front {
  background: var(--card-front-bg);
  border: 1.5px solid rgba(168, 85, 247, 0.4);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.arcade-card:hover .card-front {
  border-color: #00f0ff;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.4);
  transform: translateY(-2px);
}

.arcade-card-pattern {
  position: absolute;
  inset: 5px;
  border: 1px dashed rgba(168, 85, 247, 0.3);
  border-radius: calc(var(--radius-md) - 4px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, rgba(168, 85, 247, 0.12) 0%, transparent 70%);
}

.arcade-card-logo {
  font-size: clamp(1.1rem, 2.5vw, 1.8rem);
  color: var(--neon-purple);
  filter: drop-shadow(0 0 6px var(--neon-purple-glow));
  opacity: 0.85;
}

/* Card Decorative Corner Accents */
.arcade-corner {
  position: absolute;
  width: 6px;
  height: 6px;
  border-color: var(--neon-purple);
  opacity: 0.6;
}

.arcade-corner.tl { top: 4px; left: 4px; border-top: 1.5px solid; border-left: 1.5px solid; }
.arcade-corner.tr { top: 4px; right: 4px; border-top: 1.5px solid; border-right: 1.5px solid; }
.arcade-corner.bl { bottom: 4px; left: 4px; border-bottom: 1.5px solid; border-left: 1.5px solid; }
.arcade-corner.br { bottom: 4px; right: 4px; border-bottom: 1.5px solid; border-right: 1.5px solid; }

/* Card Back (Face Up / Revealed State) */
.card-back {
  background: var(--card-back-bg);
  border: 2px solid var(--neon-blue);
  transform: rotateY(180deg);
  box-shadow: 0 0 16px var(--neon-blue-glow);
  padding: 6px;
}

.card-symbol-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 75%;
  height: 65%;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(0, 240, 255, 0.15) 0%, transparent 70%);
}

.card-symbol {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

.card-name-tag {
  font-family: var(--font-display);
  font-size: clamp(0.55rem, 1.2vw, 0.72rem);
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90%;
}

/* Matched Card Animation & Styling */
.arcade-card.matched .card-back {
  background: var(--card-matched-bg);
  border-color: #34d399;
  box-shadow: 0 0 18px rgba(52, 211, 153, 0.5);
  animation: matchPulse 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.arcade-card.matched {
  cursor: default;
}

@keyframes matchPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); filter: brightness(1.2); }
  100% { transform: scale(1); filter: brightness(1); }
}

/* Mismatch Shake Animation */
.arcade-card.mismatch-shake {
  animation: shakeCard 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shakeCard {
  10%, 90% { transform: translate3d(-3px, 0, 0); }
  20%, 80% { transform: translate3d(5px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-5px, 0, 0); }
  40%, 60% { transform: translate3d(3px, 0, 0); }
}

/* Card Spawn Animation */
@keyframes cardSpawn {
  0% { opacity: 0; transform: scale(0.6) translateY(20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.card-spawn {
  animation: cardSpawn 0.4s cubic-bezier(0.34, 1.4, 0.64, 1) backwards;
}

/* Floating Score Popup */
.floating-score {
  position: fixed;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: #facc15;
  text-shadow: 0 0 12px rgba(250, 204, 21, 0.8), 0 0 20px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  z-index: 1000;
  transform: translate(-50%, -50%);
  animation: floatUp 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(0.8); }
  20% { opacity: 1; transform: translate(-50%, -10px) scale(1.15); }
  80% { opacity: 0.9; transform: translate(-50%, -35px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -55px) scale(0.9); }
}

/* ==========================================================================
   MODALS & OVERLAYS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 4, 18, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 500;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: linear-gradient(145deg, #1d0f3b 0%, #100624 100%);
  border: 1.5px solid var(--panel-border);
  box-shadow: 0 0 35px rgba(168, 85, 247, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-xl);
  padding: clamp(20px, 4vw, 36px);
  width: 100%;
  max-width: 520px;
  text-align: center;
  transform: scale(0.92) translateY(15px);
  transition: transform 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
  position: relative;
  max-height: 94vh;
  overflow-y: auto;
}

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-icon-hero {
  font-size: 3.2rem;
  line-height: 1;
  margin-bottom: 8px;
  animation: floatHero 3s ease-in-out infinite;
}

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

.modal-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #ffffff 0%, #00f0ff 50%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.3));
}

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

/* Difficulty Selector Group */
.difficulty-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}

.diff-select-btn {
  background: rgba(36, 17, 72, 0.6);
  border: 1.5px solid rgba(168, 85, 247, 0.3);
  border-radius: var(--radius-md);
  padding: 12px 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
  color: var(--text-primary);
}

.diff-select-btn:hover {
  background: rgba(50, 25, 96, 0.8);
  border-color: var(--neon-blue);
  transform: translateY(-2px);
}

.diff-select-btn.selected {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2) 0%, rgba(168, 85, 247, 0.3) 100%);
  border-color: #00f0ff;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.35);
}

.diff-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.diff-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.diff-best-label {
  font-size: 0.65rem;
  color: var(--arcade-gold);
  margin-top: 4px;
  font-weight: 600;
}

/* Primary Arcade Button */
.btn-arcade-primary {
  width: 100%;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #00f0ff 0%, #8b5cf6 50%, #ec4899 100%);
  border: none;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.4), 0 4px 12px rgba(0, 0, 0, 0.5);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn-arcade-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.6), 0 6px 16px rgba(0, 0, 0, 0.6);
}

.btn-arcade-primary:active {
  transform: translateY(1px) scale(0.99);
}

.btn-arcade-secondary {
  width: 100%;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: rgba(36, 17, 72, 0.7);
  border: 1.5px solid var(--panel-border);
  color: var(--text-secondary);
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.2s ease;
}

.btn-arcade-secondary:hover {
  background: rgba(50, 25, 96, 0.9);
  color: #ffffff;
  border-color: var(--neon-purple);
  box-shadow: 0 0 14px var(--neon-purple-glow);
}

/* Instructions / Hints Footer */
.modal-instructions {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(168, 85, 247, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.rule-pill {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Victory Screen Specifics */
.victory-stars {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 10px 0 18px;
}

.star-icon {
  font-size: 2.4rem;
  color: rgba(255, 255, 255, 0.15);
  transition: transform 0.3s ease;
}

.star-icon.active {
  color: var(--arcade-gold);
  text-shadow: 0 0 18px rgba(250, 204, 21, 0.8), 0 0 30px rgba(250, 204, 21, 0.4);
  animation: starPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

@keyframes starPop {
  0% { transform: scale(0) rotate(-45deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.victory-banner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #00f0ff;
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid #00f0ff;
  border-radius: 20px;
  padding: 4px 14px;
  margin-bottom: 16px;
  text-transform: uppercase;
  animation: pulseRecord 1.5s infinite;
}

@keyframes pulseRecord {
  0%, 100% { transform: scale(1); box-shadow: 0 0 10px rgba(0, 240, 255, 0.3); }
  50% { transform: scale(1.05); box-shadow: 0 0 20px rgba(0, 240, 255, 0.6); }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 14px 0 22px;
}

.stat-card {
  background: rgba(26, 12, 54, 0.8);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.stat-val {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: #ffffff;
  margin-top: 2px;
}

.stat-val.score-val {
  color: var(--arcade-gold);
  text-shadow: 0 0 10px rgba(250, 204, 21, 0.4);
}

/* ==========================================================================
   RESPONSIVE LAYOUT OPTIMIZATIONS
   ========================================================================== */
@media (max-width: 680px) {
  .game-container {
    padding: 6px 10px;
  }

  .game-hud {
    padding: 6px 8px;
    gap: 4px;
  }

  .hud-label {
    font-size: 0.62rem;
  }

  .hud-value {
    font-size: 0.95rem;
  }

  /* Mobile Portrait Layout for Grids */
  .card-grid[data-difficulty="easy"] {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, 1fr);
  }

  .card-grid[data-difficulty="medium"] {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
  }

  .card-grid[data-difficulty="hard"] {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(6, 1fr);
  }

  .card-symbol {
    font-size: 1.6rem;
  }

  .card-name-tag {
    display: none; /* Hide text label on tiny mobile screens to maximize symbol visibility */
  }

  .difficulty-selector {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .diff-select-btn {
    flex-direction: row;
    justify-content: space-between;
    padding: 10px 14px;
  }
}

@media (max-height: 600px) and (orientation: landscape) {
  .game-hud {
    margin: 4px 0 6px;
    padding: 4px 10px;
  }

  .card-grid {
    gap: 6px;
  }

  .modal-content {
    padding: 16px;
  }

  .modal-icon-hero {
    font-size: 2rem;
    margin-bottom: 2px;
  }
}
