/* ===== YourMove.me Brand Stylesheet ===== */

:root {
  /* Primary */
  --color-charcoal: #1A1A2E;
  --color-amber: #D4A24E;
  --color-cream: #F5E6C8;

  /* Supporting */
  --color-slate: #2D3436;
  --color-gold-light: #E8C88A;
  --color-warm-white: #FAF4E8;
  --color-warm-gray: #7A6B4F;

  /* Accents */
  --color-green: #4CAF7D;
  --color-coral: #E07A5F;
  --color-blue: #5B7BA5;

  /* Board */
  --color-board-light: #F5E6C8;
  --color-board-dark: #C4A870;
  --color-highlight: #B8B254;

  /* Surfaces */
  --color-card: #161630;

  /* Typography */
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
}

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

html, body {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-charcoal);
  background: var(--color-warm-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}

input, button {
  font-family: inherit;
  font-size: inherit;
}

/* ===== Pages ===== */
.page {
  min-height: 100dvh;
  width: 100%;
}

/* ===== Landing Page (Scroll-Snap) ===== */
.landing-snap-container {
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  height: 100dvh;
  -webkit-overflow-scrolling: touch;
}

.landing-snap-section {
  scroll-snap-align: start;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

#landing-page .landing-snap-section:first-child {
  background: var(--color-cream);
}

/* Scroll hint chevron */
.scroll-hint {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  animation: scrollHintBounce 2s ease-in-out infinite;
  opacity: 0.5;
}

@keyframes scrollHintBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* ===== Dedication Section ===== */
.dedication-section {
  background: var(--color-charcoal);
}

.dedication-inner {
  text-align: center;
  padding: 80px 32px 64px;
  max-width: 480px;
  margin: 0 auto;
}

.ded-rule {
  width: 48px;
  height: 2px;
  background: var(--color-amber);
  margin: 0 auto 28px;
  border-radius: 1px;
  opacity: 0.5;
}

.ded-for {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-warm-gray);
  margin-bottom: 12px;
}

.ded-name {
  font-family: 'Lora', serif;
  font-size: 36px;
  font-weight: 500;
  font-style: italic;
  color: var(--color-amber);
  margin-bottom: 24px;
  letter-spacing: 0.5px;
}

.ded-text {
  font-family: 'Lora', serif;
  font-size: 16px;
  font-style: italic;
  color: rgba(245, 230, 200, 0.85);
  line-height: 1.8;
  max-width: 360px;
  margin: 0 auto 28px;
}

.ded-wish {
  font-family: var(--font-body);
  font-size: 12px;
  color: rgba(122, 107, 79, 0.7);
  line-height: 1.7;
  max-width: 320px;
  margin: 0 auto;
}

.ded-dots {
  margin-top: 28px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.ded-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.ded-dot--amber { background: var(--color-amber); }
.ded-dot--cream { background: var(--color-cream); }

.ded-path {
  width: 20px;
  height: 2px;
  border-radius: 1px;
  background: var(--color-warm-gray);
  opacity: 0.3;
}

@media (max-width: 480px) {
  .dedication-inner { padding: 56px 24px 40px; }
  .ded-name { font-size: 28px; }
  .ded-text { font-size: 15px; }
}

#landing-page {
  background: var(--color-cream);
}

.landing-container {
  text-align: center;
  padding: 24px;
  max-width: 400px;
  width: 100%;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 8px;
}

.logo-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
}

.logo-dot--amber {
  background: var(--color-amber);
}

.logo-dot--charcoal {
  background: var(--color-charcoal);
}

.logo-dot--cream {
  background: var(--color-cream);
  border: 1.5px solid var(--color-warm-gray);
}

.logo-path {
  font-size: 18px;
  color: var(--color-warm-gray);
  font-weight: 400;
  line-height: 1;
}

.logo-text {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 32px;
}

.logo-your {
  color: var(--color-charcoal);
}

.logo-move {
  color: var(--color-amber);
}

.logo-me {
  color: var(--color-warm-gray);
  font-weight: 400;
  font-size: 18px;
}

/* Hero */
.hero-heading {
  font-size: 28px;
  font-weight: 600;
  color: var(--color-charcoal);
  line-height: 1.3;
  margin-bottom: 12px;
}

.hero-subtext {
  font-size: 14px;
  color: var(--color-warm-gray);
  margin-bottom: 32px;
}

.hero-fine-print {
  font-size: 11px;
  color: var(--color-warm-gray);
  margin-top: 16px;
}

/* ===== Setup Screens (Name, Picker, Share, Join) ===== */
.setup-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 24px;
  max-width: 400px;
  margin: 0 auto;
  text-align: center;
}

.setup-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 32px;
}

.setup-logo .logo-dot {
  width: 10px;
  height: 10px;
}

.setup-logo .logo-path {
  font-size: 14px;
}

.setup-heading {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-charcoal);
  margin-bottom: 24px;
}

/* Name input */
.input-name {
  width: 100%;
  max-width: 280px;
  padding: 12px 20px;
  border: 2px solid var(--color-gold-light);
  border-radius: 999px;
  background: var(--color-warm-white);
  color: var(--color-charcoal);
  font-size: 16px; /* Must be 16px+ to prevent iOS Safari auto-zoom */
  font-weight: 500;
  text-align: center;
  outline: none;
  transition: border-color 0.15s ease;
  margin-bottom: 20px;
}

