/* ═══════════════════════════════════════════════════════════
   NARDEXX — UI Design System + Mobile Fullscreen + Perf
   ═══════════════════════════════════════════════════════════ */

:root {
  --c-bg-0: #0a0503;
  --c-bg-1: #150a05;
  --c-bg-2: #1a0f08;
  --c-bg-card: rgba(40, 20, 10, 0.92);
  --c-bg-card-2: rgba(15, 8, 4, 0.96);
  --c-gold: #f0d18c;
  --c-gold-bright: #f5dfa0;
  --c-gold-soft: rgba(240, 209, 140, 0.35);
  --c-gold-line: rgba(240, 209, 140, 0.5);
  --c-text: #f5e6c8;
  --c-text-dim: rgba(245, 230, 200, 0.62);
  --c-text-faint: rgba(245, 230, 200, 0.35);
  --c-danger: #ff6b6b;
  --c-success: #7ee07e;

  --g-primary: linear-gradient(180deg, #e09050 0%, #b06a30 45%, #7a3a18 100%);
  --g-primary-hover: linear-gradient(180deg, #f0a060 0%, #c07a40 45%, #8a4520 100%);
  --g-secondary: linear-gradient(180deg, rgba(80, 40, 18, 0.95) 0%, rgba(30, 15, 8, 0.98) 100%);
  --g-danger: linear-gradient(180deg, #a02818 0%, #601810 100%);
  --g-card: radial-gradient(ellipse at top, rgba(90, 45, 20, 0.5), transparent 70%),
            linear-gradient(180deg, rgba(40, 20, 10, 0.92), rgba(15, 8, 4, 0.96));

  --sh-sm: 0 2px 6px rgba(0,0,0,0.45);
  --sh: 0 6px 18px rgba(0,0,0,0.6);
  --sh-lg: 0 20px 60px rgba(0,0,0,0.85);
  --glow: 0 0 20px rgba(240, 209, 140, 0.45);
  --glow-strong: 0 0 30px rgba(240, 209, 140, 0.7);

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  --f-title: 'Cinzel', Georgia, 'Times New Roman', serif;
  --f-body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  width: 100%;
  max-width: 100vw;
  height: 100%;
  overflow: hidden;
  overflow-x: hidden;
  overscroll-behavior: none;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--f-body);
  color: var(--c-text);
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  background: #0a0503;
}

/* ═══════════════ BUTTONS ═══════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--r);
  border: 1px solid var(--c-gold-soft);
  background: var(--g-secondary);
  color: var(--c-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: transform 0.15s, filter 0.2s, box-shadow 0.25s;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  user-select: none;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), transparent 40%);
  pointer-events: none;
}
.btn > * { position: relative; z-index: 1; }
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; filter: grayscale(0.5); }

.btn-primary {
  background: var(--g-primary);
  border-color: rgba(240, 209, 140, 0.85);
  color: #fff5d0;
  box-shadow: inset 0 1px 0 rgba(255, 220, 150, 0.5), var(--sh-sm);
  text-shadow: 0 1px 2px rgba(60, 20, 0, 0.6);
}
.btn-danger {
  background: var(--g-danger);
  border-color: rgba(255, 140, 140, 0.5);
  color: #ffe0e0;
}
.btn-ghost {
  background: transparent;
  border-color: var(--c-gold-soft);
  color: var(--c-text-dim);
}
.btn-sm { padding: 8px 14px; font-size: 12px; border-radius: var(--r-sm); gap: 6px; }
.btn-lg { padding: 16px 30px; font-size: 16px; border-radius: var(--r-lg); }
.btn-xl { padding: 20px 40px; font-size: 18px; border-radius: var(--r-xl); }
.btn-block { width: 100%; }

.btn-icon {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  font-size: 17px;
  flex-shrink: 0;
  line-height: 1;
}
.btn-icon.btn-sm { width: 36px; height: 36px; font-size: 15px; }
.btn-icon.muted { opacity: 0.45; }

/* ═══════════════ TOP BAR ═══════════════ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: linear-gradient(180deg, rgba(45, 22, 10, 0.95) 0%, rgba(15, 8, 4, 0.98) 100%);
  border-bottom: 1px solid var(--c-gold-soft);
  flex-shrink: 0;
  position: relative;
  z-index: 100;
}
.topbar::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 8%; right: 8%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(240, 209, 140, 0.6), transparent);
  pointer-events: none;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-title);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--c-gold);
  text-shadow: 0 0 12px rgba(240, 209, 140, 0.45);
  cursor: pointer;
  text-decoration: none;
}
.topbar-brand .gold {
  color: #fff8e0;
  text-shadow: 0 0 14px rgba(240, 209, 140, 1), 0 0 24px rgba(240, 209, 140, 0.6);
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--c-gold-soft);
  border-radius: 999px;
  cursor: pointer;
}
.user-chip .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #f0d9ab, #8a6a35);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: #1a0a04;
  overflow: hidden;
  flex-shrink: 0;
}
.user-chip .avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-chip .info { display: flex; flex-direction: column; line-height: 1.15; }
.user-chip .name { font-size: 12px; font-weight: 700; color: var(--c-gold); }
.user-chip .coins { font-size: 10px; font-weight: 700; color: #ffe09a; }

/* ═══════════════ MODAL ═══════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  z-index: 1000;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }
.modal-box {
  background: var(--g-card);
  border: 1px solid var(--c-gold-line);
  border-radius: var(--r-xl);
  padding: 28px 26px;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--sh-lg), inset 0 1px 0 rgba(255, 220, 150, 0.15);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-overlay.show .modal-box { transform: scale(1) translateY(0); }
.modal-title {
  font-family: var(--f-title);
  font-size: 21px;
  font-weight: 700;
  color: var(--c-gold);
  text-align: center;
  letter-spacing: 2px;
  margin-bottom: 18px;
}

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label {
  font-size: 11px;
  font-weight: 700;
  color: var(--c-text-dim);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding-left: 4px;
}
.input, .select {
  width: 100%;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--c-gold-soft);
  border-radius: var(--r);
  color: var(--c-text);
  font-family: inherit;
  font-size: 14px;
  -webkit-appearance: none;
  appearance: none;
}
.input:focus, .select:focus { outline: none; border-color: var(--c-gold); }
.input::placeholder { color: var(--c-text-faint); }
.select option { background: #1a0f08; color: var(--c-text); }

.captcha-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--r);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--c-gold-soft);
}
.captcha-q {
  font-family: var(--f-title);
  font-size: 18px;
  font-weight: 800;
  color: var(--c-gold-bright);
  letter-spacing: 1.5px;
  flex-shrink: 0;
}
.captcha-row .input { flex: 1; padding: 10px 12px; text-align: center; }

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--c-gold-soft);
  border-radius: var(--r);
  margin-bottom: 18px;
}
.tabs button {
  flex: 1;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: transparent;
  border: none;
  color: var(--c-text-dim);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.tabs button.active {
  background: var(--g-primary);
  color: #fff5d0;
}

.msg {
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 12px;
  display: none;
}
.msg.show { display: block; }
.msg.err { background: rgba(255, 74, 74, 0.15); color: #ff8a8a; border: 1px solid rgba(255, 74, 74, 0.4); }
.msg.ok { background: rgba(126, 224, 126, 0.12); color: var(--c-success); border: 1px solid rgba(126, 224, 126, 0.4); }

.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translate(-50%, -20px);
  padding: 12px 22px;
  background: linear-gradient(180deg, rgba(60, 30, 12, 0.98), rgba(20, 10, 5, 0.98));
  border: 1px solid rgba(240, 209, 140, 0.6);
  border-radius: var(--r);
  color: var(--c-gold);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--sh-lg);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 2000;
  max-width: 90vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.toggle {
  position: relative;
  width: 52px;
  height: 28px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--c-gold-soft);
  cursor: pointer;
  flex-shrink: 0;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: linear-gradient(180deg, #8a6a35, #5a4020);
  transition: transform 0.3s;
}
.toggle.on {
  background: var(--g-primary);
  border-color: var(--c-gold);
}
.toggle.on::after {
  transform: translateX(24px);
  background: linear-gradient(180deg, #fff5d0, #d0b070);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--c-gold-soft);
  border-radius: var(--r);
  margin-bottom: 10px;
}
.settings-row .s-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
}
.settings-row .s-ico { font-size: 20px; }

/* ═══════════════════════════════════════════════════════════
   OVERLAY "Разверните игру" — стартовый экран для мобилы
   ═══════════════════════════════════════════════════════════ */
.fs-start-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(90, 45, 20, 0.98), rgba(10, 5, 3, 0.99));
  opacity: 0;
  transition: opacity 0.35s ease;
}
.fs-start-overlay.show { opacity: 1; }
.fs-start-box {
  max-width: 340px;
  width: 100%;
  text-align: center;
  padding: 32px 24px;
  background:
    radial-gradient(ellipse at top, rgba(90, 45, 20, 0.65), transparent 70%),
    linear-gradient(180deg, rgba(40, 20, 10, 0.95), rgba(15, 8, 4, 0.98));
  border: 1px solid var(--c-gold-line);
  border-radius: 22px;
  box-shadow: var(--sh-lg);
}
.fs-start-ico {
  font-size: 66px;
  display: inline-block;
  filter: drop-shadow(0 0 20px rgba(240, 209, 140, 0.7));
  line-height: 1;
  animation: fsIcoFloat 2.4s ease-in-out infinite;
}
@keyframes fsIcoFloat {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(-8deg) scale(1.08); }
}
.fs-start-title {
  font-family: var(--f-title);
  font-size: 22px;
  font-weight: 700;
  color: var(--c-gold);
  letter-spacing: 1.5px;
  margin: 18px 0 8px;
  text-shadow: 0 0 14px rgba(240, 209, 140, 0.4);
}
.fs-start-sub {
  font-size: 13px;
  color: var(--c-text-dim);
  margin-bottom: 22px;
  line-height: 1.5;
}
.fs-start-overlay .btn-lg {
  padding: 15px 32px;
  font-size: 16px;
  width: 100%;
  max-width: 260px;
}

