/**
 * Wordnus Matching Game v2 - Wave Connection Design
 * 30% words left, 70% options right with scrollable 10 rows
 * Wave-like connections between matched pairs
 */

/* ============================================
   CSS VARIABLES - PREMIUM CREAM THEME
   ============================================ */

:root {
  /* Cream/Ivory Base Colors */
  --wn-cream-50: #FFFDF7;
  --wn-cream-100: #FFF9ED;
  --wn-cream-200: #FEF3E2;
  --wn-cream-300: #FDECD3;
  --wn-cream-400: #F5E1C0;
  --wn-cream-500: #E8D5B5;

  /* Warm Neutrals */
  --wn-warm-50: #FEFEFE;
  --wn-warm-100: #FAFAF8;
  --wn-warm-200: #F5F5F2;
  --wn-warm-300: #EAEAE5;
  --wn-warm-400: #D4D4CF;
  --wn-warm-500: #A3A39E;
  --wn-warm-600: #737370;
  --wn-warm-700: #525250;
  --wn-warm-800: #3D3D3B;
  --wn-warm-900: #1F1F1E;

  /* Premium Accents */
  --wn-gold: #C9A227;
  --wn-gold-light: #E5C359;
  --wn-gold-dark: #9A7B1C;

  /* Override common variables for light theme */
  --wn-bg: var(--wn-cream-100);
  --wn-bg-alt: var(--wn-cream-50);
  --wn-surface: var(--wn-warm-50);
  --wn-surface-hover: var(--wn-warm-100);
  --wn-surface-active: var(--wn-warm-200);
  --wn-border: var(--wn-warm-300);
  --wn-border-light: var(--wn-warm-200);

  --wn-text: var(--wn-warm-900);
  --wn-text-secondary: var(--wn-warm-700);
  --wn-text-muted: var(--wn-warm-500);

  /* Premium shadows */
  --wn-shadow-cream: 0 2px 8px rgba(201, 162, 39, 0.08);
  --wn-shadow-card: 0 4px 20px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --wn-shadow-card-hover: 0 8px 32px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
  --wn-shadow-premium: 0 12px 40px rgba(201, 162, 39, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* ============================================
   BASE OVERRIDES
   ============================================ */

body {
  background: linear-gradient(135deg, var(--wn-cream-100) 0%, var(--wn-cream-200) 100%);
  min-height: 100vh;
}

/* ============================================
   TOP NAVIGATION - CREAM STYLE
   ============================================ */

.wn-topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: linear-gradient(180deg, var(--wn-cream-50) 0%, rgba(255, 249, 237, 0.98) 100%);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--wn-cream-300);
  padding: var(--wn-space-2) 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.wn-topnav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--wn-space-3);
}

.wn-topnav__back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--wn-warm-600);
  transition: color 0.2s;
}

.wn-topnav__back:hover {
  color: var(--wn-warm-800);
}

.wn-topnav__title {
  font-size: var(--wn-text-base);
  font-weight: 700;
  color: var(--wn-warm-800);
  margin: 0;
  letter-spacing: -0.02em;
}

.wn-topnav__action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  color: var(--wn-warm-500);
  cursor: pointer;
  border-radius: var(--wn-radius-md);
  transition: all 0.2s;
}

.wn-topnav__action:hover {
  background: var(--wn-cream-200);
  color: var(--wn-warm-700);
}

/* ============================================
   LOCKED SCREEN - PREMIUM STYLE
   ============================================ */

.wn-locked-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--wn-cream-100) 0%, var(--wn-cream-200) 100%);
  z-index: 200;
  padding: var(--wn-space-6);
}

.wn-locked-screen__content {
  text-align: center;
  max-width: 400px;
  background: var(--wn-warm-50);
  padding: var(--wn-space-8);
  border-radius: var(--wn-radius-xl);
  box-shadow: var(--wn-shadow-premium);
  border: 1px solid var(--wn-cream-300);
}

.wn-locked-screen__icon {
  color: var(--wn-gold);
  margin-bottom: var(--wn-space-6);
}

.wn-locked-screen__content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--wn-warm-800);
  margin-bottom: var(--wn-space-3);
}