.input-name:focus {
  border-color: var(--color-amber);
}

.input-name::placeholder {
  color: var(--color-warm-gray);
  font-weight: 400;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  border-radius: 999px;
  transition: transform 0.1s ease, opacity 0.1s ease;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn:disabled:active {
  transform: none;
}

.btn-primary {
  background: var(--color-amber);
  color: var(--color-charcoal);
  padding: 12px 28px;
  font-size: 15px;
  min-width: 200px;
}

.btn-secondary {
  background: transparent;
  color: var(--color-amber);
  padding: 8px 16px;
  margin-top: 8px;
}

/* ===== Game Picker ===== */
.game-picker {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 280px;
}

.game-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--color-warm-white);
  border: 2px solid var(--color-gold-light);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.1s ease;
  position: relative;
}

.game-card:hover:not(:disabled) {
  border-color: var(--color-amber);
}

.game-card:active:not(:disabled) {
  transform: scale(0.98);
}

.game-card--coming-soon {
  opacity: 0.45;
  cursor: not-allowed;
}

.game-card-icon {
  font-size: 24px;
}

.game-card-name {
  font-size: 16px;
  font-weight: 500;
  color: var(--color-charcoal);
}

.game-card-badge {
  position: absolute;
  right: 16px;
  font-size: 10px;
  font-weight: 500;
  color: var(--color-warm-gray);
  background: var(--color-cream);
  padding: 2px 8px;
  border-radius: 999px;
}

/* ===== Suggest a Game ===== */
.suggest-game-wrap {
  margin-top: 20px;
  text-align: center;
}

.suggest-game-toggle {
  background: transparent;
  border: none;
  color: var(--color-warm-gray);
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font-body);
  padding: 8px 16px;
  transition: color 0.15s ease;
}

.suggest-game-toggle:hover {
  color: var(--color-amber);
}

.suggest-game-form {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.suggest-game-input {
  max-width: 260px;
  font-size: 14px;
  margin-bottom: 0;
}

.suggest-game-submit {
  min-width: 140px;
  font-size: 13px;
  padding: 10px 20px;
}

.suggest-game-thanks {
  font-size: 12px;
  color: var(--color-green);
  font-weight: 500;
}

/* ===== Share Screen ===== */
.share-heading {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-charcoal);
  margin-bottom: 24px;
  line-height: 1.4;
}

.share-hint {
  font-size: 12px;
  color: var(--color-warm-gray);
  margin-top: 16px;
}

/* ===== Game Screen ===== */
#game-page {
  background: var(--color-charcoal);
  display: flex;
  flex-direction: column;
}

.game-container {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
  padding: 0 4px;
  padding-left: max(4px, env(safe-area-inset-left));
  padding-right: max(4px, env(safe-area-inset-right));
  padding-bottom: env(safe-area-inset-bottom);
}

/* Top Bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px;
  padding-top: max(12px, env(safe-area-inset-top));
  height: auto;
  min-height: 48px;
}

.name-pill {
  background: var(--color-amber);
  color: var(--color-charcoal);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 999px;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.turn-indicator {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-cream);
  text-align: center;
  transition: color 0.3s ease, opacity 0.3s ease;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.turn-indicator.your-turn {
  color: var(--color-green);
}

.turn-indicator.check {
  color: var(--color-coral);
  animation: pulse 1.5s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.settings-btn {
  background: none;
  border: none;
  color: var(--color-cream);
  cursor: pointer;
  position: relative;
  padding: 10px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: rgba(212, 162, 78, 0.2);
}

.badge {
  position: absolute;
  top: -2px;
  right: -4px;
  background: var(--color-coral);
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-card);
}

/* ===== Board Area ===== */
.board-area {
  width: min(92vw, calc(100dvh - 220px), 560px);
  height: min(92vw, calc(100dvh - 220px), 560px);
  margin: 0 auto;
  position: relative;
}

.chess-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  width: 100%;
  height: 100%;
  border-radius: 4px;
  overflow: hidden;
}

