/* ШАШКИ — гроссмейстерский клуб.
   Материалы: ночное сукно, орех, латунь, слоновая кость. */

:root {
  --bg: #0C120E;
  --felt: #121B15;
  --felt-2: #17231B;
  --line: rgba(233, 214, 170, .10);
  --line-2: rgba(233, 214, 170, .18);
  --ivory: #EFE5CC;
  --muted: #8FA294;
  --brass: #D9A441;
  --brass-2: #F2C86B;
  --danger: #E05A4E;
  --ok: #6FBF7E;
  --disp: 'Unbounded', sans-serif;
  --body: 'Golos Text', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --r: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* атрибут hidden сильнее любых display-правил */
[hidden] { display: none !important; }

html { color-scheme: dark; }

body {
  font-family: var(--body);
  background:
    radial-gradient(1200px 700px at 70% -10%, rgba(217, 164, 65, .06), transparent 60%),
    radial-gradient(900px 600px at 10% 110%, rgba(111, 191, 126, .05), transparent 55%),
    var(--bg);
  color: var(--ivory);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* лёгкая фактура сукна */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
}

::selection { background: rgba(217, 164, 65, .35); }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select { font: inherit; }

:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; border-radius: 6px; }

#view { display: block; outline: none; }

.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.brass { color: var(--brass); }
.ok { color: var(--ok); }
.danger { color: var(--danger); }

.h1 { font-family: var(--disp); font-weight: 600; font-size: clamp(24px, 4vw, 34px); letter-spacing: .01em; }
.h2 { font-family: var(--disp); font-weight: 500; font-size: 17px; letter-spacing: .04em; text-transform: uppercase; color: var(--brass); margin-bottom: 14px; }
.h3 { font-family: var(--disp); font-weight: 500; font-size: 18px; margin-bottom: 10px; }
.eyebrow { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--brass); font-weight: 600; }

.card {
  background: linear-gradient(180deg, var(--felt-2), var(--felt));
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}

/* ---------- кнопки, поля ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px;
  font-weight: 600; font-size: 14.5px;
  border: 1px solid transparent;
  transition: transform .12s ease, box-shadow .12s ease, background .15s ease, border-color .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: default; }

.btn-primary {
  background: linear-gradient(180deg, var(--brass-2), var(--brass) 55%, #B4832F);
  color: #241703;
  box-shadow: 0 4px 14px rgba(217, 164, 65, .25), inset 0 1px 0 rgba(255, 255, 255, .4);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(217, 164, 65, .38), inset 0 1px 0 rgba(255,255,255,.4); }

.btn-outline { border-color: var(--line-2); color: var(--ivory); background: rgba(233,214,170,.03); }
.btn-outline:hover { border-color: var(--brass); color: var(--brass-2); }

.btn-ghost { color: var(--muted); }
.btn-ghost:hover { color: var(--ivory); background: rgba(233,214,170,.06); }

.btn-danger { background: var(--danger); color: #2B0B08; }
.btn-danger-ghost { color: var(--danger); border-color: rgba(224, 90, 78, .35); }
.btn-danger-ghost:hover { background: rgba(224, 90, 78, .1); }

.btn-lg { padding: 13px 22px; font-size: 16px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .input {
  width: 100%; padding: 11px 14px;
  background: rgba(6, 10, 8, .55);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  color: var(--ivory);
}
.field input:focus, .input:focus { border-color: var(--brass); outline: none; box-shadow: 0 0 0 3px rgba(217,164,65,.15); }
.field input::placeholder, .input::placeholder { color: rgba(143, 162, 148, .6); }

.form-error {
  background: rgba(224, 90, 78, .12); border: 1px solid rgba(224, 90, 78, .4);
  color: #F1A29A; border-radius: 10px; padding: 9px 12px; font-size: 14px; margin-bottom: 12px;
}

.tabs { display: flex; gap: 4px; background: rgba(6,10,8,.5); padding: 4px; border-radius: 12px; margin-bottom: 18px; }
.tab {
  flex: 1; text-align: center; padding: 9px 10px; border-radius: 9px;
  color: var(--muted); font-weight: 600; font-size: 14px;
}
.tab.on { background: linear-gradient(180deg, var(--felt-2), #1B2A20); color: var(--brass-2); box-shadow: inset 0 0 0 1px var(--line-2); }

.chip {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-2);
  color: var(--muted); font-weight: 600; font-size: 13.5px;
}
.chip.on { color: #241703; background: var(--brass); border-color: var(--brass); }

/* ---------- верхняя панель ---------- */

#topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 22px;
  padding: 0 22px; height: 62px;
  background: rgba(10, 15, 12, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.logo { font-family: var(--disp); font-weight: 700; font-size: 20px; letter-spacing: .06em; }
.logo span { color: var(--brass); }
.nav { display: flex; gap: 4px; }
.nav a { padding: 8px 13px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14.5px; }
.nav a:hover { color: var(--ivory); }
.nav a.on { color: var(--brass-2); background: rgba(217, 164, 65, .1); }
.return-chip {
  padding: 7px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  color: #241703; background: var(--brass);
  animation: pulse-chip 2s infinite;
}
@keyframes pulse-chip { 0%,100% { box-shadow: 0 0 0 0 rgba(217,164,65,.45); } 50% { box-shadow: 0 0 0 7px rgba(217,164,65,0); } }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; font-size: 16px;
  display: grid; place-items: center; color: var(--muted); border: 1px solid transparent;
}
.icon-btn:hover { color: var(--ivory); border-color: var(--line-2); }
.user-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 12px 6px 7px; border-radius: 999px;
  border: 1px solid var(--line-2); background: rgba(233,214,170,.04);
}
.user-chip:hover { border-color: var(--brass); }
.user-name { font-weight: 600; font-size: 14px; }
.user-rating { color: var(--brass-2); font-size: 13.5px; }

/* ---------- вход ---------- */

.auth {
  min-height: 100vh;
  display: grid; grid-template-columns: 1.15fr 1fr;
  align-items: center; gap: 40px;
  max-width: 1200px; margin: 0 auto; padding: 40px 24px;
}
.auth-brand { position: relative; }
.brand-title {
  font-family: var(--disp); font-weight: 700;
  font-size: clamp(64px, 10vw, 118px);
  line-height: .95; letter-spacing: .02em;
  margin: 14px 0 18px;
  text-shadow: 0 6px 40px rgba(217, 164, 65, .18);
}
.brand-title .brass { color: var(--brass); }
.brand-sub { max-width: 46ch; color: var(--muted); font-size: 16.5px; margin-bottom: 28px; }
.brand-medals { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }
.brand-medal { display: grid; justify-items: center; gap: 5px; }
.brand-medal span { font-size: 11.5px; color: var(--muted); letter-spacing: .04em; }
.decor-board {
  position: absolute; right: -30px; top: -40px; width: 190px;
  transform: rotate(8deg); opacity: .5; border-radius: 10px;
  box-shadow: var(--shadow);
}
.decor-float { animation: float 5s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translate(90px,30px); } 50% { transform: translate(90px,22px); } }

.auth-card { padding: 26px; max-width: 420px; margin-left: auto; width: 100%; }
.auth-hint { margin-top: 14px; font-size: 13.5px; color: var(--muted); }
.auth-card .btn { width: 100%; }

/* ---------- лобби ---------- */

.lobby { max-width: 1200px; margin: 0 auto; padding: 28px 24px 60px; }
.lobby-hero { margin-bottom: 30px; }

