/* Poker Arena — CR minimal theme */
:root {
  --bg: #0a1628;
  --panel: #122640;
  --panel2: #1a3354;
  --gold: #ffc94d;
  --gold2: #e8a020;
  --blue: #3d8bfd;
  --green: #4ade80;
  --red: #f87171;
  --muted: #8fa3bf;
  --white: #f0f4fa;
  --r-common: #6eb5ff;
  --r-rare: #c084fc;
  --r-epic: #fb923c;
  --r-legend: #fde047;
  --safe: env(safe-area-inset-bottom, 0px);
}

body {
  background: #060d18 !important;
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif !important;
}

.app {
  background: linear-gradient(180deg, #0f2848 0%, #0a1628 55%, #060d18 100%) !important;
}

.top {
  height: 54px !important;
  padding: 6px 12px !important;
  background: linear-gradient(180deg, #152a45, #0a1628) !important;
  border-bottom: 1px solid rgba(255, 201, 77, 0.15) !important;
}

.screen {
  inset: 54px 0 0 0 !important;
  padding: 10px 12px calc(76px + var(--safe)) !important;
}

.header-name {
  font-size: 20px;
  font-weight: 1000;
  color: var(--white);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

.wallet-pill {
  height: 32px !important;
  padding: 0 10px !important;
  font-size: 13px !important;
  font-weight: 1000 !important;
  border-radius: 12px !important;
}

.wallet-pill .ico {
  font-size: 11px;
  font-weight: 1000;
  opacity: 0.85;
}

.wallet-pill .ico-coin { color: #ffd166; }
.wallet-pill .ico-gem { color: #7dd3fc; }
.wallet-pill .ico-trophy { color: var(--gold); }

.panel {
  border-radius: 20px !important;
  padding: 14px !important;
  background: linear-gradient(180deg, rgba(26, 51, 84, 0.95), rgba(10, 22, 40, 0.98)) !important;
  border: 1px solid rgba(255, 201, 77, 0.14) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25) !important;
}

.btn {
  min-height: 52px !important;
  font-size: 16px !important;
  border-radius: 18px !important;
}

.btn.compact-shop-btn {
  min-height: 44px !important;
  font-size: 14px !important;
}

.btn.primary {
  background: linear-gradient(180deg, #ffe082, #e8a020) !important;
  color: #2a1800 !important;
}

.btn.green {
  background: linear-gradient(180deg, #6ee7a0, #22a855) !important;
}

.primary-battle {
  height: 64px !important;
  font-size: 22px !important;
  border-radius: 20px !important;
}

.home-hero-card {
  min-height: auto !important;
  overflow: visible !important;
}

.bottom-nav {
  position: absolute !important;
  left: 12px !important;
  right: 12px !important;
  bottom: calc(10px + var(--safe)) !important;
  z-index: 200 !important;
  height: 68px !important;
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 6px !important;
  padding: 8px !important;
  border-radius: 20px !important;
  background: linear-gradient(180deg, rgba(18, 38, 64, 0.98), rgba(6, 13, 24, 0.99)) !important;
  border: 1px solid rgba(255, 201, 77, 0.28) !important;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

.nav-btn {
  border-radius: 14px !important;
  color: var(--muted) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 2px !important;
}

.screen {
  inset: 54px 0 0 0 !important;
  padding: 10px 12px calc(88px + var(--safe)) !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}

.app {
  position: relative !important;
  overflow: hidden !important;
}

.nav-btn i {
  font-size: 22px !important;
  font-style: normal;
}

.nav-btn span {
  font-size: 11px !important;
  font-weight: 1000 !important;
}

.nav-btn.active {
  background: linear-gradient(180deg, #ffe082, #e8a020) !important;
  color: #2a1800 !important;
}

.player-banner {
  padding: 12px !important;
  border-radius: 18px !important;
}

.player-title {
  font-size: 22px !important;
}

.rating-badge b {
  font-size: 22px !important;
  color: var(--gold);
}

.arena-card {
  min-height: 150px !important;
  border-radius: 20px !important;
  background: linear-gradient(160deg, #1e4a7a, #0a1628 78%) !important;
}

.arena-title {
  font-size: 24px !important;
}

.arena-desc,
.player-sub,
.muted {
  font-size: 12px !important;
}

.mode-chip {
  min-height: 44px !important;
  font-size: 13px !important;
}

.cr-tile {
  padding: 16px !important;
  border-radius: 18px !important;
}

.cr-tile-body b {
  font-size: 18px !important;
}

.screen-title,
.deck-title {
  font-size: 22px !important;
}

.deck-sub {
  display: none !important;
}

.sigil-card {
  min-height: 150px !important;
  border-width: 2px !important;
  border-style: solid !important;
  position: relative;
  overflow: hidden;
}

.sigil-card.locked,
.sigil-card.arena-locked {
  cursor: not-allowed;
}

.sigil-card.locked {
  filter: grayscale(0.9) brightness(0.45) contrast(0.95);
  opacity: 0.72;
}

.sigil-card.locked::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    rgba(0, 0, 0, 0.12) 0 6px,
    rgba(0, 0, 0, 0.28) 6px 12px
  );
  pointer-events: none;
  z-index: 2;
}

.sigil-card.arena-locked {
  filter: grayscale(0.55) brightness(0.62) saturate(0.75);
  opacity: 0.82;
}

.sigil-card.arena-locked::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 8, 24, 0.15), rgba(0, 8, 24, 0.55));
  pointer-events: none;
  z-index: 2;
}

.sigil-lock-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(2, 10, 28, 0.55);
  backdrop-filter: blur(1px);
  pointer-events: none;
  text-align: center;
  padding: 8px;
}

.sigil-lock-overlay.arena {
  background: rgba(8, 20, 48, 0.48);
}

.sigil-lock-overlay .sigil-lock-icon {
  font-size: 26px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px #0008);
}

.sigil-lock-overlay small {
  font-size: 10px;
  font-weight: 1000;
  color: #ffeaa0;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.deck-slot.unavailable {
  filter: grayscale(0.7) brightness(0.55);
  border-color: rgba(255, 100, 100, 0.45) !important;
}

.deck-slot-warn {
  position: absolute;
  bottom: 4px;
  left: 4px;
  right: 4px;
  font-size: 9px;
  font-weight: 1000;
  text-align: center;
  color: #ffb4b4;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 8px;
  padding: 2px 4px;
}

.library-head {
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.library-head .screen-title {
  flex: 1;
  min-width: 140px;
}

.library-head .compact-shop-btn {
  flex-shrink: 0;
}

.sigil-card.rarity-common { border-color: var(--r-common) !important; box-shadow: inset 0 0 0 1px rgba(110, 181, 255, 0.25); }
.sigil-card.rarity-rare { border-color: var(--r-rare) !important; box-shadow: inset 0 0 0 1px rgba(192, 132, 252, 0.25); }
.sigil-card.rarity-epic { border-color: var(--r-epic) !important; box-shadow: inset 0 0 0 1px rgba(251, 146, 60, 0.25); }
.sigil-card.rarity-legendary { border-color: var(--r-legend) !important; box-shadow: inset 0 0 0 1px rgba(253, 224, 71, 0.3); }

.sigil-card .rarity {
  background: rgba(0, 0, 0, 0.45) !important;
}

.sigil-card.rarity-common .rarity { color: var(--r-common) !important; }
.sigil-card.rarity-rare .rarity { color: var(--r-rare) !important; }
.sigil-card.rarity-epic .rarity { color: var(--r-epic) !important; }
.sigil-card.rarity-legendary .rarity { color: var(--r-legend) !important; }

.deck-slot.filled {
  border-color: var(--gold) !important;
}

.deck-slot.rarity-common.filled { border-color: var(--r-common) !important; }
.deck-slot.rarity-rare.filled { border-color: var(--r-rare) !important; }
.deck-slot.rarity-epic.filled { border-color: var(--r-epic) !important; }
.deck-slot.rarity-legendary.filled { border-color: var(--r-legend) !important; }

.presence-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid rgba(0, 0, 0, 0.35);
}

.presence-dot.online { background: var(--green); box-shadow: 0 0 8px rgba(74, 222, 128, 0.7); }
.presence-dot.battle { background: #fbbf24; box-shadow: 0 0 8px rgba(251, 191, 36, 0.7); }
.presence-dot.queue { background: #60a5fa; }
.presence-dot.offline { background: #475569; }

.person-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 8px;
}

.person-main {
  min-width: 0;
}

.person-main b {
  font-size: 16px;
  display: block;
}

.person-main small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.person-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.spectate-banner {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 201, 77, 0.35);
  font-size: 13px;
  font-weight: 1000;
  color: var(--gold);
}

.battle.spectating .board {
  pointer-events: none;
  touch-action: none;
  cursor: default;
}

.battle.spectating .board .tile {
  cursor: default;
}

.replay-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 8px;
  cursor: pointer;
}

.replay-row b { font-size: 15px; }
.replay-row small { color: var(--muted); font-size: 11px; font-weight: 800; }

.replay-card {
  padding: 12px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 10px;
}

.replay-card-head small { color: var(--muted); font-size: 11px; font-weight: 800; }

.replay-card-body {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  margin: 10px 0;
}

.replay-side {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
}

.replay-side.win { border: 1px solid rgba(74, 222, 128, 0.45); }
.replay-side.lose { opacity: 0.75; }

.replay-av {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255, 201, 77, 0.15);
  display: grid;
  place-items: center;
  font-size: 20px;
}

.replay-side-main b { display: block; font-size: 14px; }
.replay-sigils { display: flex; gap: 3px; margin-top: 4px; flex-wrap: wrap; }
.replay-sigil {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
  font-size: 12px;
}

.replay-side-score { text-align: right; }
.replay-side-score b { display: block; font-size: 18px; color: var(--gold); }
.replay-trophy { font-size: 11px; font-weight: 1000; display: block; margin-top: 2px; }
.replay-trophy.up { color: var(--green); }
.replay-trophy.down { color: var(--red); }
.replay-vs { font-size: 11px; font-weight: 1000; color: var(--muted); }

.replay-watch-btn { width: 100%; min-height: 44px !important; font-size: 14px !important; }

.replay-bar {
  position: absolute;
  right: 6px;
  bottom: calc(6px + var(--safe));
  left: auto;
  width: min(196px, 46vw);
  z-index: 130;
  padding: 5px 7px 6px;
  border-radius: 12px;
  background: rgba(6, 13, 24, 0.88);
  border: 1px solid rgba(255, 201, 77, 0.22);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
}

.replay-bar.hide { display: none !important; }

.replay-bar.collapsed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px) scale(0.96);
}