.square {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

.square.light {
  background: var(--color-board-light);
}

.square.dark {
  background: var(--color-board-dark);
}

.square.selected {
  background: var(--color-amber) !important;
  opacity: 0.8;
}

.square.last-move {
  background: var(--color-highlight) !important;
}

.square.check {
  background: radial-gradient(circle, #e74c3c 0%, transparent 70%) !important;
}

/* Piece images */
.square img {
  width: 85%;
  height: 85%;
  object-fit: contain;
  pointer-events: none;
  transition: transform 0.2s ease-out;
}

/* Valid move dot */
.move-dot {
  width: 28%;
  height: 28%;
  border-radius: 50%;
  background: rgba(212, 162, 78, 0.3);
  position: absolute;
}

/* Capture indicator */
.capture-ring {
  width: 85%;
  height: 85%;
  border-radius: 50%;
  border: 3px solid rgba(212, 162, 78, 0.4);
  position: absolute;
}

/* Coordinate labels */
.coord-file, .coord-rank {
  position: absolute;
  font-size: 9px;
  font-weight: 500;
  pointer-events: none;
  opacity: 0.6;
}

.coord-file {
  bottom: 1px;
  right: 3px;
}

.coord-rank {
  top: 1px;
  left: 3px;
}

.square.light .coord-file,
.square.light .coord-rank {
  color: var(--color-board-dark);
}

.square.dark .coord-file,
.square.dark .coord-rank {
  color: var(--color-board-light);
}

/* ===== Reaction Picker Toast (floats in after moves) ===== */
.reaction-picker {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: var(--color-card);
  border: 1px solid rgba(212, 162, 78, 0.2);
  border-radius: 28px;
  z-index: 140;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: pickerSlideUp 0.35s ease-out;
}

.reaction-picker.hiding {
  animation: pickerSlideDown 0.3s ease-in forwards;
}

@keyframes pickerSlideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(24px) scale(0.9); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

@keyframes pickerSlideDown {
  from { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  to   { opacity: 0; transform: translateX(-50%) translateY(16px) scale(0.9); }
}

.reaction-pick {
  background: transparent;
  border: 1.5px solid transparent;
  border-radius: 12px;
  font-size: 24px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.reaction-pick:active {
  transform: scale(1.35);
  background: rgba(212, 162, 78, 0.15);
}

/* ===== Inline Note (visible text under move row) ===== */
.move-note {
  display: flex;
  align-items: center;
  padding: 2px 8px 4px 32px;
  font-size: 12px;
  color: var(--color-cream);
  font-family: var(--font-body);
  line-height: 1.4;
  opacity: 0.95;
}

.move-note .note-sender {
  color: var(--color-amber);
  font-weight: 500;
  margin-right: 6px;
  font-size: 11px;
  flex-shrink: 0;
}

.move-note .note-text {
  color: #fff;
}

/* Inline note input (appears on your latest move) */
.move-note-input-row {
  display: flex;
  align-items: center;
  padding: 2px 8px 4px 32px;
  gap: 6px;
  animation: noteSlideIn 0.25s ease-out;
}

@keyframes noteSlideIn {
  from { opacity: 0; transform: translateY(-4px); max-height: 0; }
  to { opacity: 1; transform: translateY(0); max-height: 40px; }
}

.move-note-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #fff;
  font-size: 16px; /* 16px prevents iOS Safari auto-zoom on focus */
  font-family: var(--font-body);
  padding: 5px 10px;
  outline: none;
  transition: border-color 0.15s ease;
}

.move-note-input:focus {
  border-color: var(--color-amber);
}

.move-note-input::placeholder {
  color: var(--color-warm-gray);
  font-size: 11px;
}

.move-note-send {
  background: var(--color-amber);
  border: none;
  color: var(--color-charcoal);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.1s ease, opacity 0.1s ease;
}

.move-note-send:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.move-note-send:active:not(:disabled) {
  transform: scale(0.9);
}

/* ===== Inline Reaction (appears like a chat message) ===== */
.move-reaction-row {
  display: flex;
  align-items: center;
  padding: 1px 8px 3px 32px;
  font-size: 18px;
  gap: 6px;
}

.move-reaction-row .reaction-sender {
  font-size: 11px;
  color: var(--color-warm-gray);
  font-family: var(--font-body);
}

/* ===== Reaction Toast (center, float bottom to top) ===== */
.reaction-toast {
  position: fixed;
  left: 50%;
  bottom: 120px;
  transform: translateX(-50%);
  z-index: 160;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}

.reaction-toast-item {
  font-size: 56px;
  animation: emojiFloatUp 2s ease-out forwards;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}

@keyframes emojiFloatUp {
  0% {
    opacity: 0;
    transform: scale(0.3) translateY(0);
  }
  15% {
    opacity: 1;
    transform: scale(1.2) translateY(-20px);
  }
  30% {
    transform: scale(1) translateY(-60px);
  }
  70% {
    opacity: 1;
    transform: scale(1) translateY(-180px);
  }
  100% {
    opacity: 0;
    transform: scale(0.7) translateY(-300px);
  }
}

/* ===== Moves Tracker ===== */
.moves-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 8px 8px;
  min-height: 0;
}

.moves-header {
  font-size: 10px;
  font-weight: 500;
  color: var(--color-warm-gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  padding-left: 4px;
}

.moves-list {
  flex: 1;
  overflow-y: auto;
  max-height: 140px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.move-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-cream);
  background: var(--color-card);
}

.move-row:first-child {
  background: rgba(212, 162, 78, 0.08);
}

.move-number {
  color: var(--color-warm-gray);
  min-width: 20px;
}

.move-san {
  color: var(--color-cream);
}

.move-san--black {
  color: var(--color-gold-light);
}

/* Inline note (next to move on same line) */
.move-inline-note {
  margin-left: 6px;
  font-size: 10px;
  color: rgba(245, 230, 200, 0.6);
  font-family: var(--font-body);
  font-style: italic;
}

/* Inline reaction (next to move on same line) */
.move-inline-reaction {
  font-size: 14px;
  margin-left: 4px;
  flex-shrink: 0;
}

/* ===== Request Banner ===== */
.request-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: var(--color-card);
  border-bottom: 1px solid rgba(212, 162, 78, 0.2);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  animation: bannerSlide 0.3s ease-out;
}

@keyframes bannerSlide {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

.request-banner-text {
  font-size: 13px;
  color: var(--color-cream);
  flex: 1;
  line-height: 1.4;
}

.request-banner-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.btn-small {
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  cursor: pointer;
  font-family: var(--font-body);
}

.btn-accept {
  background: var(--color-amber);
  color: var(--color-charcoal);
}

.btn-decline {
  background: rgba(255,255,255,0.1);
  color: var(--color-warm-gray);
}

/* ===== Settings Panel (Slide-over) ===== */
.settings-panel {
  position: fixed;
  inset: 0;
  z-index: 200;
}

.settings-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.settings-sheet {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(340px, 85vw);
  background: var(--color-charcoal);
  overflow-y: auto;
  padding: 0;
  animation: sheetSlideIn 0.25s ease-out;
}

@keyframes sheetSlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.settings-sheet.closing {
  animation: sheetSlideOut 0.2s ease-in forwards;
}

@keyframes sheetSlideOut {
  from { transform: translateX(0); }
  to { transform: translateX(100%); }
}

.settings-backdrop.closing {
  animation: backdropFadeOut 0.2s ease-in forwards;
}

@keyframes backdropFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.settings-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-cream);
}