.wn-locked-screen__progress {
  font-size: var(--wn-text-lg);
  color: var(--wn-warm-700);
  margin: var(--wn-space-4) 0 var(--wn-space-6);
}

.wn-locked-screen__progress span {
  font-weight: 700;
  color: var(--wn-gold-dark);
}

/* ============================================
   STATS BAR - COMPACT PREMIUM
   ============================================ */

.wn-stats-bar {
  position: fixed;
  top: 52px;
  left: 0;
  right: 0;
  z-index: 99;
  background: var(--wn-warm-50);
  border-bottom: 1px solid var(--wn-cream-300);
  padding: var(--wn-space-2) 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.wn-stats-bar__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--wn-space-4);
  flex-wrap: wrap;
}

.wn-stat-item {
  display: flex;
  align-items: center;
  gap: var(--wn-space-1);
  font-size: var(--wn-text-xs);
  color: var(--wn-warm-600);
  font-variant-numeric: tabular-nums;
}

.wn-stat-item svg {
  width: 14px;
  height: 14px;
  color: var(--wn-green);
}

.wn-stat-item--timer svg {
  color: var(--wn-gold);
}

.wn-stat-item--mistakes svg {
  color: var(--wn-red);
}

.wn-stat-item span {
  font-weight: 600;
  color: var(--wn-warm-800);
}

/* ============================================
   INSTRUCTIONS - COMPACT
   ============================================ */

.wn-instructions {
  text-align: center;
  padding: var(--wn-space-2) var(--wn-space-4);
  background: var(--wn-warm-50);
  border-radius: var(--wn-radius-md);
  margin-bottom: var(--wn-space-3);
  border: 1px solid var(--wn-cream-300);
}

.wn-round-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--wn-space-2);
  flex-wrap: wrap;
}

.wn-instructions-text {
  color: var(--wn-warm-600);
  font-size: var(--wn-text-xs);
}

/* ============================================
   MATCHING MAIN - FULL HEIGHT
   ============================================ */

.wn-matching-main {
  padding-top: 100px;
  padding-bottom: var(--wn-space-4);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wn-matching-main .wn-container {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ============================================
   MATCHING BOARD - 30/70 SPLIT LAYOUT
   ============================================ */

.wn-matching-board {
  display: flex;
  flex-direction: row;
  gap: 8px;
  flex: 1;
  min-height: 0;
  height: calc(100vh - 200px);
  max-height: calc(100vh - 200px);
  position: relative;
  overflow: visible;
}

/* SVG Connection Layer - overlays the entire board */
.wn-connection-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  overflow: visible;
}

/* ============================================
   MATCHING COLUMNS - 30/70 SPLIT
   ============================================ */

.wn-matching-column {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.wn-matching-column--words {
  flex: 0 0 30%;
  max-width: 30%;
}

.wn-matching-column--options {
  flex: 0 0 70%;
  max-width: 70%;
}

.wn-matching-column__title {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--wn-warm-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--wn-space-1);
  text-align: center;
  flex-shrink: 0;
}

/* ============================================
   WORD TILES - LEFT COLUMN (10 ROWS, 5 FILLED)
   ============================================ */

.wn-matching-tiles--words {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--wn-cream-400) transparent;
}

.wn-matching-tiles--words::-webkit-scrollbar {
  width: 4px;
}

.wn-matching-tiles--words::-webkit-scrollbar-track {
  background: transparent;
}

.wn-matching-tiles--words::-webkit-scrollbar-thumb {
  background: var(--wn-cream-400);
  border-radius: 4px;
}

/* ============================================
   OPTION TILES - RIGHT COLUMN (10 ROWS, SCROLLABLE)
   ============================================ */

.wn-matching-tiles--options {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--wn-cream-400) transparent;
  padding-right: 4px;
}

.wn-matching-tiles--options::-webkit-scrollbar {
  width: 6px;
}

.wn-matching-tiles--options::-webkit-scrollbar-track {
  background: var(--wn-cream-200);
  border-radius: 4px;
}

.wn-matching-tiles--options::-webkit-scrollbar-thumb {
  background: var(--wn-cream-400);
  border-radius: 4px;
}

.wn-matching-tiles--options::-webkit-scrollbar-thumb:hover {
  background: var(--wn-gold);
}

/* ============================================
   TILE BASE STYLES
   ============================================ */