.replay-compact {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}

.replay-ctl {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 16px;
  font-weight: 1000;
}

.replay-ctl.sm {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  font-size: 13px;
  flex-shrink: 0;
}

#replayTime {
  font-size: 10px;
  font-weight: 900;
  color: var(--muted);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#replayScrub {
  width: 100%;
  height: 4px;
  margin: 0;
  accent-color: var(--gold);
}

.replay-speeds {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.replay-speed {
  min-width: 26px;
  height: 24px;
  padding: 0 4px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 10px;
  font-weight: 1000;
  color: var(--muted);
}

.replay-peek {
  position: absolute;
  right: 8px;
  bottom: calc(8px + var(--safe));
  z-index: 131;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(6, 13, 24, 0.9);
  border: 1px solid rgba(255, 201, 77, 0.35);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.45);
  font-size: 16px;
  display: grid;
  place-items: center;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.replay-peek.hide { display: none !important; }

.replay-peek:active {
  transform: scale(0.94);
}

.replay-speed.active {
  background: linear-gradient(180deg, #ffe082, #e8a020);
  color: #2a1800;
  border-color: transparent;
}

.lb-tabs { grid-template-columns: repeat(3, 1fr) !important; }

.lb-row {
  padding: 12px !important;
}

.lb-row .lb-rank {
  font-size: 20px !important;
}

.auth-card .auth-hint {
  display: none !important;
}

#profileUsernameLine {
  display: none !important;
}

.hide-hint {
  display: none !important;
}

.logo {
  display: none !important;
}

.net-pill {
  display: none !important;
}

#profileClaimHint {
  display: none !important;
}