.settings-close {
  background: none;
  border: none;
  color: var(--color-warm-gray);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

/* Score */
.settings-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px 16px 4px;
}

.score-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-cream);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--color-amber);
  font-family: var(--font-mono);
  letter-spacing: 2px;
}

.settings-started {
  text-align: center;
  font-size: 11px;
  color: var(--color-warm-gray);
  padding: 4px 16px 16px;
}

/* Action buttons */
.settings-actions {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
}

.btn-outline {
  flex: 1;
  padding: 10px 8px;
  border: 1.5px solid rgba(212, 162, 78, 0.3);
  border-radius: 10px;
  background: transparent;
  color: var(--color-amber);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-outline:hover {
  background: rgba(212, 162, 78, 0.08);
  border-color: var(--color-amber);
}

.btn-outline:active {
  transform: scale(0.97);
}

/* Change Game Picker */
.change-game-picker {
  padding: 0 16px 12px;
}

.change-game-label {
  font-size: 12px;
  color: var(--color-warm-gray);
  margin-bottom: 8px;
}

.change-game-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.change-game-opt {
  padding: 10px 14px;
  background: var(--color-card);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  color: var(--color-cream);
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  transition: border-color 0.15s ease;
}

.change-game-opt:hover:not(:disabled) {
  border-color: var(--color-amber);
}

.change-game-opt:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.change-game-opt small {
  font-size: 10px;
  color: var(--color-warm-gray);
  margin-left: 4px;
}

/* Pending request status */
.settings-pending {
  padding: 0 16px 12px;
}

.settings-pending-text {
  font-size: 12px;
  color: var(--color-warm-gray);
  font-style: italic;
  background: rgba(212, 162, 78, 0.06);
  border-radius: 8px;
  padding: 8px 12px;
  text-align: center;
}

/* Divider */
.settings-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 4px 16px 12px;
}

/* Games List */
.settings-games-section {
  padding: 0 16px 24px;
}

.settings-games-title {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-warm-gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.settings-games-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-games-loading {
  font-size: 12px;
  color: var(--color-warm-gray);
  text-align: center;
  padding: 12px;
}

.game-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--color-card);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
  border: 1px solid transparent;
}

.game-list-item:hover {
  background: rgba(212, 162, 78, 0.06);
}

.game-list-item.current-game {
  border-color: rgba(212, 162, 78, 0.2);
}

.game-list-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.game-list-info {
  flex: 1;
  min-width: 0;
}

.game-list-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-cream);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-list-status {
  font-size: 11px;
  color: var(--color-warm-gray);
}

.game-list-turn {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-green);
}

.game-list-no-games {
  font-size: 12px;
  color: var(--color-warm-gray);
  text-align: center;
  padding: 16px;
  font-style: italic;
}

/* ===== Claim / Who Are You Screen ===== */
.claim-subtext {
  font-size: 13px;
  color: var(--color-warm-gray);
  margin-bottom: 24px;
  line-height: 1.5;
}

.claim-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 260px;
}

.claim-btn {
  width: 100%;
  font-size: 16px;
  padding: 14px 24px;
}

.claim-warning {
  font-size: 11px;
  color: var(--color-warm-gray);
  margin-top: 20px;
  opacity: 0.7;
}

/* ===== System Event in Moves List ===== */
.move-system-event {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  font-size: 11px;
  color: var(--color-warm-gray);
  font-family: var(--font-body);
  font-style: italic;
  opacity: 0.7;
}

.move-system-divider {
  height: 1px;
  background: rgba(212, 162, 78, 0.1);
  margin: 6px 0;
}

/* ===== Modals ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.modal-card {
  position: relative;
  background: var(--color-card);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  max-width: 320px;
  width: 90%;
}

/* Promotion picker */
.promotion-picker {
  position: relative;
  display: flex;
  gap: 8px;
  background: var(--color-card);
  padding: 16px;
  border-radius: 12px;
}