.wn-tile {
  background: var(--wn-warm-50);
  border: 2px solid var(--wn-cream-300);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  position: relative;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
  color: var(--wn-warm-800);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 48px;
}

.wn-tile:hover:not(.wn-tile--matched):not(.wn-tile--wrong):not(.wn-tile--empty) {
  border-color: var(--wn-gold);
  transform: translateY(-2px);
  box-shadow: var(--wn-shadow-card-hover);
}

/* Word tiles (left side) */
.wn-tile--word {
  font-family: var(--wn-font-serif, 'Crimson Pro', Georgia, serif);
  font-weight: 700;
  font-size: 1.1rem;
  background: linear-gradient(145deg, var(--wn-warm-50), var(--wn-cream-100));
  min-height: 52px;
}

/* Empty placeholder tiles (left side) */
.wn-tile--empty {
  background: var(--wn-cream-200);
  border: 2px dashed var(--wn-cream-400);
  cursor: default;
  opacity: 0.5;
  min-height: 52px;
}

/* Option tiles (right side) - consistent font size, word-wrapped */
.wn-tile--option {
  font-size: 0.8rem;
  line-height: 1.35;
  padding: 10px 12px;
  padding-top: 22px; /* Space for badge */
  text-align: left;
  align-items: flex-start;
  justify-content: flex-start;
  min-height: auto;
  height: auto;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.wn-tile__text {
  width: 100%;
  word-break: break-word;
}

/* ============================================
   TILE STATES
   ============================================ */

/* Selected state */
.wn-tile--selected {
  border-color: var(--wn-gold);
  background: linear-gradient(145deg, var(--wn-cream-100), var(--wn-cream-200));
  box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.25), var(--wn-shadow-card);
  transform: scale(1.02);
}