.league-card {
  display: flex; align-items: center; gap: 22px;
  padding: 22px 26px;
  background:
    radial-gradient(500px 200px at 12% 50%, rgba(217, 164, 65, .08), transparent 60%),
    linear-gradient(180deg, var(--felt-2), var(--felt));
}
.league-name { font-family: var(--disp); font-weight: 600; font-size: 26px; margin: 2px 0; }
.league-rating .mono { font-size: 19px; color: var(--brass-2); }
.progress {
  height: 7px; border-radius: 99px; overflow: hidden;
  background: rgba(6, 10, 8, .6); margin: 10px 0 6px; max-width: 320px;
  border: 1px solid var(--line);
}
.progress-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, #8A6014, var(--brass), var(--brass-2));
  transition: width .6s cubic-bezier(.2,.8,.3,1);
}
.league-stats { margin-left: auto; display: flex; gap: 26px; }
.league-stats div { display: grid; justify-items: center; gap: 2px; }
.league-stats b { font-size: 22px; color: var(--ivory); }
.league-stats span { font-size: 12px; color: var(--muted); letter-spacing: .05em; }

.lobby-cols { display: grid; grid-template-columns: 1fr 1.25fr; gap: 34px; align-items: start; }

.side-pick { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.bot-cards { display: grid; gap: 12px; }
.bot-card { display: flex; align-items: center; gap: 16px; padding: 15px 17px; transition: border-color .15s, transform .15s; }
.bot-card:hover { border-color: var(--line-2); transform: translateY(-1px); }
.bot-ava {
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
  font-family: var(--disp); font-weight: 600; font-size: 20px; color: #241703;
  box-shadow: inset 0 -3px 6px rgba(0,0,0,.25), 0 3px 8px rgba(0,0,0,.35);
}
.bot-ava-1 { background: radial-gradient(circle at 35% 30%, #D9C193, #A98F5C); }
.bot-ava-2 { background: radial-gradient(circle at 35% 30%, #C9CFD4, #8E999E); }
.bot-ava-3 { background: radial-gradient(circle at 35% 30%, #F2C86B, #B4832F); }
.bot-meta { flex: 1; min-width: 0; }
.bot-name { font-weight: 700; font-size: 15.5px; }
.bot-rating { color: var(--brass-2); font-size: 13px; }
.bot-blurb { color: var(--muted); font-size: 13px; line-height: 1.45; margin-top: 3px; }

.rooms-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.rooms-head .h2 { margin: 0; }
.rooms-meta { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 14px; margin-left: auto; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }

.room-form { padding: 18px; margin-bottom: 14px; }
.room-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.room-form-actions { display: flex; gap: 10px; margin-top: 4px; }

.rooms-list { display: grid; gap: 10px; }
.room-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px;
  background: linear-gradient(180deg, var(--felt-2), var(--felt));
  border: 1px solid var(--line); border-radius: 12px;
  transition: border-color .15s;
}
.room-row:hover { border-color: var(--line-2); }
.room-name { flex: 1; min-width: 0; }
.room-name b { font-size: 15px; }
.lock { font-size: 12px; }
.room-status { font-size: 13px; color: var(--muted); white-space: nowrap; }
.room-status.open { color: var(--ok); }
.rooms-empty {
  text-align: center; padding: 42px 20px; border: 1px dashed var(--line-2);
  border-radius: var(--r); color: var(--ivory);
}
.rooms-empty .muted { margin-top: 6px; }

/* ---------- игровой экран ---------- */

.game {
  display: grid;
  grid-template-columns: 280px minmax(340px, 1fr) 300px;
  gap: 22px;
  max-width: 1360px; margin: 0 auto;
  padding: 24px;
  align-items: start;
}

.game-stage { position: relative; display: grid; place-items: center; }
.game-stage::before {
  content: ''; position: absolute; inset: -40px;
  background: radial-gradient(ellipse 60% 55% at 50% 42%, rgba(242, 200, 107, .10), transparent 70%);
  pointer-events: none;
}
.board-wrap { width: min(100%, 78vh); position: relative; }
.board-svg { width: 100%; height: auto; display: block; border-radius: 12px; box-shadow: 0 24px 60px rgba(0,0,0,.5); }

.coord { font-family: var(--mono); font-size: 13px; fill: var(--brass); opacity: .55; text-anchor: middle; }

.sq { cursor: pointer; }
.pc { transition: transform .28s cubic-bezier(.2, .85, .3, 1.08); pointer-events: none; }
.pc.no-anim { transition: none; }
.pc.moving { transition: transform .3s cubic-bezier(.25, .9, .3, 1.1); }
.pc.ghost { opacity: .38; filter: saturate(.4) url(#pcshadow); }
.pc.gone { opacity: 0; transition: opacity .3s; }
.pc.promoted .crown { animation: crown-pop .8s cubic-bezier(.2, 1.4, .4, 1); transform-origin: center; }
@keyframes crown-pop { 0% { transform: scale(0); } 60% { transform: scale(1.5); } 100% { transform: scale(1); } }

.hint-src { fill: none; stroke: rgba(242, 200, 107, .0); stroke-width: 2.5; }
.hint-src.on { stroke: var(--brass-2); filter: drop-shadow(0 0 6px rgba(242,200,107,.7)); }
.hint-to { fill: rgba(242, 200, 107, .85); animation: hint-pulse 1.4s infinite; }
.hint-cap { fill: rgba(224, 90, 78, .9); animation: hint-pulse 1.1s infinite; }
.hint-victim { fill: none; stroke: rgba(224, 90, 78, .8); stroke-width: 3; stroke-dasharray: 6 5; }
@keyframes hint-pulse { 0%,100% { opacity: .95; } 50% { opacity: .45; } }

.game-side { display: grid; gap: 12px; }
.plaque { display: flex; gap: 13px; padding: 14px 16px; position: relative; align-items: center; }
.plaque.turn { border-color: rgba(217, 164, 65, .55); box-shadow: 0 0 22px rgba(217, 164, 65, .12), var(--shadow); }
.plaque-empty { justify-content: center; text-align: center; padding: 22px; }
.plaque-wait { color: var(--ivory); font-weight: 600; line-height: 1.6; }
.plaque-info { min-width: 0; flex: 1; }
.plaque-name { font-weight: 700; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plaque-sub { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.bot-tag, .you-tag {
  font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  background: rgba(217, 164, 65, .16); color: var(--brass-2);
  padding: 2px 7px; border-radius: 99px; vertical-align: 2px;
}
.you-tag { background: rgba(111, 191, 126, .15); color: var(--ok); }
.turn-dot {
  position: absolute; top: 14px; right: 14px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--brass-2); box-shadow: 0 0 10px var(--brass);
  animation: hint-pulse 1.3s infinite;
}
.disc { width: 14px; height: 14px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.disc-w { background: radial-gradient(circle at 35% 30%, #FBF3DC, #C9AE79); border: 1px solid #8F7442; }
.disc-b { background: radial-gradient(circle at 35% 30%, #4E3D2F, #17100B); border: 1px solid #000; }

.captured { display: flex; align-items: center; gap: 3px; margin-top: 8px; flex-wrap: wrap; min-height: 12px; }
.captured i {
  width: 10px; height: 10px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #D9C193, #8F7442);
  opacity: .9;
}
.plaque.mine .captured i { background: radial-gradient(circle at 35% 30%, #4E3D2F, #17100B); }
.captured b { font-size: 12px; color: var(--brass-2); margin-left: 4px; }

.conn-warn { margin-top: 8px; font-size: 12.5px; color: var(--danger); }

.vs-strip {
  text-align: center; font-weight: 700; font-size: 15px;
  padding: 10px; border-radius: 10px;
  background: rgba(6, 10, 8, .4); border: 1px solid var(--line);
  color: var(--muted);
}
.vs-strip.active { color: var(--brass-2); border-color: rgba(217,164,65,.4); }
.vs-strip.hot { color: #FFD9A0; background: rgba(224, 90, 78, .14); border-color: rgba(224, 90, 78, .5); animation: hot 1.2s infinite; }
.vs-strip.over { color: var(--ivory); }
@keyframes hot { 0%,100% { box-shadow: 0 0 0 0 rgba(224,90,78,.25); } 50% { box-shadow: 0 0 0 6px rgba(224,90,78,0); } }

.game-controls { display: grid; gap: 9px; }
.game-controls .btn { width: 100%; }
.rematch-note { text-align: center; color: var(--brass-2); font-weight: 600; font-size: 14px; animation: hint-pulse 1.5s infinite; }

.offer-banner {
  padding: 13px 15px; border-radius: 12px;
  background: rgba(217, 164, 65, .12); border: 1px solid rgba(217, 164, 65, .45);
  font-size: 14px; display: grid; gap: 10px;
}
.offer-actions { display: flex; gap: 8px; }

.game-right { display: flex; flex-direction: column; height: min(78vh, 640px); padding: 14px; }
.tabs-right { margin-bottom: 10px; }
.badge {
  background: var(--danger); color: #fff; font-size: 11px;
  border-radius: 99px; padding: 1px 6px; margin-left: 4px;
}
.tabpane { flex: 1; overflow-y: auto; min-height: 0; display: flex; flex-direction: column; }
#pane-moves { overflow-y: auto; }
.movelist { list-style: none; }
.movelist li { display: grid; grid-template-columns: 34px 1fr 1fr; padding: 4px 8px; border-radius: 7px; font-size: 13.5px; }
.movelist li:nth-child(odd) { background: rgba(233, 214, 170, .04); }
.mvnum { color: var(--muted); }
.movelist li.empty-moves { display: block; padding: 10px; }

.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; padding: 2px 2px 10px; min-height: 0; }
.chat-line { font-size: 14px; word-break: break-word; }
.chat-line b { color: var(--brass-2); margin-right: 5px; font-weight: 600; }
.chat-line.mine b { color: var(--ok); }
.chat-line.sys { color: var(--muted); font-size: 12.5px; font-style: italic; }
.chat-form { display: flex; gap: 8px; margin-top: 8px; }
.chat-form .btn { padding: 8px 14px; }

/* ---------- модальные окна, тосты ---------- */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5, 8, 6, .7); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 20px;
  animation: fade-in .18s ease;
}
@keyframes fade-in { from { opacity: 0; } }
.modal { padding: 26px; max-width: 430px; width: 100%; animation: modal-in .22s cubic-bezier(.2,.9,.3,1.2); }
@keyframes modal-in { from { transform: translateY(14px) scale(.97); opacity: 0; } }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }

.result { text-align: center; }
.result-title { font-family: var(--disp); font-weight: 700; font-size: 34px; margin-bottom: 6px; }
.result.won .result-title { color: var(--brass-2); text-shadow: 0 0 30px rgba(217,164,65,.4); }
.result.lost .result-title { color: var(--muted); }
.result-rating { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 18px 0 4px; }
.result-rating .delta { font-size: 22px; font-weight: 600; }
.result-rating .big { font-size: 26px; }
.league-change { margin-top: 12px; font-weight: 700; }
.league-change.up { color: var(--brass-2); }
.league-change.down { color: var(--muted); }

.rules { list-style: none; display: grid; gap: 9px; margin: 8px 0; }
.rules li { padding-left: 20px; position: relative; font-size: 14.5px; color: var(--ivory); }
.rules li::before { content: '●'; position: absolute; left: 2px; color: var(--brass); font-size: 10px; top: 4px; }

#toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; justify-items: center; }
.toast {
  background: #1E2B22; border: 1px solid var(--line-2); color: var(--ivory);
  padding: 11px 18px; border-radius: 12px; font-size: 14.5px; font-weight: 500;
  box-shadow: var(--shadow);
  opacity: 0; transform: translateY(8px); transition: all .25s ease;
}
.toast.show { opacity: 1; transform: none; }
.toast-error { border-color: rgba(224, 90, 78, .5); color: #F1A29A; }

.confetti { position: fixed; inset: 0; z-index: 300; pointer-events: none; }

/* ---------- табель ---------- */

.leaders, .profile { max-width: 1000px; margin: 0 auto; padding: 30px 24px 60px; }
.page-head { margin-bottom: 22px; }
.league-strip { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.league-pill {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 14px 8px 9px;
  background: linear-gradient(180deg, var(--felt-2), var(--felt));
}
.league-pill.mine { border-color: var(--brass); box-shadow: 0 0 16px rgba(217,164,65,.15); }
.league-pill b { font-size: 13.5px; display: block; }
.league-pill span { display: block; }

.table-card { overflow: hidden; }
.ltable { width: 100%; border-collapse: collapse; }
.ltable th {
  text-align: left; font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); padding: 13px 16px; border-bottom: 1px solid var(--line-2);
}
.ltable td { padding: 11px 16px; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.ltable tr:last-child td { border-bottom: 0; }
.ltable tbody tr:hover { background: rgba(233, 214, 170, .03); }
.ltable tr.me { background: rgba(217, 164, 65, .08); }
.ltable tr.me td:first-child { box-shadow: inset 3px 0 0 var(--brass); }
.ltable .num { text-align: right; }
.pname { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.my-rank { padding: 14px 16px; border-top: 1px solid var(--line-2); color: var(--muted); }

/* ---------- профиль ---------- */

.profile-head { display: flex; align-items: center; gap: 22px; padding: 24px 28px; margin-bottom: 16px; }
.profile-id { flex: 1; min-width: 0; }
.profile-rating { text-align: right; }
.profile-rating .big { font-size: 34px; color: var(--brass-2); }
.stat-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 26px; }
.stat { display: grid; justify-items: center; gap: 3px; padding: 16px 10px; }
.stat b { font-size: 22px; }
.stat span { font-size: 12px; color: var(--muted); letter-spacing: .05em; }
.games-card { padding: 6px 0; }
.game-row {
  display: flex; align-items: center; gap: 13px;
  padding: 11px 18px; border-bottom: 1px solid var(--line); font-size: 14.5px;
}
.game-row:last-child { border-bottom: 0; }
.game-row .opp { flex: 1; font-weight: 600; }
.chip-res { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; letter-spacing: .03em; }
.chip-res.win { background: rgba(111, 191, 126, .15); color: var(--ok); }
.chip-res.loss { background: rgba(224, 90, 78, .14); color: var(--danger); }
.chip-res.d { background: rgba(233, 214, 170, .1); color: var(--muted); }

.loading { text-align: center; padding: 80px 20px; color: var(--muted); }

/* ---------- адаптив ---------- */

@media (max-width: 1100px) {
  .game { grid-template-columns: 1fr; max-width: 720px; }
  .game-side { grid-template-columns: 1fr 1fr; order: 2; }
  .game-side .vs-strip { grid-column: 1 / -1; order: -1; }
  .game-controls { grid-template-columns: 1fr 1fr; grid-column: 1 / -1; }
  .offer-banner { grid-column: 1 / -1; }
  .game-stage { order: 1; }
  .game-right { order: 3; height: 420px; }
}

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; gap: 10px; padding-top: 30px; }
  .auth-brand { text-align: center; }
  .brand-sub { margin-inline: auto; }
  .brand-medals { justify-content: center; }
  .decor-board { display: none; }
  .auth-card { margin: 0 auto; }
  .lobby-cols { grid-template-columns: 1fr; }
  .league-card { flex-wrap: wrap; }
  .league-stats { margin-left: 0; width: 100%; justify-content: space-between; }
}

@media (max-width: 640px) {
  #topbar { padding: 0 12px; gap: 10px; }
  .nav a { padding: 8px 9px; font-size: 13.5px; }
  .user-name { display: none; }
  .return-chip { font-size: 0; padding: 7px 10px; }
  .return-chip::after { content: '⟳'; font-size: 15px; }
  .game { padding: 12px; gap: 14px; }
  .game-side { grid-template-columns: 1fr; }
  .game-controls { grid-template-columns: 1fr 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .profile-head { flex-direction: column; text-align: center; }
  .profile-rating { text-align: center; }
  .room-form-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