.promotion-piece {
  width: 60px;
  height: 60px;
  border: 2px solid var(--color-warm-gray);
  border-radius: 8px;
  background: var(--color-charcoal);
  color: var(--color-cream);
  font-size: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.1s, transform 0.1s;
}

.promotion-piece:hover {
  border-color: var(--color-amber);
}

.promotion-piece:active {
  transform: scale(0.95);
}

/* Game Over */
.gameover-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.gameover-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-cream);
  margin-bottom: 8px;
}

.gameover-message {
  font-size: 13px;
  color: var(--color-warm-gray);
  margin-bottom: 24px;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-card);
  color: var(--color-cream);
  padding: 8px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid rgba(212, 162, 78, 0.2);
  z-index: 200;
  animation: toastIn 0.3s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== Join Page ===== */
#join-page {
  background: var(--color-cream);
}

/* ===== Error Page ===== */
#error-page {
  background: var(--color-cream);
}

/* ===== Share Page ===== */
#share-page {
  background: var(--color-cream);
}

/* ===== Name Page ===== */
#name-page {
  background: var(--color-cream);
}

/* ===== Picker Page ===== */
#picker-page {
  background: var(--color-cream);
}

/* ===== Loading Overlay (branded pulse animation) ===== */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--color-charcoal);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.loading-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-warm-gray);
  letter-spacing: 0.5px;
}

@keyframes pulseSend {
  0%   { offset-distance: 0%; opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}

/* ===== Loading state (legacy) ===== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  background: var(--color-charcoal);
  color: var(--color-warm-gray);
  font-size: 13px;
}

/* ===== Button loading state ===== */
.btn.is-loading {
  pointer-events: none;
  opacity: 0.6;
  position: relative;
}

.btn.is-loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid rgba(26, 26, 46, 0.2);
  border-top-color: var(--color-charcoal);
  border-radius: 50%;
  animation: btnSpin 0.6s linear infinite;
  margin-left: 8px;
}

@keyframes btnSpin {
  to { transform: rotate(360deg); }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== Scrollbar ===== */
.moves-list::-webkit-scrollbar {
  width: 4px;
}

.moves-list::-webkit-scrollbar-track {
  background: transparent;
}

.moves-list::-webkit-scrollbar-thumb {
  background: var(--color-warm-gray);
  border-radius: 2px;
}

/* ===== Notification Prompt Modal ===== */

.notif-card {
  text-align: center;
  padding: 32px 24px;
}

.notif-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.notif-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-cream);
  margin-bottom: 8px;
}

.notif-message {
  font-size: 14px;
  color: var(--color-warm-gray);
  margin-bottom: 24px;
  line-height: 1.5;
}

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--color-warm-gray);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 10px 20px;
  font-family: var(--font-primary);
  margin-top: 8px;
}

.btn-ghost:active {
  opacity: 0.7;
}

/* ===== Install / Add to Home Screen Prompt ===== */

.install-card {
  text-align: center;
  padding: 32px 24px;
}

.install-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 16px;
}

.install-icon .logo-dot {
  width: 18px;
  height: 18px;
}

.install-icon .logo-path {
  font-size: 22px;
}

.install-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-cream);
  margin-bottom: 8px;
}

.install-message {
  font-size: 14px;
  color: var(--color-warm-gray);
  margin-bottom: 24px;
  line-height: 1.5;
}

.install-ios {
  background: rgba(245, 230, 200, 0.08);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.install-step {
  font-size: 14px;
  color: var(--color-cream);
  line-height: 1.6;
}

.install-step strong {
  color: var(--color-amber);
}

.install-share-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin: 0 2px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23D4A24E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8'/%3E%3Cpolyline points='16 6 12 2 8 6'/%3E%3Cline x1='12' y1='2' x2='12' y2='15'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  font-size: 0;
}

/* ============================================================ */
/* ===== MEMORY LANE STYLES ===== */
/* ============================================================ */

.ml-board {
  height: auto !important;
  width: 100% !important;
  max-width: 560px;
  padding: 0 8px;
}

/* Create Screen */
.ml-create, .ml-guess, .ml-reveal, .ml-waiting {
  padding: 8px 0;
}

.ml-step-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-amber);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 16px 0 6px;
}

.ml-step-label:first-child { margin-top: 4px; }

.ml-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-amber);
  color: var(--color-charcoal);
  font-size: 10px;
  font-weight: 700;
  margin-right: 6px;
}

.ml-step-hint {
  font-size: 11px;
  color: var(--color-warm-gray);
  font-style: italic;
  margin-bottom: 8px;
}

.ml-encourage {
  font-size: 10px;
  color: rgba(212, 162, 78, 0.4);
  font-style: italic;
  margin-bottom: 12px;
}

/* Category Grid */
.ml-cat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.ml-cat-card {
  background: var(--color-card);
  border: 1.5px solid rgba(245, 230, 200, 0.08);
  border-radius: 10px;
  padding: 12px 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  font-family: var(--font-body);
}

.ml-cat-card:hover { border-color: rgba(212, 162, 78, 0.3); }
.ml-cat-card.selected {
  border-color: var(--color-amber);
  background: rgba(212, 162, 78, 0.06);
}

.ml-cat-icon { font-size: 22px; display: block; margin-bottom: 2px; }
.ml-cat-name { font-size: 12px; color: var(--color-cream); font-weight: 500; }