/* Matched state */
.wn-tile--matched {
  border-color: var(--wn-green);
  background: linear-gradient(145deg, rgba(34, 197, 94, 0.12), rgba(34, 197, 94, 0.06));
  cursor: default;
  animation: matchPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes matchPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.wn-tile--matched::after {
  content: '';
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  background: var(--wn-green);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(34, 197, 94, 0.3);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

/* Wrong state */
.wn-tile--wrong {
  border-color: var(--wn-red);
  background: linear-gradient(145deg, rgba(239, 68, 68, 0.12), rgba(239, 68, 68, 0.06));
  animation: shake 0.4s ease;
}

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

/* Fade out matched tiles */
.wn-tile--fade-out {
  opacity: 0.4;
  transform: scale(0.98);
  pointer-events: none;
}

/* ============================================
   MATCH TYPE BADGES
   ============================================ */

.wn-tile__type-badge {
  position: absolute;
  top: 4px;
  right: 6px;
  padding: 2px 6px;
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: 4px;
  z-index: 1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.wn-tile__type-badge--definition {
  background: linear-gradient(135deg, #6366F1, #818CF8);
  color: white;
}

.wn-tile__type-badge--synonym {
  background: linear-gradient(135deg, #10B981, #34D399);
  color: white;
}

.wn-tile__type-badge--antonym {
  background: linear-gradient(135deg, #F59E0B, #FBBF24);
  color: white;
}

.wn-tile__type-badge--fill_blank {
  background: linear-gradient(135deg, #8B5CF6, #A78BFA);
  color: white;
}

.wn-tile--matched .wn-tile__type-badge {
  background: var(--wn-green) !important;
}

/* ============================================
   WAVE CONNECTION STYLES
   ============================================ */

.wn-connection-path {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.wn-connection-path--active {
  stroke: url(#waveGradient);
  opacity: 1;
  animation: wavePulse 1.5s ease-in-out infinite;
}

.wn-connection-path--matched {
  stroke: url(#successGradient);
  opacity: 0.8;
  animation: matchedWave 0.6s ease-out forwards;
}

.wn-connection-path--error {
  stroke: url(#errorGradient);
  opacity: 1;
  animation: errorWave 0.4s ease-out forwards;
}

@keyframes wavePulse {
  0%, 100% {
    stroke-width: 3;
    opacity: 0.8;
  }
  50% {
    stroke-width: 4;
    opacity: 1;
  }
}

@keyframes matchedWave {
  0% {
    stroke-width: 3;
    opacity: 1;
  }
  50% {
    stroke-width: 5;
    opacity: 1;
  }
  100% {
    stroke-width: 2;
    opacity: 0.5;
  }
}

@keyframes errorWave {
  0% {
    stroke-width: 3;
    opacity: 1;
  }
  25% {
    stroke-width: 5;
  }
  100% {
    stroke-width: 0;
    opacity: 0;
  }
}

/* ============================================
   ROUND BADGE - COMPACT GOLD
   ============================================ */

.wn-round-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--wn-space-1) var(--wn-space-3);
  background: linear-gradient(135deg, var(--wn-gold), var(--wn-gold-light));
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: var(--wn-radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 6px rgba(201, 162, 39, 0.3);
}

/* ============================================
   MODE BADGE - COMPACT
   ============================================ */

.wn-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--wn-space-1);
  padding: var(--wn-space-1) var(--wn-space-2);
  border-radius: var(--wn-radius-full);
  font-size: 0.65rem;
  font-weight: 600;
}

.wn-mode-badge--xp {
  background: linear-gradient(135deg, var(--wn-gold), var(--wn-gold-light));
  color: white;
  box-shadow: 0 2px 8px rgba(201, 162, 39, 0.3);
}

.wn-mode-badge--practice {
  background: var(--wn-cream-200);
  color: var(--wn-warm-600);
  border: 1px dashed var(--wn-cream-400);
}

.wn-mode-badge svg {
  width: 12px;
  height: 12px;
}

/* ============================================
   XP COUNTER - COMPACT GOLD
   ============================================ */

.wn-xp-counter {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: var(--wn-space-1) var(--wn-space-2);
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.1), rgba(201, 162, 39, 0.05));
  border-radius: var(--wn-radius-full);
  border: 1px solid rgba(201, 162, 39, 0.3);
}

.wn-xp-counter__value {
  font-size: var(--wn-text-sm);
  font-weight: 700;
  color: var(--wn-gold-dark);
  font-variant-numeric: tabular-nums;
}

.wn-xp-counter__label {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--wn-gold-dark);
  text-transform: uppercase;
}

.wn-xp-counter__max {
  font-size: 0.6rem;
  color: var(--wn-warm-500);
}

/* ============================================
   XP FLOAT ANIMATION
   ============================================ */

.wn-xp-float {
  position: fixed;
  font-weight: 700;
  font-size: 1.25rem;
  pointer-events: none;
  z-index: 1000;
  transform: translateX(-50%);
  animation: xpFloat 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.wn-xp-float--positive {
  color: var(--wn-green);
  text-shadow: 0 2px 6px rgba(34, 197, 94, 0.4);
}

.wn-xp-float--negative {
  color: var(--wn-red);
  text-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}

@keyframes xpFloat {
  0% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-50px) scale(1.3);
  }
}

/* ============================================
   ROUND FORFEITED MESSAGE
   ============================================ */

.wn-round-forfeited {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(239, 68, 68, 0.95);
  color: white;
  padding: var(--wn-space-4) var(--wn-space-6);
  border-radius: var(--wn-radius-lg);
  font-weight: 700;
  font-size: var(--wn-text-lg);
  z-index: 300;
  animation: forfeitPop 0.4s ease;
  box-shadow: 0 8px 32px rgba(239, 68, 68, 0.4);
}

@keyframes forfeitPop {
  0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
  50% { transform: translate(-50%, -50%) scale(1.1); }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* ============================================
   FORFEIT ACTION BUTTON
   ============================================ */

.wn-forfeit-action {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  padding: 12px 16px;
  background: linear-gradient(180deg, var(--wn-cream-100) 0%, rgba(239, 68, 68, 0.05) 100%);
  border-top: 1px solid var(--wn-cream-300);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
  z-index: 100;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

.wn-forfeit-action .wn-btn {
  display: flex;
  align-items: center;
  gap: var(--wn-space-2);
  min-width: 180px;
  justify-content: center;
}

.wn-forfeit-action .wn-btn svg {
  animation: spin 2s linear infinite;
}

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

.wn-forfeit-action .wn-btn:hover svg {
  animation: none;
}

/* ============================================
   ROUND COMPLETE OVERLAY - COMPACT
   ============================================ */

.wn-round-complete,
.wn-all-complete {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 253, 247, 0.95);
  backdrop-filter: blur(8px);
  z-index: 200;
  padding: var(--wn-space-4);
}

.wn-round-complete__content,
.wn-all-complete__content {
  background: var(--wn-warm-50);
  border-radius: var(--wn-radius-xl);
  padding: var(--wn-space-6);
  text-align: center;
  max-width: 380px;
  width: 100%;
  box-shadow: var(--wn-shadow-premium);
  border: 1px solid var(--wn-cream-300);
  animation: popIn 0.3s ease;
}

@keyframes popIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.wn-round-complete__icon,
.wn-all-complete__icon {
  font-size: 3rem;
  margin-bottom: var(--wn-space-3);
}

.wn-round-complete__title,
.wn-all-complete__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--wn-warm-800);
  margin-bottom: var(--wn-space-2);
}

.wn-all-complete__text {
  color: var(--wn-warm-600);
  font-size: var(--wn-text-sm);
  margin-bottom: var(--wn-space-4);
}

.wn-round-complete__stats,
.wn-all-complete__stats {
  display: flex;
  justify-content: center;
  gap: var(--wn-space-4);
  margin: var(--wn-space-4) 0;
  flex-wrap: wrap;
}

.wn-round-stat {
  text-align: center;
  padding: var(--wn-space-2);
}

.wn-round-stat__value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--wn-gold-dark);
  font-variant-numeric: tabular-nums;
}

.wn-round-stat__label {
  font-size: var(--wn-text-xs);
  color: var(--wn-warm-500);
  margin-top: 2px;
}

/* Round bonus/penalty message */
.wn-round-bonus {
  font-size: var(--wn-text-sm);
  color: var(--wn-warm-500);
  padding: var(--wn-space-2) var(--wn-space-3);
  border-radius: var(--wn-radius);
  background: var(--wn-cream-200);
  margin-bottom: var(--wn-space-2);
}

.wn-round-bonus--perfect {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05));
  color: var(--wn-green-dark);
  font-weight: 600;
}

