* { box-sizing: border-box; }
html,body { margin: 0; width: 100%; height: 100%; background: #252824; color: #f5efdd; }
body {
  display: grid; grid-template-rows: auto minmax(0,1fr); height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  font: 15px/1.2 "Segoe UI",sans-serif;
}
.player-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding-inline: clamp(5px,2vw,24px); min-height: 44px; column-gap: 5px; }
.player-tools { justify-self: end; display: flex; align-items: center; }
.back, #enlarge { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
.back { justify-self: start; gap: 9px; color: inherit; text-decoration: none; padding-inline: 8px; }
.back-mark { width: 8px; height: 8px; border-left: 1.5px solid; border-bottom: 1.5px solid; transform: rotate(45deg); }
h1 { margin: 0; font-size: .99rem; font-weight: 550; text-align: center; }
#enlarge { justify-self: end; border: 0; background: transparent; color: inherit; cursor: pointer; }
.expand-mark { width: 16px; height: 16px; background: linear-gradient(currentColor,currentColor) left top/6px 1.5px, linear-gradient(currentColor,currentColor) left top/1.5px 6px, linear-gradient(currentColor,currentColor) right top/6px 1.5px, linear-gradient(currentColor,currentColor) right top/1.5px 6px, linear-gradient(currentColor,currentColor) left bottom/6px 1.5px, linear-gradient(currentColor,currentColor) left bottom/1.5px 6px, linear-gradient(currentColor,currentColor) right bottom/6px 1.5px, linear-gradient(currentColor,currentColor) right bottom/1.5px 6px; background-repeat: no-repeat; }
.stage { position: relative; min-height: 0; min-width: 0; }
#game { display: block; border: 0; width: 100%; height: 100%; background: #252824; }
noscript { position: absolute; inset: 20px; }
.load-error { position:absolute; inset:0; display:grid; place-items:center; background:#252824; color:#f8f2df; text-align:center; }
.load-status { position:absolute; inset:0; margin:0; display:grid; place-content:center; padding:24px; text-align:center; color:#eee7cf; background:#252824; pointer-events:none; }
.load-error button { color:#291d16; background:#ff986f; border:0; border-radius:3px; min-height:44px; padding:8px 18px; font:inherit; cursor:pointer; }
[hidden] { display: none !important; }
:where(a,button):focus-visible { outline: 2px solid #ffbb90; outline-offset: -3px; }
@media (max-width: 480px) {
  .player-bar { grid-template-columns: auto minmax(0,1fr) auto; padding-inline: 2px; }
  h1 { font-size: .88rem; }
  .back { font-size: .81rem; }
}
@media (orientation: landscape) and (max-height: 500px) {
  body { grid-template-columns: 44px minmax(0,1fr); grid-template-rows: minmax(0,1fr); }
  .player-bar { display: flex; flex-direction: column; justify-content: space-between; padding: 2px 0; }
  .player-tools { flex-direction: column; }
  .back span:last-child, h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
@font-face { font-family:"Sofia Sans Condensed"; font-weight:700 900; font-display:swap; src:url(wall/sofia-sans-condensed-cyrillic.woff2) format("woff2"); unicode-range:U+0400-052F,U+2116; }
@font-face { font-family:"Sofia Sans"; font-weight:400 700; font-display:swap; src:url(wall/sofia-sans-cyrillic.woff2) format("woff2"); unicode-range:U+0400-052F,U+2116; }
html,body { background:#1c2521; color:#fbf8ef; font-family:"Sofia Sans","Segoe UI",sans-serif; }
.player-bar { min-height:46px; }
.player-bar h1 { font:800 20px/1 "Sofia Sans Condensed","Arial Narrow",sans-serif; }
.player-bar .back { font-weight:700; }
#game,.stage { background:#fbf8ef; }
.load-status,.load-error { color:#1c2521; background:#fbf8ef linear-gradient(90deg,#1c25211f,transparent 7%); }
.load-error button { color:white; background:#b3381c; }
.player-tools .token { display:inline-grid; position:relative; width:32px; height:32px; perspective:240px; }
.player-tools .face { position:absolute; inset:0; display:grid; place-items:center; backface-visibility:hidden; border-radius:50%; transition:transform .45s ease; }
.player-tools .face svg { width:18px; height:18px; }
.player-tools .maple { background:radial-gradient(circle,#e9c48f 52%,#bd9057 54% 59%,#e9c48f 61% 68%,#af814d 70%); color:#5c3c23; }
.player-tools .red { transform:rotateX(-180deg); background:#b6351b; color:#fff; }
.player-tools .like-button[aria-pressed=true] .maple { transform:rotateX(180deg); }
.player-tools .like-button[aria-pressed=true] .red { transform:rotateX(0); }
.player-tools .red path { stroke:none; fill:#fff; }
.player-tools .maple path { fill:none; stroke:#593a20; }
@media(prefers-reduced-motion:reduce) { .player-tools .face { transition:none; } }
@media(orientation:landscape) and (max-height:500px) { .player-bar { min-height:0; } }

.like-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-width: 58px; min-height: 44px; padding: 6px 11px; border: 1px solid #acae9d; border-radius: 24px;
  color: #53584b; background: transparent; font: 550 .9rem/1 "Golos", "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums; cursor: pointer; touch-action: manipulation;
}
.like-button svg { display: block; flex-shrink: 0; overflow: visible; }
.like-button path { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.like-button:hover { background-color: #eae6d9; }
.like-button[aria-pressed="true"] { color: #993c28; border-color: #cd8a73; background: #f6e2d6; }
.like-button[aria-pressed="true"] path { fill: currentColor; }
.like-button[aria-busy="true"], .like-button:disabled { cursor: progress; }
.like-count { min-width: 1ch; text-align: center; }
.device-votes { color: #53584b; margin: -5px 0 16px; font-size: .87rem; }
.likes-feedback {
  position: fixed; z-index: 3; left: 50%; bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%); width: max-content; max-width: calc(100% - 24px);
  margin: 0; padding: 10px 15px; border-radius: 4px; background: #f5f1e7; color: #242923;
  box-shadow: 0 3px 16px #181d1540; font: .9rem/1.4 "Golos", "Segoe UI", sans-serif;
}
.likes-feedback:empty { padding: 0; }
.player-tools .like-button { min-width: 44px; gap: 5px; border-color: transparent; color: #e0dfd1; padding-inline: 5px; }
.player-tools .like-button:hover { background: #3b4037; }
.player-tools .like-button[aria-pressed="true"] { color: #ffab8b; background: transparent; }
@media (orientation: landscape) and (max-height: 500px) {
  .player-tools .like-button { flex-direction: column; gap: 2px; font-size: .75rem; }
}