/* Inputs */
.ml-input {
  width: 100%;
  background: rgba(245, 230, 200, 0.04);
  border: 1px solid rgba(245, 230, 200, 0.1);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--color-cream);
  font-size: 16px;
  font-family: var(--font-body);
  outline: none;
  margin-bottom: 12px;
  transition: border-color 0.15s ease;
}

.ml-input:focus { border-color: var(--color-amber); }
.ml-input::placeholder { color: var(--color-warm-gray); }

.ml-textarea {
  width: 100%;
  background: rgba(245, 230, 200, 0.04);
  border: 1px solid rgba(245, 230, 200, 0.1);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--color-cream);
  font-size: 16px;
  font-family: var(--font-body);
  outline: none;
  resize: none;
  line-height: 1.5;
  height: 72px;
  margin-bottom: 4px;
  transition: border-color 0.15s ease;
}

.ml-textarea:focus { border-color: var(--color-amber); }
.ml-textarea::placeholder { color: var(--color-warm-gray); }

/* Draw Prompt */
.ml-draw-prompt {
  background: var(--color-card);
  border-radius: 10px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 1.5px dashed rgba(245, 230, 200, 0.1);
  margin-bottom: 14px;
  cursor: pointer;
}

.ml-draw-text { font-size: 13px; color: var(--color-cream); font-weight: 500; }
.ml-draw-or { font-size: 10px; color: rgba(122, 107, 79, 0.5); }
.ml-upload-label { font-size: 13px; color: var(--color-amber); font-weight: 500; cursor: pointer; }
.ml-draw-ai-hint { font-size: 10px; color: var(--color-warm-gray); font-style: italic; }

/* Sketch Preview */
.ml-sketch-preview {
  background: var(--color-card);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 14px;
  text-align: center;
}

.ml-sketch-img {
  max-width: 100%;
  max-height: 180px;
  border-radius: 8px;
  margin-bottom: 8px;
}

.ml-btn-small {
  background: transparent;
  border: 1px solid rgba(212, 162, 78, 0.25);
  color: var(--color-amber);
  font-size: 12px;
  padding: 5px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-body);
}

/* Primary & Secondary Buttons */
.ml-btn-primary {
  width: 100%;
  padding: 12px;
  border-radius: 999px;
  background: var(--color-amber);
  color: var(--color-charcoal);
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  margin-top: 8px;
  transition: opacity 0.1s ease;
}

.ml-btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.ml-btn-primary:active:not(:disabled) { transform: scale(0.98); }

.ml-btn-secondary {
  flex: 1;
  padding: 10px;
  border-radius: 999px;
  background: transparent;
  color: var(--color-amber);
  border: 1.5px solid rgba(212, 162, 78, 0.25);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-body);
}

/* Guessing Screen */
.ml-sketch-display {
  background: linear-gradient(135deg, #1a1a2e, #1e1e38);
  border-radius: 12px;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 12px;
  overflow: hidden;
  width: 100%;
}

.ml-sketch-display svg { max-width: 95%; max-height: 230px; }
.ml-sketch-full { max-width: 95%; max-height: 230px; border-radius: 8px; }

.ml-sketch-tag {
  position: absolute;
  bottom: 6px;
  right: 8px;
  background: rgba(22, 22, 48, 0.85);
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 9px;
  color: var(--color-warm-gray);
}

.ml-sketch-label {
  font-size: 10px;
  color: var(--color-warm-gray);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
  text-align: center;
}

/* Category Badge */
.ml-cat-badge-wrap { text-align: center; margin-bottom: 8px; }

.ml-cat-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.ml-cat-person { background: rgba(212, 162, 78, 0.12); color: var(--color-amber); }
.ml-cat-place { background: rgba(76, 175, 125, 0.12); color: var(--color-green); }
.ml-cat-food { background: rgba(224, 122, 95, 0.12); color: var(--color-coral); }
.ml-cat-custom { background: rgba(91, 123, 165, 0.12); color: var(--color-blue); }

.ml-custom-cat-input {
  margin-top: -4px;
  margin-bottom: 12px;
  font-size: 14px;
}

/* Letter Blanks */
.ml-blanks {
  display: flex;
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 14px 0;
}

.ml-blank {
  width: 28px;
  height: 36px;
  background: rgba(245, 230, 200, 0.04);
  border: 1.5px solid rgba(245, 230, 200, 0.12);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-cream);
  font-family: var(--font-mono);
  transition: border-color 0.15s ease;
}

.ml-blank-space {
  border: none;
  background: none;
  width: 10px;
}

.ml-blank-filled {
  border-color: rgba(212, 162, 78, 0.4);
  background: rgba(212, 162, 78, 0.06);
}

.ml-blank-hint {
  color: var(--color-amber);
  border-color: var(--color-amber);
  background: rgba(212, 162, 78, 0.1);
}

.ml-guess-input {
  text-align: center;
  font-size: 16px;
  letter-spacing: 1px;
}

/* Wrong guess attempts */
.ml-attempts {
  margin: 8px 0 4px;
  padding: 8px 12px;
  background: rgba(224, 122, 95, 0.04);
  border-radius: 8px;
  border: 1px solid rgba(224, 122, 95, 0.1);
}

