@font-face {
  font-family: Pixelify;
  src: url('/media/pixelify-cyrillic.woff2') format('woff2');
  font-display: swap;
  font-weight: 400 700;
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: Pixelify;
  src: url('/media/pixelify-latin.woff2') format('woff2');
  font-display: swap;
  font-weight: 400 700;
  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 {
  color-scheme: dark;
  --bg: #0e1117;
  --sheet: #161a24;
  --inset: #10141d;
  --ink: #f6f3f7;
  --soft: #babaca;
  --line: #373d4d;
  --lime: #d1f979;
  --pink: #ff96bd;
  --violet: #bdadff;
  --amber: #ffd287;
  --pixel: Pixelify, 'Courier New', monospace;
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: 16px;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); }
h1, h2, h3, p, ul, ol { margin: 0; }
button, input, select { font: inherit; }
button:not(:disabled), summary { cursor: pointer; }
button:disabled { cursor: default; opacity: .67; }
button, a, input, select, summary, canvas { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 4px; }
a { color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.shell { width: min(1280px, calc(100% - 72px)); margin-inline: auto; }
.pixel, .brand { font-family: var(--pixel); font-weight: 700; letter-spacing: -.045em; }
.site-header { border-bottom: 1px solid #2c3340; background: #12161e; }
.masthead { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.brand { color: #fffbf8; font-size: 2rem; line-height: .93; text-decoration: none; }
.brand span { color: var(--lime); }
.main-nav { display: flex; align-items: center; gap: 24px; }
.main-nav a {
  min-height: 44px; padding: 11px 4px; display: inline-grid; place-items: center;
  color: var(--soft); font-weight: 650; font-size: .94rem; text-decoration: none;
}
.main-nav a:hover, .main-nav a:focus-visible { color: var(--lime); }
.button {
  display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 9px;
  padding: 9px 14px; border: 1px solid var(--line); background: var(--sheet);
  color: var(--ink); border-radius: 0; text-decoration: none; font-weight: 720; line-height: 1.2;
  font-size: .89rem; transition: background .17s, border-color .17s, box-shadow .17s, transform .17s;
}
.button-primary {
  background: var(--lime); color: #14180e; border-color: #dbffa0;
  box-shadow: 0 3px #6b883e; font-weight: 800;
}
.button-primary:hover { background: #e0ffa4; transform: translateY(-2px); box-shadow: 0 5px #6b883e; }
.button-primary:active { transform: translateY(2px); box-shadow: 0 1px #6b883e; }
.button-subtle { background: transparent; color: var(--soft); }
.button-subtle:hover, .button-outline:hover { color: var(--ink); border-color: var(--violet); background: #262836; }
.button-overlay { color: var(--ink); border-color: #b2adcc66; background: #151924dd; }
.button-overlay:hover { border-color: var(--lime); }
.plus-icon { position: relative; width: 11px; height: 11px; flex: none; }
.plus-icon::before, .plus-icon::after { content: ""; position: absolute; background: currentColor; }
.plus-icon::before { inset: 4px 0; }
.plus-icon::after { inset: 0 4px; }
.profile-button { max-width: 172px; }
.profile-button > :last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-icon { width: 10px; height: 10px; flex: none; background: var(--pink); box-shadow: 3px 3px #754368; }

.hero {
  position: relative; isolation: isolate; overflow: hidden; display: grid;
  border: 1px solid #464960; background: #141424;
}
.hero-illustration { position: absolute; z-index: -4; inset: 0; background: url('/media/club-hero.webp') 83% 46% / cover no-repeat, #1b1835; }
.hero-shade { position: absolute; z-index: -3; inset: 0; background: linear-gradient(0deg, #171428 4%, #171428b3 46%, #1714280d 95%); }
.hero-motion { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; pointer-events: none; }

.section-title { font-size: clamp(2rem, 4.1vw, 3.2rem); line-height: .98; margin-bottom: 13px; }
.club-layout { display: grid; grid-template-columns: minmax(0,1.74fr) minmax(290px,1fr); gap: 16px; margin-top: 30px; }
.mini-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.mini-card {
  --card-accent: var(--pink);
  border: 1px solid #634058; border-top: 2px solid var(--card-accent);
  background: #231826; min-height: 190px; padding: 15px;
  display: grid; gap: 9px; align-content: start; justify-items: start; position: relative; overflow: hidden;
}
.mini-card::after {
  content: ""; position: absolute; right: 0; top: 0; width: 91px; height: 52px; pointer-events: none;
  background: repeating-conic-gradient(#f8b2dd25 0 25%, transparent 0 50%) 0 / 12px 12px;
  mask-image: linear-gradient(110deg, transparent 8%, black 98%);
}
.mini-card h3 { font-size: clamp(1.38rem,2.6vw,2rem); color: var(--card-accent); line-height: .97; }
.mini-card canvas { width: 47px; height: 47px; image-rendering: pixelated; animation: tile-float 2.4s steps(4,end) infinite alternate; }
.mini-card p { color: var(--soft); font-size: .9rem; line-height: 1.4; }
.mini-card .button { border-color: color-mix(in srgb,var(--card-accent) 47%,#2c2431); margin-top: 4px; background: #171720aa; }
.mini-card .button:hover { border-color: var(--card-accent); }
.open-panel { min-height: 218px; padding: 18px; border: 1px solid var(--line); background: var(--inset); }
.open-section .section-title {
  display: grid; align-items: end; min-height: clamp(2rem,4.1vw,3.2rem);
  font-size: clamp(1.85rem,3vw,2.3rem); line-height: 1.04;
}
.open-panel > p { color: var(--soft); font-size: .94rem; }
.empty-join { margin-top: 14px; }
.room-list, .player-list { list-style: none; padding: 0; }
.room-list li {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 9px; padding: 8px 0; border-bottom: 1px solid var(--line);
}
.room-list strong, .room-list small { display: block; }
.room-list small { color: var(--soft); font-size: .82rem; margin-top: 3px; }

.section-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.external, .text-link { min-height: 40px; display: inline-grid; align-items: center; color: var(--lime); font-size: .94rem; text-underline-offset: 3px; }
.discography { background: var(--inset); border: 1px solid var(--line); margin-top: 12px; }
.discography summary { padding: 13px 15px; font-weight: 700; color: #e1e0f2; }
.discography-list { padding: 10px 15px; border-top: 1px solid var(--line); }
.discography-list ul { list-style: none; padding: 0; margin-top: 8px; }
.discography-list li { border-bottom: 1px solid var(--line); color: var(--soft); }
.discography-list li:last-child { border-bottom: 0; }
.discography-list li a { min-height: 42px; display: flex; padding: 5px 0; justify-content: space-between; gap: 9px; align-items: center; text-decoration: none; }
.discography-list li a:hover { color: var(--lime); }
.discography-list li strong { color: var(--ink); overflow-wrap: anywhere; }
.site-footer { display: flex; align-items: center; justify-content: space-between; min-height: 94px; border-top: 1px solid var(--line); margin-top: 37px; }
.site-footer .brand { font-size: 1.52rem; color: #d7d2e8; }
.motion-toggle::before { content: ""; width: 7px; height: 7px; background: var(--lime); }
.motion-toggle[aria-pressed=false]::before { background: #888799; }

dialog {
  width: min(470px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); overflow: auto;
  padding: 18px; color: var(--ink); background: #1a1d2b; border: 1px solid #77708e; box-shadow: 7px 7px #07090d;
}
dialog[open] { animation: panel-in .17s steps(5,end) both; }
dialog::backdrop { background: #080b12ce; }
dialog form { display: grid; gap: 9px; }
.dialog-top { display: flex; justify-content: space-between; gap: 8px; align-items: start; margin-bottom: 4px; }
.dialog-top h2 { font-size: 2.2rem; line-height: .99; }
.dialog-top button { min-width: 44px; font-size: 1.35rem; }
input, select { min-height: 44px; padding: 7px 9px; color: var(--ink); background: #111622; border: 1px solid #51586e; border-radius: 0; max-width: 100%; }
input::placeholder { color: #a4aaba; }
#join-code { text-transform: uppercase; letter-spacing: .16em; }
.check-label { display: flex; align-items: center; gap: 8px; min-height: 36px; color: var(--soft); font-size: .9rem; }
.check-label input { min-height: auto; width: 17px; height: 17px; accent-color: var(--lime); }
.feedback { color: var(--amber); font-size: .92rem; overflow-wrap: anywhere; }
.feedback:empty { display: none; }

.room-section { border: 1px solid #77708e; background: #171b28; padding: 15px; margin-top: 18px; animation: panel-in .17s steps(5,end) both; scroll-margin-top: 12px; }
.room-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; align-items: center; }
.room-head h2 { font-size: clamp(1.87rem,4vw,3.1rem); line-height: .97; }
.room-head p { margin-top: 7px; color: var(--soft); }
.room-controls, .tool-row { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.room-layout { margin-top: 13px; display: grid; grid-template-columns: minmax(0,1.65fr) minmax(250px,1fr); gap: 13px; }
.room-side, .game-area { border: 1px solid var(--line); background: var(--inset); min-width: 0; padding: 12px; }
.room-side section + section { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 11px; }
.room-side h3 { font-size: 1.38rem; margin-bottom: 6px; }
.player-list { display: grid; gap: 4px; font-size: .92rem; }
.player-list li { display: flex; justify-content: space-between; gap: 6px; overflow-wrap: anywhere; }
.player-list small { color: var(--soft); }
.chat-messages { list-style: none; padding: 0; max-height: 167px; overflow-y: auto; overflow-wrap: anywhere; margin-bottom: 7px; }
.chat-messages li { margin: 4px 0; font-size: .88rem; color: var(--soft); }
.chat-messages strong { color: var(--pink); }
#chat-form { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 5px; }
#chat-form input { min-width: 0; }
#chat-form button { padding-inline: 6px; font-size: .81rem; }
.game-area { display: grid; align-content: start; gap: 10px; }
.game-area h3 { font-size: 1.4rem; line-height: 1.14; }
.game-area p { color: var(--soft); line-height: 1.4; }
.game-area > .button { justify-self: start; }
.pixel-board {
  display: block; width: min(100%, 552px); height: auto; aspect-ratio: 3/2;
  image-rendering: pixelated; touch-action: none; background: #20182b; border: 1px solid #746191;
}
.swatch { width: 44px; height: 44px; min-height: 44px; border: 2px solid var(--line); padding: 5px; background: #161824; }
.swatch::before { content: ""; display: block; width: 100%; height: 100%; background: var(--swatch); }
.swatch[aria-pressed=true] { border-color: var(--lime); }
.answer-result { font-weight: 740; color: var(--lime) !important; }

@keyframes tile-float { to { transform: translateY(-5px); } }
@keyframes panel-in { from { opacity: .3; transform: translateY(9px); } }
html[data-motion=off] *, html[data-motion=off] *::before, html[data-motion=off] *::after { animation: none !important; transition: none !important; }
@media (max-width: 940px) {
  .shell { width: calc(100% - 36px); }
  .club-layout, .room-layout { grid-template-columns: minmax(0,1fr); }
  .open-panel { min-height: 118px; }
}
@media (max-width: 590px) {
  .shell { width: calc(100% - 24px); }
  .masthead { min-height: 69px; flex-wrap: wrap; padding-block: 8px; gap: 0 8px; }
  .masthead .brand { font-size: 1.56rem; }
  .main-nav { order: 3; width: 100%; gap: 14px; }
  .main-nav a { padding-inline: 2px; font-size: .87rem; }
  .profile-button { max-width: 125px; font-size: .86rem; }
  .club-layout { margin-top: 22px; }
  .mini-grid { grid-template-columns: 1fr; }
  .mini-card { min-height: 0; padding: 12px; grid-template-columns: 41px 1fr; }
  .mini-card canvas { grid-row: span 2; width: 39px; height: 39px; }
  .mini-card .button { grid-column: 2; }
  .section-title { margin-bottom: 9px; }
  .room-section { padding: 8px; }
  .room-side, .game-area { padding: 8px; }
  .site-footer { min-height: 75px; }
}