/* ═══════════════════════════════════════════════════════════
   ★ ОСНОВНОЙ МОБИЛЬНЫЙ LANDSCAPE — всё компактно, всё видно ★
   ═══════════════════════════════════════════════════════════ */
@media (max-height: 600px) and (orientation: landscape) {
  html, body {
    overflow: hidden;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #0a0503;
  }

  .app {
    position: fixed;
    inset: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    height: 100vh;
    padding: 0;
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .topbar {
    padding: 3px 10px;
    min-height: 28px;
    gap: 8px;
    flex-shrink: 0;
  }
  .topbar::after { display: none; }
  .topbar-brand { font-size: 12px; letter-spacing: 1.5px; gap: 4px; }
  .topbar-brand .gold { font-size: 13px; }
  .btn-icon { width: 28px; height: 28px; font-size: 13px; }
  .btn-icon.btn-sm { width: 26px; height: 26px; font-size: 12px; }
  .user-chip { padding: 2px 8px 2px 2px; gap: 6px; }
  .user-chip .avatar { width: 20px; height: 20px; font-size: 10px; }
  .user-chip .name { font-size: 10px; }
  .user-chip .coins { font-size: 8px; }

  .board-area {
    flex: 1 1 0;
    min-height: 0;
    min-width: 0;
    padding: 2px 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .game-layout {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: center;
    gap: 4px;
    width: 100%;
    height: 100%;
    min-height: 0;
  }

  .players-column {
    width: 58px;
    flex-shrink: 0;
    gap: 3px;
    padding: 0;
    align-self: stretch;
  }
  .player-card {
    padding: 3px 2px;
    gap: 1px;
    border-radius: 6px;
    border-width: 1px;
    min-height: 0;
    overflow: hidden;
  }
  .player-card-avatar { width: 22px; height: 22px; font-size: 11px; }
  .player-card-name { font-size: 8px; letter-spacing: 0; line-height: 1.1; }
  .player-card-score { font-size: 11px; line-height: 1; }
  .player-card-status { display: none; }

  .board-frame {
    height: 100%;
    width: auto;
    max-width: none;
    max-height: 100%;
    aspect-ratio: 1.55 / 1;
    border-radius: 6px;
    align-self: center;
    flex-shrink: 1;
  }
  .numbers-group span { font-size: 6.5px; }
  .board-numbers-top { padding-top: 1px; padding-bottom: 0.5px; }
  .board-numbers-bottom { padding-top: 0.5px; padding-bottom: 1px; }
  .point .triangle { left: 1px; right: 1px; }
  .bar { min-width: 6px; }

  .tray-column {
    width: 34px;
    flex-shrink: 0;
    gap: 3px;
    padding: 0;
    align-self: stretch;
  }
  .tray { padding: 1.5px; gap: 1px; border-radius: 5px; }

  .stats-column { display: none; }

  .controls {
    flex-direction: row;
    gap: 6px;
    padding: 3px 8px;
    padding-bottom: calc(3px + env(safe-area-inset-bottom, 0px));
    flex-shrink: 0;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    z-index: 20;
    background: linear-gradient(180deg, rgba(35, 18, 8, 0.96) 0%, rgba(10, 5, 3, 0.99) 100%);
  }
  .controls::before { display: none; }

  .dice-panel {
    padding: 3px 8px;
    gap: 6px;
    min-height: 40px;
    min-width: 0;
  }
  .die { width: 26px; height: 26px; }
  .die-face { width: 26px; height: 26px; border-radius: 5px; }
  .die-front  { transform: rotateY(  0deg) translateZ(13px); }
  .die-back   { transform: rotateY(180deg) translateZ(13px); }
  .die-right  { transform: rotateY( 90deg) translateZ(13px); }
  .die-left   { transform: rotateY(-90deg) translateZ(13px); }
  .die-top    { transform: rotateX( 90deg) translateZ(13px); }
  .die-bottom { transform: rotateX(-90deg) translateZ(13px); }

  .action-buttons {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
  }
  .action-buttons .btn {
    padding: 7px 10px;
    font-size: 10px;
    gap: 3px;
    border-radius: 7px;
  }
  .action-buttons .btn .btn-ico { font-size: 11px; }
}

/* Очень маленькие экраны */
@media (max-height: 400px) and (orientation: landscape) {
  .topbar { min-height: 24px; padding: 2px 8px; }
  .topbar-brand { font-size: 11px; }
  .btn-icon { width: 24px; height: 24px; font-size: 12px; }
  .players-column { width: 50px; }
  .tray-column { width: 30px; }
  .controls { min-height: 46px; padding: 2px 6px; }
  .dice-panel { min-height: 36px; padding: 2px 6px; }
  .die { width: 22px; height: 22px; }
  .die-face { width: 22px; height: 22px; }
  .die-front  { transform: rotateY(  0deg) translateZ(11px); }
  .die-back   { transform: rotateY(180deg) translateZ(11px); }
  .die-right  { transform: rotateY( 90deg) translateZ(11px); }
  .die-left   { transform: rotateY(-90deg) translateZ(11px); }
  .die-top    { transform: rotateX( 90deg) translateZ(11px); }
  .die-bottom { transform: rotateX(-90deg) translateZ(11px); }
  .action-buttons .btn { padding: 6px 8px; font-size: 9px; }
}

/* ═══════════════════════════════════════════════════════════
   ★★★ ПРОИЗВОДИТЕЛЬНОСТЬ НА МОБИЛЬНЫХ / ТАЧ ★★★
   Убираем ВСЁ, что грузит GPU:
   - backdrop-filter
   - многослойные box-shadow
   - сложные background-image градиенты
   - бесконечные анимации
   - shine-эффекты
   ═══════════════════════════════════════════════════════════ */
@media (pointer: coarse), (hover: none), (max-width: 900px) {

  /* -- Убираем шум фона .app -- */
  .app::before { display: none !important; }
  .menu-app::before { display: none !important; animation: none !important; }

  /* -- Никаких backdrop-filter -- */
  .modal-overlay,
  .auth-overlay,
  .cup-overlay,
  .start-overlay,
  .online-top,
  .fs-start-overlay {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  /* -- Упрощаем доску: 1 простой градиент вместо 5 -- */
  .board-frame {
    background-color: #a87c4e;
    background-image: linear-gradient(135deg, #b8885a 0%, #9a6e42 100%) !important;
    box-shadow:
      inset 0 0 0 1px rgba(240, 209, 140, 0.35),
      0 4px 12px rgba(0, 0, 0, 0.7) !important;
  }
  .board {
    background: #c69055 !important;
    box-shadow: inset 0 0 0 1px rgba(80, 45, 20, 0.4) !important;
  }

  /* -- Упрощаем фишки: было 7-8 теней, стало 3 -- */
  .piece.white {
    background: radial-gradient(circle at 34% 28%,
      #fffaf0 0%, #ecd9ab 45%, #b89860 100%) !important;
    box-shadow:
      inset 0 0 0 1.5px rgba(160, 115, 60, 0.7),
      inset 0 1px 2px rgba(255, 255, 255, 0.6),
      0 1px 2px rgba(0, 0, 0, 0.6) !important;
  }
  .piece.black {
    background: radial-gradient(circle at 34% 28%,
      #4a2e18 0%, #2a1508 55%, #0a0503 100%) !important;
    box-shadow:
      inset 0 0 0 1.5px rgba(110, 80, 50, 0.6),
      inset 0 1px 2px rgba(180, 140, 90, 0.4),
      0 1px 2px rgba(0, 0, 0, 0.7) !important;
  }
  .piece::before { display: none !important; }

  /* -- Треи -- */
  .tray {
    background: linear-gradient(180deg, #1a0a04 0%, #0a0503 100%) !important;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.9) !important;
  }
  .tray-piece.white {
    background: radial-gradient(circle at 32% 26%, #fffaf0 0%, #d8c090 60%, #9a7a48 100%) !important;
    box-shadow: inset 0 0 0 1px rgba(150, 110, 60, 0.6) !important;
  }
  .tray-piece.black {
    background: radial-gradient(circle at 32% 26%, #4a2e18 0%, #1a0a04 100%) !important;
    box-shadow: inset 0 0 0 1px rgba(140, 100, 60, 0.5) !important;
  }

  /* -- Карточки игроков, статус -- */
  .player-card,
  .stat-card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5) !important;
  }

  /* -- Кнопки кубика -- */
  .dice-panel {
    background: linear-gradient(180deg, rgba(55, 28, 12, 0.95), rgba(15, 8, 3, 0.98)) !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6) !important;
  }

  /* -- Убираем ВСЕ бесконечные анимации -- */
  .point.selectable .triangle,
  .point.highlight-target .triangle,
  .tray.highlight-target,
  .btn-roll.ready,
  .menu-logo-icon,
  .menu-card,
  .fs-start-ico,
  .avatar-pop {
    animation: none !important;
  }
  .avatar-pop { animation-duration: 0.01s !important; }

  /* -- Убираем transitions там, где они тормозят -- */
  .piece { transition: none !important; }
  .btn { transition: none !important; }
  .player-card,
  .tray,
  .modal-box,
  .toggle,
  .toggle::after { transition: none !important; }

  /* -- Подсветка хода — простые цвета, без анимации -- */
  .point.selectable .triangle,
  .point.selected .triangle {
    background: rgba(144, 238, 144, 0.6) !important;
    box-shadow:
      inset 0 0 0 2px rgba(144, 238, 144, 1),
      0 0 8px rgba(144, 238, 144, 0.6) !important;
  }
  .point.highlight-target .triangle {
    background: rgba(180, 255, 180, 0.75) !important;
    box-shadow:
      inset 0 0 0 3px rgba(200, 255, 200, 1),
      0 0 12px rgba(144, 238, 144, 0.8) !important;
  }
  .tray.highlight-target {
    box-shadow:
      inset 0 0 16px rgba(144, 238, 144, 0.6),
      0 0 16px rgba(144, 238, 144, 0.8) !important;
  }
  .piece.selected {
    filter: brightness(1.25) !important;
  }

  /* -- Toast без transition -- */
  .toast { transition: none !important; }
}

/* Планшет / средний экран */
@media (max-width: 700px) {
  .modal-box { padding: 22px 18px; border-radius: var(--r-lg); }
  .modal-title { font-size: 18px; }
}
/* ═══════════════════════════════════════════════════════════
   МГНОВЕННЫЙ ОТКЛИК ПОДСВЕТКИ ХОДОВ
   Убираем transition 0.25s на треугольниках — с ним подсветка
   "проявляется" через четверть секунды, что раздражает.
   ═══════════════════════════════════════════════════════════ */
.point .triangle {
  transition: background 0.06s linear, box-shadow 0.06s linear !important;
}

@media (pointer: coarse), (hover: none), (max-width: 900px) {
  .point .triangle,
  .point.selectable .triangle,
  .point.selected .triangle,
  .point.highlight-target .triangle {
    transition: none !important;
  }
}