.ml-attempt-row {
  font-size: 13px;
  color: var(--color-coral);
  padding: 3px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ml-attempt-x {
  font-weight: 600;
  font-size: 12px;
}

.ml-attempt-guess {
  color: var(--color-cream);
  opacity: 0.7;
}

.ml-attempts-remaining {
  font-size: 11px;
  color: var(--color-warm-gray);
  margin-top: 4px;
  font-style: italic;
}

.ml-reveal-attempts {
  margin: 6px 0;
}

.ml-reveal-attempts .ml-reveal-wrong {
  font-size: 12px;
  margin: 2px 0;
}

/* Tries remaining text */
.ml-tries-left {
  text-align: center;
  font-size: 11px;
  color: var(--color-coral);
  font-weight: 500;
  margin: 6px 0;
  opacity: 0.8;
}

/* Floating red X animation */
.ml-float-x {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  animation: floatXFade 2s ease-out forwards;
}

.ml-float-x-icon {
  font-size: 96px;
  color: var(--color-coral);
  font-weight: 700;
  animation: floatXPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  filter: drop-shadow(0 4px 20px rgba(224, 122, 95, 0.5));
}

.ml-float-x-text {
  font-size: 16px;
  color: var(--color-coral);
  font-weight: 600;
  margin-top: 8px;
  font-family: var(--font-body);
  animation: floatXSlide 0.5s ease-out 0.2s both;
}

@keyframes floatXPop {
  0% { transform: scale(0) rotate(-20deg); opacity: 0; }
  60% { transform: scale(1.2) rotate(5deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

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

@keyframes floatXFade {
  0%, 60% { opacity: 1; }
  100% { opacity: 0; }
}

/* Action Buttons */
.ml-actions {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}

.ml-hint-btn, .ml-giveup-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-body);
  border: none;
}

.ml-hint-btn {
  color: var(--color-amber);
  background: rgba(212, 162, 78, 0.06);
  border: 1px solid rgba(212, 162, 78, 0.15);
}

.ml-hint-btn.used { opacity: 0.4; }
.ml-hint-btn:disabled { cursor: not-allowed; }

.ml-giveup-btn {
  color: var(--color-coral);
  background: rgba(224, 122, 95, 0.06);
  border: 1px solid rgba(224, 122, 95, 0.12);
}

.ml-giveup-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Reveal Screen */
.ml-reveal { text-align: center; }

.ml-result-badge {
  display: inline-block;
  padding: 5px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

.ml-result-correct { background: rgba(76, 175, 125, 0.12); color: var(--color-green); }
.ml-result-wrong { background: rgba(224, 122, 95, 0.12); color: var(--color-coral); }
.ml-result-gaveup { background: rgba(122, 107, 79, 0.12); color: var(--color-warm-gray); }

.ml-reveal-card {
  background: var(--color-card);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  margin-bottom: 12px;
}

.ml-reveal-answer {
  font-size: 22px;
  font-weight: 600;
  color: var(--color-amber);
  margin: 8px 0;
}

.ml-reveal-wrong {
  font-size: 11px;
  color: var(--color-coral);
  margin: 4px 0;
}

.ml-reveal-memory {
  font-size: 13px;
  color: var(--color-cream);
  font-style: italic;
  margin-top: 10px;
  line-height: 1.5;
}

.ml-reveal-sketch {
  margin-top: 12px;
  background: linear-gradient(135deg, #1a1a2e, #1e1e38);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ml-reveal-sketch svg { max-width: 80%; max-height: 120px; }
.ml-reveal-sketch img { max-width: 80%; max-height: 120px; border-radius: 6px; }

/* Waiting Screen */
.ml-waiting {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  gap: 12px;
}

.ml-wait-text {
  font-size: 13px;
  color: var(--color-warm-gray);
  text-align: center;
  font-weight: 500;
}

.ml-online-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  color: var(--color-green);
  font-weight: 500;
  margin-top: 8px;
}

.ml-online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-green);
  animation: onlinePulse 2s ease-in-out infinite;
}

@keyframes onlinePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(76, 175, 125, 0.4); }
  50% { opacity: 0.8; box-shadow: 0 0 0 4px rgba(76, 175, 125, 0); }
}

/* Drawing Canvas */
.ml-canvas-wrap { padding: 4px 0; }

.ml-canvas-area {
  background: var(--color-card);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
}

.ml-canvas {
  width: 100%;
  height: auto;
  display: block;
  touch-action: none;
  aspect-ratio: 3 / 2;
}

.ml-toolbar {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 8px 10px;
  background: #0F0F1E;
  border-top: 1px solid rgba(245, 230, 200, 0.04);
  flex-wrap: wrap;
}

.ml-tool {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1.5px solid transparent;
  background: none;
  color: var(--color-cream);
}

.ml-tool.selected {
  border-color: var(--color-amber);
  background: rgba(212, 162, 78, 0.08);
  color: var(--color-amber);
}

.ml-tool-divider {
  width: 1px;
  height: 20px;
  background: rgba(245, 230, 200, 0.06);
  margin: 0 3px;
}

.ml-color-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
}

.ml-color-dot.selected { border-color: var(--color-cream); }