.wn-round-bonus--forfeited {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
  color: var(--wn-red);
  font-weight: 600;
}

/* XP Stat - Premium style */
.wn-round-stat--xp {
  padding: var(--wn-space-3) var(--wn-space-4);
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.1), rgba(201, 162, 39, 0.05));
  border-radius: var(--wn-radius-lg);
  border: 1px solid rgba(201, 162, 39, 0.3);
}

.wn-round-stat--xp .wn-round-stat__value {
  font-size: 2rem;
  background: linear-gradient(135deg, var(--wn-gold-dark), var(--wn-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.wn-round-stat--xp .wn-round-stat__label {
  color: var(--wn-gold-dark);
  font-weight: 600;
}

.wn-round-complete__actions,
.wn-all-complete__actions {
  display: flex;
  flex-direction: column;
  gap: var(--wn-space-2);
}

/* XP Gained display */
.wn-round-xp-gained {
  font-size: var(--wn-text-base);
  font-weight: 700;
  margin-bottom: var(--wn-space-3);
}

.wn-round-xp-gained--positive {
  color: var(--wn-green-dark);
}

.wn-round-xp-gained--negative {
  color: var(--wn-red);
}

/* ============================================
   BUTTONS - COMPACT PREMIUM
   ============================================ */

.wn-btn {
  background: var(--wn-warm-50);
  border: 2px solid var(--wn-cream-300);
  color: var(--wn-warm-700);
  padding: var(--wn-space-2) var(--wn-space-4);
  font-size: var(--wn-text-sm);
}

.wn-btn:hover:not(:disabled) {
  background: var(--wn-cream-100);
  border-color: var(--wn-cream-400);
}

.wn-btn--primary {
  background: linear-gradient(135deg, var(--wn-gold), var(--wn-gold-light));
  border-color: var(--wn-gold);
  color: white;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(201, 162, 39, 0.3);
}

.wn-btn--primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--wn-gold-dark), var(--wn-gold));
  border-color: var(--wn-gold-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(201, 162, 39, 0.4);
}

.wn-btn--lg {
  padding: var(--wn-space-3) var(--wn-space-5);
}

/* ============================================
   TIMER WARNING STATES
   ============================================ */

.wn-timer--warning span {
  color: var(--wn-orange) !important;
  animation: timerPulse 1s ease-in-out infinite;
}

.wn-timer--danger span {
  color: var(--wn-red) !important;
  animation: timerPulse 0.5s ease-in-out infinite;
}

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

/* ============================================
   SOUND TOGGLE - COMPACT
   ============================================ */

.wn-sound-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--wn-cream-100);
  border: 1px solid var(--wn-cream-300);
  border-radius: var(--wn-radius-md);
  color: var(--wn-warm-500);
  cursor: pointer;
  transition: all 0.2s ease;
}

