:root { color-scheme: dark; font-family: Arial, sans-serif; color: #edf0ff; background: #090a13; font-size: 18px; --neon: #a88aff; --cyan: #8ba8ff; --muted: #a7afcc; }
/* Главное меню и общий список живых игровых сессий. */
.home-panel h2 { margin-bottom: 30px; font-weight: 550; letter-spacing: -.03em; }
#continue { width: 100%; margin-top: 24px; border-radius: 9px; }
#name { border-radius: 9px; }
.main-menu { width: min(440px, 100%); margin: clamp(50px, 10vh, 110px) auto; }
.menu-eyebrow { font-size: .6rem; font-weight: 600; letter-spacing: .18em; color: #9298b4; }
.main-menu h2 { font-size: clamp(1.7rem, 4vw, 2.3rem); letter-spacing: -.04em; font-weight: 500; margin: 16px 0 12px; }
#welcome-name { margin: 0 0 38px; color: #a7aec8; overflow-wrap: anywhere; }
.menu-buttons { display: grid; gap: 12px; }
.menu-buttons button { display: flex; justify-content: space-between; align-items: center; padding: 20px 23px; border-radius: 11px; min-height: 65px; font-weight: 550; }
.menu-buttons #menu-play { background: linear-gradient(115deg, #b4a1e0, #8d9acb); border-color: #baa9e0; }
.menu-buttons #menu-play:hover { background: linear-gradient(115deg, #c6b5ed, #a0aedc); }
.menu-buttons #training { background: #121522; color: #9298b0; border-color: #2b3045; opacity: 1; cursor: default; }
#training span { font-size: .6rem; font-weight: 400; color: #747d9d; border: 1px solid #353a51; border-radius: 20px; padding: 5px 10px; }
.menu-buttons #menu-exit { border-color: #2d334a; color: #a4abc3; }
.directory-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 36px 0 30px; }
.directory-heading h2 { margin: 9px 0; font-size: 1.65rem; font-weight: 500; letter-spacing: -.03em; }
#directory-status { margin: 0; font-size: .65rem; color: #8a93b0; }
.create-game { display: flex; align-items: center; justify-content: space-between; gap: 28px; background: #234b43; color: #c9e2da; border: 1px solid #426f62; border-radius: 10px; padding: 15px 20px; font-weight: 500; font-size: .85rem; white-space: nowrap; }
.create-game:hover { background: #2b5b50; box-shadow: 0 0 24px #477b5e18; border-color: #638e7c; }
.directory-columns, .lobby-card { display: grid; grid-template-columns: minmax(150px, 1.1fr) minmax(135px, 1fr) minmax(130px, 1fr) minmax(135px, 1fr) 100px; gap: 14px; align-items: center; }
.directory-columns { padding: 0 20px 12px; color: #727c9a; font-size: .6rem; }
#lobby-cards { display: grid; gap: 10px; }
.lobby-card { background: linear-gradient(105deg, #141827, #101421); border: 1px solid #2c344c; border-radius: 12px; padding: 16px 20px; min-height: 105px; animation: lobby-appear .22s ease-out; }
.lobby-card.invited { border-color: #7b75a1; box-shadow: 0 0 22px #9381c20c; }
.lobby-type, .lobby-time { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lobby-type strong, .lobby-time strong { font-weight: 500; color: #d7dcef; font-size: .72rem; }
.lobby-status, .lobby-time > span { font-size: .57rem; color: #7e89a6; line-height: 1.45; }
.lobby-status.playing { color: #b4a4dd; }
.lobby-seat { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; column-gap: 7px; row-gap: 4px; min-width: 0; padding: 12px 8px; border: 1px solid transparent; border-radius: 9px; color: #c7cee4; font-size: .73rem; font-weight: 500; text-align: left; background: transparent; }
.lobby-seat > span { overflow-wrap: anywhere; }
.seat-checker { width: 28px; height: 28px; grid-row: 1 / 3; }
.lobby-seat small { grid-column: 2; font-size: .52rem; color: #7885a5; font-weight: 400; }
.vacant-slot { border: 1px dashed #47577d; background: #8c9acb08; }
.vacant-slot:hover, .return-slot:hover { border-color: #9d99c6; background: #8f96cf14; box-shadow: 0 0 17px #8097bd12; }
.vacant-slot > span, .return-slot > span { color: #bac9ed; }
.return-slot { border: 1px solid #666182; }
.watch-game { min-height: 38px; padding: 9px 12px; font-size: .65rem; border-radius: 8px; border-color: #414c6b !important; }
.directory-empty { text-align: center; border: 1px dashed #303950; border-radius: 14px; padding: 65px 20px; margin: 0 0 18px; color: #7d89a7; }
.directory-empty h3 { color: #bbc4de; font-weight: 500; margin: 0 0 14px; }
.directory-empty p { font-size: .8rem; margin: 0; }
.list-back { font-size: .75rem; margin-top: 28px; border-radius: 9px; }
.invite-notice { color: #b2b6d3; background: #a88aff0a; border: 1px solid #494568; padding: 13px 17px; border-radius: 9px; font-size: .72rem; }
.close-lobby { margin-top: 10px; color: #ac899b !important; border-color: #554051 !important; font-size: .72rem; }
@keyframes lobby-appear { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 900px) { .directory-columns { display: none; } .lobby-card { grid-template-columns: minmax(100px, 1fr) minmax(110px, 1fr) minmax(110px, 1fr) 90px; gap: 10px; padding: 14px; } .lobby-type { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; padding-bottom: 10px; border-bottom: 1px solid #283148; } }
@media (max-width: 560px) { .directory-heading { align-items: stretch; flex-direction: column; gap: 18px; } .create-game { width: 100%; } .lobby-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .lobby-time { grid-row: 3; } .lobby-seat { padding: 10px 6px; } .watch-game { grid-column: 2; grid-row: 3; justify-self: end; min-width: 100px; } .lobby-type { align-items: start; gap: 15px; } .lobby-status { text-align: right; } }
@media (prefers-reduced-motion: reduce) { .lobby-card { animation: none; } }
* { box-sizing: border-box; }
body { margin: 0; padding: 32px 20px; background: radial-gradient(ellipse at top right, #151731 0, transparent 50%); min-height: 100vh; }
main { max-width: 1060px; margin: 0 auto; }
.page-header { display: flex; gap: 14px; align-items: center; padding: 12px 0 28px; border-bottom: 1px solid #292d47; margin-bottom: 28px; }
.brand-mark { color: var(--neon); font-size: 2rem; font-weight: bold; }
h1 { font-size: 1.55rem; margin: 0; }
.header-label { margin-left: auto; color: var(--muted); font-size: .85rem; }
h2 { font-size: 1.45rem; margin: 0 0 8px; overflow-wrap: anywhere; }
h3 { font-size: 1.05rem; margin: 0 0 20px; }
p, li { line-height: 1.5; overflow-wrap: anywhere; }
.panel { background: #121421; border: 1px solid #303550; border-radius: 10px; padding: 28px; }
.home-panel { max-width: 460px; margin: 64px auto; border-top: 2px solid var(--neon); }
label { display: block; margin: 20px 0 9px; line-height: 1.4; font-size: .9rem; }
input, select { width: 100%; min-height: 48px; padding: 12px; font: inherit; font-size: .9rem; color: #edf0ff; background: #0b0d18; border: 1px solid #4a5275; border-radius: 5px; }
select { cursor: pointer; }
button { min-height: 48px; padding: 12px 18px; font: inherit; font-size: .95rem; font-weight: bold; color: #100b22; background: var(--neon); border: 1px solid var(--neon); border-radius: 5px; cursor: pointer; }
button:hover { background: #c8b4ff; box-shadow: 0 0 20px #a88aff20; }
button.secondary { color: #e0e6ff; background: transparent; border-color: #566086; font-weight: normal; }
button.secondary:hover { color: var(--cyan); border-color: var(--cyan); background: #20243e; }
button:disabled { opacity: .6; cursor: wait; }
fieldset:disabled select { opacity: 1; color: #c8d0eb; border-color: #313850; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.actions button { flex: 1 1 150px; }
#play { width: 100%; }
#message { color: #d7bcff; padding: 12px 16px; background: #251c38; border: 1px solid #65518c; border-radius: 5px; }
#message:empty { display: none; }
#main-link { display: inline-block; margin-top: 20px; }
a { color: var(--cyan); }
.note, .field-hint { color: var(--muted); font-size: .85rem; }
.room-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
#role { color: var(--muted); margin: 0; }
#sync-status { color: var(--cyan); font-size: .85rem; text-align: right; }
#sync-status.offline { color: #d7bcff; }
.lobby-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 20px; }
.members-panel { align-self: start; }
#count { color: var(--muted); font-weight: normal; }
#players { padding: 0; margin: 0; list-style: none; }
#players li { padding: 14px 0; border-bottom: 1px solid #292e48; }
.player-name { display: block; }
.player-role { display: block; font-size: .8rem; color: var(--muted); margin-top: 4px; }
.player-role.admin { color: var(--neon); }
#waiting { font-size: .85rem; color: var(--cyan); }
#spectators { font-size: .85rem; color: var(--muted); }
.invite { border-top: 1px solid #292e48; margin-top: 28px; padding-top: 4px; }
.invite .note { margin-top: 0; }
#room-link { font-size: .8rem; }
#leave { width: 100%; margin-top: 24px; }
.settings-panel { border-top: 2px solid var(--cyan); }
#settings-access { margin: -8px 0 20px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset > label:first-child { margin-top: 0; }
.field-hint { margin: 8px 0 0; font-size: .8rem; }
.stage-note { margin-bottom: 0; }
[hidden] { display: none !important; }
@media (max-width: 760px) { body { padding: 18px 14px; } .lobby-grid { grid-template-columns: 1fr; } .panel { padding: 22px; } .room-header { align-items: flex-start; flex-direction: column; gap: 12px; } #sync-status { text-align: left; } .home-panel { margin-top: 32px; } }
@media (max-width: 420px) { h1 { font-size: 1.2rem; } .header-label { display: none; } .panel { padding: 18px; } }

.setting-group { margin: 22px 0 0; }
.setting-group:first-child { margin-top: 0; }
.setting-group legend { padding: 0; font-size: .9rem; margin-bottom: 10px; }
.choice-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
button.choice { flex: 1 1 140px; color: #cdd5f0; background: #0b0d18; border: 1px solid #414867; font-weight: normal; font-size: .85rem; line-height: 1.4; }
button.choice:hover { border-color: #b5a0ff; background: #20243e; }
button.choice[aria-pressed="true"] { color: #faf8ff; background: #30234e; border-color: #b5a0ff; box-shadow: 0 0 0 1px #b5a0ff55, 0 0 20px #9b7aff35, inset 0 0 15px #9b7aff18; }
button.choice:disabled { opacity: 1; cursor: default; }
#settings-fields.readonly button.choice:not([aria-pressed="true"]) { color: #a7afcc; border-color: #303550; }
#settings-fields.saving { opacity: .75; }
#settings-fields.readonly button.choice:hover { background: #0b0d18; }
#settings-fields.readonly button.choice[aria-pressed="true"]:hover { background: #30234e; }
#players li.vacant .player-name { color: #a7afcc; }

.theme-hint { margin: 0 0 12px; }
.theme-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
button.theme-choice { padding: 12px; text-align: left; min-width: 0; }
.theme-name { display: block; margin-top: 10px; font-weight: bold; }
.theme-caption { display: block; margin-top: 4px; font-size: .7rem; color: var(--muted); }
.theme-sample { display: block; width: 100%; }
.board-image { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: contain; border-radius: 3px; }
.theme-pieces { display: flex; justify-content: space-around; gap: 8px; margin-top: 8px; }
.piece-pair { display: flex; align-items: center; justify-content: center; gap: 2px; width: 43%; }
.piece-pair img { display: block; width: 50%; height: auto; aspect-ratio: 1; object-fit: contain; }
@media (max-width: 420px) { .theme-grid { gap: 8px; } button.theme-choice { padding: 8px; } .theme-name { font-size: .75rem; } .theme-caption { font-size: .65rem; } }

#ready { width: 100%; margin-top: 24px; }
#ready[aria-pressed="true"] { box-shadow: 0 0 22px #a88aff70; }
#ready-hint { margin-bottom: 0; }