.ml-size-slider {
  width: 48px;
  height: 4px;
  border-radius: 2px;
  background: rgba(245, 230, 200, 0.1);
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}

.ml-size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-amber);
  cursor: pointer;
}

.ml-canvas-btns {
  display: flex;
  gap: 8px;
}

.ml-canvas-btns .ml-btn-secondary,
.ml-canvas-btns .ml-btn-primary {
  flex: 1;
  margin-top: 0;
}

/* ============================================================ */
/* ===== REACTION STYLES ===== */
/* ============================================================ */

.rx-board {
  height: auto !important;
  width: 100% !important;
  max-width: 560px;
  padding: 4px;
}

.rx-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  width: min(92vw, 400px);
  margin: 0 auto;
  position: relative;
}

.rx-cell {
  aspect-ratio: 1;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 230, 200, 0.05);
  border: 1px solid rgba(245, 230, 200, 0.03);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  position: relative;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

.rx-cell:active { transform: scale(0.95); }

/* Owner tints */
.rx-owner-amber {
  background: rgba(212, 162, 78, 0.18);
  border-color: rgba(212, 162, 78, 0.28);
}

.rx-owner-cream {
  background: rgba(245, 230, 200, 0.16);
  border-color: rgba(245, 230, 200, 0.25);
}

/* Muted cells (not your turn — opponent's orbs, dimmed) */
.rx-owner-muted {
  background: rgba(245, 230, 200, 0.04);
  border-color: rgba(245, 230, 200, 0.06);
}

.rx-owner-muted .rx-orb {
  opacity: 0.5;
}

/* Hot cells (3 orbs — about to blow) */
.rx-owner-amber.rx-hot {
  background: rgba(212, 162, 78, 0.30);
  border-color: rgba(212, 162, 78, 0.45);
  animation: rxPulseAmber 1.5s ease-in-out infinite;
}

.rx-owner-cream.rx-hot {
  background: rgba(245, 230, 200, 0.25);
  border-color: rgba(245, 230, 200, 0.4);
  animation: rxPulseCream 1.5s ease-in-out infinite;
}

@keyframes rxPulseAmber {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 8px rgba(212, 162, 78, 0.3); }
}

@keyframes rxPulseCream {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 8px rgba(245, 230, 200, 0.3); }
}

/* Your cells on your turn — interactive highlight */
.rx-mine { cursor: pointer; }
.rx-mine:hover { filter: brightness(1.15); }

/* Last move */
.rx-last-move {
  box-shadow: 0 0 0 2px rgba(212, 162, 78, 0.5);
}

/* ===== Orbs ===== */
.rx-orb {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex-wrap: wrap;
  width: 36px;
  height: 36px;
  padding: 4px;
  transition: transform 0.12s ease, background 0.15s ease;
}

.rx-orb-white { background: #D4A24E; }
.rx-orb-black { background: #F5E6C8; }

/* Dots */
.rx-dot { border-radius: 50%; }
.rx-dot-w { background: rgba(255, 255, 255, 0.85); }
.rx-dot-c {
  background: rgba(26, 26, 46, 0.35);
  border: 1px solid rgba(26, 26, 46, 0.15);
}

/* Dot sizes based on count */
.rx-dots-1 .rx-dot { width: 8px; height: 8px; }
.rx-dots-2 .rx-dot { width: 6px; height: 6px; }
.rx-dots-3 .rx-dot { width: 5px; height: 5px; }

/* ===== Explosion Animations ===== */

/* Stage 2: Shake */
.rx-shake {
  animation: rxShake 0.2s ease-in-out;
}

@keyframes rxShake {
  0% { transform: scale(1); }
  20% { transform: scale(1.08); }
  40% { transform: scale(0.95); }
  60% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Stage 3: Burst */
.rx-burst {
  animation: rxBurst 0.15s ease-out forwards;
}

@keyframes rxBurst {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* Stage 4: Ghost orbs flying */
.rx-ghost {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  z-index: 10;
  pointer-events: none;
}

.rx-fly {
  animation: rxFly 0.2s ease-out forwards;
}

@keyframes rxFly {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0.7); opacity: 0.8; }
}

.rx-fly-out {
  animation: rxFlyOut 0.25s ease-out forwards;
}

@keyframes rxFlyOut {
  0% { transform: translate(0, 0) scale(1); opacity: 0.8; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0.3); opacity: 0; }
}

/* Stage 5: Land flash */
.rx-land-flash {
  animation: rxLandFlash 0.3s ease-out;
}

@keyframes rxLandFlash {
  0% { filter: brightness(1.8); }
  100% { filter: brightness(1); }
}

/* Opening hint */
.rx-hint {
  text-align: center;
  font-size: 12px;
  color: var(--color-warm-gray);
  padding: 8px 0;
  font-style: italic;
}

/* Responsive orb sizing */
@media (max-width: 360px) {
  .rx-orb { width: 28px; height: 28px; padding: 3px; gap: 2px; }
  .rx-dots-1 .rx-dot { width: 7px; height: 7px; }
  .rx-dots-2 .rx-dot { width: 5px; height: 5px; }
  .rx-dots-3 .rx-dot { width: 4px; height: 4px; }
}