.wn-sound-toggle:hover {
  background: var(--wn-cream-200);
  color: var(--wn-warm-700);
}

.wn-sound-toggle svg {
  width: 14px;
  height: 14px;
}

/* ============================================
   LOADING OVERLAY - CREAM
   ============================================ */

.wn-loading-overlay {
  background: linear-gradient(135deg, var(--wn-cream-100) 0%, var(--wn-cream-200) 100%);
}

.wn-loading-overlay .wn-spinner {
  border-color: var(--wn-cream-400);
  border-top-color: var(--wn-gold);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
  .wn-matching-board {
    height: calc(100vh - 180px);
    max-height: calc(100vh - 180px);
    gap: 6px;
  }

  .wn-matching-column--words {
    flex: 0 0 28%;
    max-width: 28%;
  }

  .wn-matching-column--options {
    flex: 0 0 72%;
    max-width: 72%;
  }

  .wn-tile--word {
    font-size: 0.95rem;
    min-height: 44px;
    padding: 6px 8px;
  }

  .wn-tile--empty {
    min-height: 44px;
  }

  /* Keep consistent font size for options */
  .wn-tile--option {
    font-size: 0.78rem;
    padding: 8px 10px;
    padding-top: 20px;
  }

  .wn-tile__type-badge {
    font-size: 0.5rem;
    padding: 1px 4px;
  }
}

@media (max-width: 480px) {
  .wn-matching-board {
    height: calc(100vh - 170px);
    max-height: calc(100vh - 170px);
    gap: 4px;
  }

  .wn-matching-column--words {
    flex: 0 0 26%;
    max-width: 26%;
  }

  .wn-matching-column--options {
    flex: 0 0 74%;
    max-width: 74%;
  }

  .wn-tile--word {
    font-size: 0.85rem;
    min-height: 40px;
    padding: 4px 6px;
    border-radius: 6px;
  }

  .wn-tile--empty {
    min-height: 40px;
    border-radius: 6px;
  }

  /* Keep consistent font size for options */
  .wn-tile--option {
    font-size: 0.75rem;
    padding: 6px 8px;
    padding-top: 18px;
    border-radius: 6px;
  }

  .wn-tile__type-badge {
    font-size: 0.45rem;
    padding: 1px 3px;
    top: 2px;
    right: 4px;
  }

  .wn-matching-column__title {
    font-size: 0.55rem;
    margin-bottom: 4px;
  }

  .wn-stats-bar__inner {
    gap: var(--wn-space-2);
  }
}

@media (max-width: 360px) {
  .wn-matching-column--words {
    flex: 0 0 24%;
    max-width: 24%;
  }

  .wn-matching-column--options {
    flex: 0 0 76%;
    max-width: 76%;
  }

  .wn-tile--word {
    font-size: 0.75rem;
    min-height: 36px;
  }

  .wn-tile--empty {
    min-height: 36px;
  }

  /* Keep consistent font size for options */
  .wn-tile--option {
    font-size: 0.72rem;
    padding-top: 16px;
  }
}

/* ============================================
   SAFE AREA (iOS)
   ============================================ */

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .wn-matching-main {
    padding-bottom: calc(var(--wn-space-4) + env(safe-area-inset-bottom));
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .wn-tile,
  .wn-mode-badge,
  .wn-xp-counter,
  .wn-xp-float,
  .wn-round-badge,
  .wn-connection-path {
    transition: none;
    animation: none;
  }

  .wn-timer--warning span,
  .wn-timer--danger span {
    animation: none;
  }

  .wn-tile--matched {
    animation: none;
  }
}