.quest-panel .screen-title {
  font-size: 18px !important;
}

.quest .btn {
  min-height: 40px !important;
  font-size: 13px !important;
}

.cr-tile-icon {
  width: 56px !important;
  height: 56px !important;
}

.arena-card-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
}

.emoji-font,
.sigil-icon,
.sigil-card-icon,
.sigil-info-icon,
.player-avatar,
.cr-tile-icon,
.replay-av,
.replay-finger,
.sigil-lock-icon,
.tile span.emoji-font,
.tile b.emoji-font {
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif !important;
  line-height: 1 !important;
}

/* Масти — текстовые глифы, цвет как у номинала (не цветные emoji) */
.tile .suit-glyph {
  font-family: "Segoe UI Symbol", "DejaVu Sans", Georgia, "Times New Roman", serif !important;
  font-variant-emoji: text;
  -webkit-text-fill-color: currentColor;
  color: inherit;
  font-size: 23px;
  line-height: 1;
  margin-top: 4px;
  font-weight: 1000;
  display: block;
}

.tile.hearts .suit-glyph,
.tile.hearts b { color: #ff3f63; }

.tile.diamonds .suit-glyph,
.tile.diamonds b { color: #159bff; }

.tile.clubs .suit-glyph,
.tile.clubs b { color: #0fa64a; }

.tile.spades .suit-glyph,
.tile.spades b { color: #4b5563; }

.tile.wild .suit-glyph,
.tile.good .suit-glyph,
.tile.good b {
  color: #c2410c;
}

.tile.golden .suit-glyph,
.tile.golden b {
  color: #b45309;
}

.boardwrap {
  position: relative;
}

.replay-finger {
  position: absolute;
  z-index: 120;
  font-size: 26px;
  pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.55));
  transform: translate(-40%, -20%);
  will-change: left, top;
}

.replay-finger.hide {
  display: none !important;
}

.tile.vanish {
  animation: tileVanish 0.38s ease forwards;
  z-index: 5;
}

.tile.falling {
  animation: tileFall 0.48s cubic-bezier(0.34, 1.1, 0.48, 1) forwards;
  z-index: 2;
}

@keyframes tileVanish {
  0% { transform: scale(1); opacity: 1; filter: brightness(1); }
  55% { transform: scale(1.08); opacity: 0.85; filter: brightness(1.35); }
  100% { transform: scale(0.2); opacity: 0; filter: brightness(2); }
}

@keyframes tileFall {
  0% { transform: translateY(calc(-1 * var(--fall-dist, 100%))); opacity: 0.92; }
  100% { transform: translateY(0); opacity: 1; }
}

.battle.replay-mode .tile.selected {
  transition: box-shadow 0.12s ease, filter 0.12s ease;
}

.tile.selected {
  box-shadow: inset 0 0 0 2px #ffe37f, 0 0 12px rgba(255, 227, 127, 0.45);
}

.tile.selected.opponent {
  filter: brightness(1.12) saturate(1.1) !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.95), 0 0 14px rgba(56, 189, 248, 0.55) !important;
  z-index: 3;
}

.tile.selected.opponent em.order {
  background: #38bdf8 !important;
  color: #031126 !important;
}

.account-settings-panel {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 4px;
}

.account-settings-label {
  display: block;
  font-size: 11px;
  font-weight: 900;
  color: var(--muted);
  margin-bottom: 6px;
}

.account-rename-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.rename-hint {
  margin: 6px 0 0;
  font-size: 11px;
  font-weight: 850;
  color: var(--muted);
  line-height: 1.3;
}

#accountRenameBtn:disabled {
  opacity: 0.45;
  pointer-events: none;
}
