/* Рукописный шрифт: на Windows — Segoe Print, на остальных (телефоны, Mac) — Pangolin из /fonts
   (OFL, кириллица с казахскими буквами). Системный cursive не берём: на Android это вязь, на iPhone — каллиграфия. */
@font-face { font-family:'Rex Hand'; font-style:normal; font-weight:400; font-display:swap; src:url(/fonts/pangolin-cyrillic-ext.woff2) format('woff2'); unicode-range:U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family:'Rex Hand'; font-style:normal; font-weight:400; font-display:swap; src:url(/fonts/pangolin-cyrillic.woff2) format('woff2'); unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family:'Rex Hand'; font-style:normal; font-weight:400; font-display:swap; src:url(/fonts/pangolin-latin-ext.woff2) format('woff2'); unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family:'Rex Hand'; font-style:normal; font-weight:400; font-display:swap; src:url(/fonts/pangolin-latin.woff2) format('woff2'); unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root { --paper:#faf8ef; --text:#294c85; --muted:#72819a; --line:#a9b8ce; --red:#b75459; --ok:#446b56; --accent:#294c85; --accent-dark:#1d3a6a; --hand:'Segoe Print','Rex Hand','Comic Sans MS',sans-serif; }
* { box-sizing:border-box; }
[hidden] { display:none !important; }
html { touch-action:manipulation; }
body { margin:0; color:var(--text); background-color:var(--paper); background-image:linear-gradient(#7e9dbe14 1px,transparent 1px),linear-gradient(90deg,#7e9dbe14 1px,transparent 1px); background-size:28px 28px; font:15px/1.55 var(--hand); }
/* Свой забег: касание в любом месте — прыжок, поэтому страница не листается и текст не выделяется. */
body.rex-playing { touch-action:none; -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; }
body::before { content:''; position:fixed; top:0; bottom:0; left:max(24px,calc((100vw - 1160px)/2)); width:4px; border-left:1px solid #c8656d70; border-right:1px solid #c8656d45; pointer-events:none; }
a { color:inherit; text-underline-offset:4px; }
button,input,select { font:inherit; }
button,a,input,select { -webkit-tap-highlight-color:transparent; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible { outline:2px dashed var(--red); outline-offset:4px; }
.top { max-width:1080px; margin:auto; padding:25px 24px 18px; display:flex; gap:16px; align-items:center; border-bottom:1px solid #294c8533; }
.logo { display:flex; gap:10px; align-items:center; font-size:26px; font-weight:bold; text-decoration:none; letter-spacing:-1.5px; transform:rotate(-2deg); }
.logo svg { width:43px; height:43px; }
.tagline { margin-left:auto; color:var(--muted); font-size:12px; }
.lang-switch { margin-left:auto; display:flex; gap:2px; }
.lang-switch button { background:transparent; color:var(--muted); border:0; border-radius:0; padding:4px 7px; font-size:12px; letter-spacing:.5px; }
.lang-switch button:hover { background:transparent; color:var(--text); transform:none; }
.lang-switch button[aria-pressed=true] { color:var(--text); font-weight:700; text-decoration:underline; text-decoration-style:wavy; text-decoration-color:var(--red); text-underline-offset:5px; }
.header-note { font-size:12px; border:1px solid var(--line); padding:2px 10px; border-radius:40% 8% 30% 5%; transform:rotate(3deg); }
main { max-width:1080px; margin:auto; padding:0 24px 24px; }
.intro { display:flex; justify-content:space-between; align-items:center; padding:27px 0 20px; gap:15px; }
.eyebrow { font:10px/1.5 'Segoe UI',sans-serif; letter-spacing:2.1px; color:var(--muted); font-weight:600; }
h1 { font-size:36px; letter-spacing:-1.9px; line-height:1.45; margin:4px 0 5px; }
h2 { font-size:18px; line-height:1.4; margin:0; }
p { margin:8px 0 15px; }
.intro p { margin:0; color:var(--muted); font-size:13px; }
.red { color:var(--red); }
.scribble-note { color:var(--red); font-size:16px; line-height:1.5; transform:rotate(-7deg); padding-right:12px; text-align:center; }
.scribble-note span { display:block; font-size:33px; line-height:1; margin:4px 0 -10px -60px; }
.play-sheet { border:2px solid var(--text); border-radius:3px 8px 4px 7px / 8px 3px 7px 4px; position:relative; background:#faf8ef70; margin-bottom:27px; box-shadow:3px 4px 0 #294c8510; }
.play-sheet::after { content:''; position:absolute; height:20px; width:90px; background:#e0d8b76b; top:-11px; left:45%; transform:rotate(-3deg); pointer-events:none; }
.sheet-caption,.sheet-bottom { display:flex; justify-content:space-between; gap:10px; font-size:11px; padding:10px 16px; color:var(--muted); }
.sheet-bottom { border-top:1px dashed #294c8544; }
#game-wrap { max-width:1080px; margin:0 auto 16px; }
#home-slot #game-wrap { margin:0; }
#game { display:block; width:100%; touch-action:none; user-select:none; }
#slot #game-wrap { border:2px solid var(--text); border-radius:4px 8px 3px 5px; overflow:hidden; }
.dashboard { display:grid; grid-template-columns:1.08fr 1fr; gap:22px; align-items:start; }
.card { border:1.5px solid var(--line); border-radius:4px 7px 3px 6px; padding:22px; margin-bottom:22px; background:#faf8efbb; min-width:0; }
.section-title { display:flex; align-items:center; gap:11px; margin-bottom:18px; }
.section-number { font:11px 'Segoe UI',sans-serif; color:var(--muted); padding:4px 5px; border:1px solid var(--line); transform:rotate(-5deg); }
.trophy { margin-left:auto; color:var(--red); font-size:30px; line-height:1; transform:rotate(12deg); }
.profile-fields { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.profile-fields label { display:flex; flex-direction:column; gap:6px; font-size:14px; min-width:0; }
.profile-fields strong { font-weight:700; }
.profile-fields input,.profile-fields select { font-weight:600; }
.profile-fields input::placeholder { font-weight:400; }
.country-field { grid-column:1 / -1; }
.country-field .muted { display:inline; position:absolute; margin-left:62px; }
input[type=text],select { padding:8px 2px; color:var(--text); border:0; border-bottom:1.5px solid var(--text); border-radius:0; background:transparent; min-width:0; width:100%; max-width:100%; font-size:14px; }
input::placeholder { color:#8995a9; font-size:12px; }
select { cursor:pointer; }
select option { background:var(--paper); }
input[type=text]:focus,select:focus { outline:none; border-color:var(--red); background:#ffffff66; }
.city-field { position:relative; }
.city-options { position:absolute; top:100%; left:0; min-width:280px; width:100%; max-height:270px; overflow:auto; background:var(--paper); border:1px solid var(--text); box-shadow:3px 4px 0 #294c8522; z-index:5; }
.city-options button { display:block; width:100%; text-align:left; border:0; border-bottom:1px solid #294c8533; border-radius:0; padding:9px 12px; color:var(--text); background:transparent; font-size:12px; }
.city-options button:hover,.city-options button:focus { background:#e5eaca; }
.city-options span { display:block; font:11px/1.5 'Segoe UI',sans-serif; color:var(--muted); }
.field-help { color:var(--muted); font:11px/1.6 'Segoe UI',sans-serif; margin:12px 0 17px; }
button { border:1.5px solid var(--text); border-radius:3px 7px 4px 8px / 8px 3px 7px 4px; background:var(--text); color:var(--paper); padding:10px 15px; cursor:pointer; transition:transform .15s,background .15s; }
button:hover { background:var(--accent-dark); transform:rotate(-1deg); }
button:active { transform:translateY(2px); }
button:disabled { opacity:.45; cursor:default; }
button.primary { width:100%; display:flex; justify-content:space-between; align-items:center; padding:11px 17px; font-size:17px; font-weight:700; }
button.primary span { font-size:25px; line-height:1; }
button.ghost { background:transparent; color:var(--text); }
button.ghost:hover { background:#294c850b; }
button.text-button { background:transparent; color:var(--text); border:0; padding:6px 0; text-decoration:underline; text-decoration-style:dashed; text-underline-offset:5px; font-size:12px; }
button.small { padding:5px 10px; font-size:12px; }
button.ok { background:var(--ok); border-color:var(--ok); }
.friends-actions { display:flex; gap:18px; align-items:center; margin:13px 0 11px; }
.friends-actions .ghost { flex:1; font-size:13px; }
label.check { display:inline-flex; gap:7px; align-items:center; font-size:11px; color:var(--muted); cursor:pointer; }
input[type=checkbox] { accent-color:var(--text); width:15px; height:15px; }
.tabs { display:flex; border-bottom:1px solid var(--line); gap:10px; }
.tabs button { color:var(--muted); background:transparent; border:0; border-radius:0; flex:1; padding:7px 10px 10px; font-size:14px; font-weight:700; position:relative; }
.tabs button[aria-selected=true] { color:var(--text); }
.tabs button[aria-selected=true]::after { content:''; height:3px; background:var(--text); position:absolute; bottom:-2px; left:10px; right:10px; border-radius:50%; transform:rotate(-2deg); }
.board-label { font-size:11px; margin:13px 0; color:var(--muted); }
#leaderboard { min-height:195px; max-height:340px; overflow:auto; }
.empty-board { min-height:190px; display:flex; flex-direction:column; justify-content:center; align-items:center; text-align:center; color:var(--muted); font-size:13px; line-height:1.9; }
.empty-board span { font-size:38px; line-height:1.6; color:var(--line); }
.record-table small { display:block; font:10px/1.6 'Segoe UI',sans-serif; color:var(--muted); }
.record-table td { font-size:13px; padding:10px 5px; }
.record-table .rank { color:var(--muted); width:37px; font-size:12px; }
.record-table tr:first-child .rank { color:var(--red); }
.personal-best { border-top:1px dashed var(--text); font-size:12px; margin-top:12px; padding-top:10px; }
.row { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.spacer { flex:1; }
.muted { color:var(--muted); }
table { width:100%; border-collapse:collapse; }
th,td { text-align:left; padding:9px 6px; border-bottom:1px solid #294c8525; }
th { font-weight:normal; font-size:12px; color:var(--muted); }
td.num,th.num { text-align:right; font-variant-numeric:tabular-nums; }
tr.active td { background:#e5eaca80; }
.dot { display:inline-block; width:10px; height:10px; border-radius:40% 60% 50% 40%; margin-right:6px; }
.badge { font:10px/1.5 'Segoe UI',sans-serif; padding:3px 7px; border:1px solid var(--line); color:var(--muted); white-space:nowrap; }
.badge.ok { color:var(--ok); border-color:var(--ok); }
.offline { opacity:.5; }
.banner { font-size:18px; margin-bottom:10px; }
.winner { font-size:25px; margin:6px 0 14px; }
.link-box { font:12px/1.6 Consolas,monospace; padding:8px 10px; border:1px dashed var(--line); word-break:break-all; }
.solo-status { text-align:center; }
.solo-status .row { justify-content:center; }
#room-head { margin-top:24px; }
footer { display:flex; justify-content:space-between; gap:12px; color:var(--muted); font-size:10px; padding:0 2px 12px; }
footer span { font:10px/1.8 'Segoe UI',sans-serif; }
#toast { position:fixed; left:50%; bottom:20px; transform:translateX(-50%); background:var(--text); color:var(--paper); padding:12px 20px; border-radius:3px 8px; z-index:20; max-width:90vw; box-shadow:3px 4px 0 #294c8533; }
@media(min-width:1450px) { .top { padding-top:35px; } .intro { padding-top:35px; } }
@media(prefers-reduced-motion:reduce) { button { transition:none; } }
/* Телефон: текст не мельче 12px, поля ввода 16px (иначе iPhone приближает страницу при фокусе), кнопки под палец. */
@media(max-width:700px) {
  body { font-size:16px; }
  body::before { left:12px; } .top { margin-left:26px; padding:16px 8px 12px 0; gap:10px; } .logo { font-size:23px; } .tagline { display:none; } .header-note { margin-left:auto; font-size:12px; }
  .lang-switch button { font-size:13px; padding:8px 6px; }
  main { padding:0 14px 18px 28px; } .intro { padding:20px 0 16px; } h1 { font-size:28px; letter-spacing:-1.2px; } .intro p { font-size:13px; max-width:260px; } .scribble-note { font-size:13px; padding-right:0; min-width:83px; } .eyebrow { font-size:10px; letter-spacing:1.4px; }
  .dashboard { grid-template-columns:1fr; gap:0; } .card { padding:18px 16px; margin-bottom:18px; } .section-title { gap:8px; } h2 { font-size:19px; } .section-number { font-size:12px; }
  .sheet-caption,.sheet-bottom { font-size:13px; padding:9px 10px; } .sheet-bottom { display:block; } .sheet-bottom .red { display:none; } .play-sheet { margin-bottom:20px; } #game-wrap { width:100%; }
  .profile-fields { gap:16px; } .profile-fields label { font-size:15px; }
  input[type=text],select { font-size:16px; padding:10px 2px; } input::placeholder { font-size:14px; }
  .field-help { font-size:13px; }
  button { min-height:44px; } button.primary { font-size:18px; } button.small { font-size:14px; padding:8px 12px; min-height:40px; } button.text-button { font-size:15px; }
  .friends-actions .ghost { font-size:15px; } label.check { font-size:14px; } input[type=checkbox] { width:20px; height:20px; }
  .tabs button { font-size:16px; padding:9px 6px 12px; } .board-label { font-size:13px; }
  .record-table td { font-size:15px; } .record-table small { font-size:12px; } .record-table .rank { font-size:14px; } .personal-best { font-size:14px; }
  .city-options { min-width:0; width:min(280px,72vw); left:auto; right:0; } .city-options button { font-size:15px; padding:11px 12px; } .city-options span { font-size:12px; }
  .empty-board { min-height:150px; font-size:15px; } #leaderboard { min-height:150px; }
  th,td { font-size:14px; padding:8px 4px; } th { font-size:13px; } .badge { font-size:12px; }
  footer { flex-direction:column; gap:2px; } footer span { font-size:12px; } .banner { font-size:17px; } .winner { font-size:22px; } .link-box { font-size:12px; } #toast { font-size:15px; }
}
@media(max-width:390px) { .intro { align-items:flex-start; } h1 { font-size:25px; } .scribble-note { display:none; } .profile-fields { grid-template-columns:1fr; } .country-field { grid-column:auto; } .city-options { width:100%; } .section-title .badge { font-size:11px; } .logo { font-size:21px; gap:7px; } .logo svg { width:36px; height:36px; } .lang-switch button { padding:8px 4px; font-size:12px; } }
