[hidden] { display: none !important; }
.entry-page { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr); }
.entry-visual { position: relative; z-index: 0; display: flex; flex-direction: column; isolation: isolate; overflow: hidden; padding: clamp(22px, 4vw, 46px) clamp(28px, 6vw, 72px) clamp(38px, 6vw, 64px); background: var(--surface); border-inline-start: 1px solid var(--border); }
.entry-visual::after { content: ''; position: absolute; z-index: -1; inset: 0; background-image: linear-gradient(rgb(119 150 255 / .055) 1px, transparent 1px), linear-gradient(90deg, rgb(119 150 255 / .055) 1px, transparent 1px); background-size: 52px 52px; mask-image: linear-gradient(180deg, transparent, black 40%, transparent 100%); pointer-events: none; }
.entry-visual__backdrop { position: absolute; z-index: -2; inset: 0; overflow: hidden; pointer-events: none; }
.entry-visual__backdrop::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(5 11 30 / .58), rgb(5 11 30 / .78) 46%, rgb(5 11 30 / .95) 100%), linear-gradient(180deg, rgb(5 11 30 / .48), transparent 38%, rgb(5 11 30 / .88)); }
.entry-visual__image { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; filter: saturate(.92) contrast(1.05); transform: scale(1.035); }
.entry-header { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: clamp(24px, 5vw, 48px); }
.entry-header__actions { min-width: 0; }
.back-link { color: var(--muted); font-size: .88rem; }
.entry-intro { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.entry-bomb { display: grid; place-items: center; width: 72px; height: 72px; margin-bottom: 12px; border: 1px solid color-mix(in srgb, var(--game-accent, var(--blue)) 42%, transparent); border-radius: 22px; background: rgb(5 11 30 / .66); box-shadow: 0 16px 42px rgb(0 0 0 / .28); backdrop-filter: blur(10px); font-size: clamp(2.25rem, 5vw, 3rem); }
.entry-visual h1 { margin: 4px 0 0; font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1.1; white-space: nowrap; }
.entry-visual p { color: #c2cce2; font-size: .98rem; line-height: 1.9; max-width: 540px; text-shadow: 0 3px 16px rgb(0 0 0 / .75); }
.entry-rules { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.entry-rules span { padding: 7px 13px; border: 1px solid rgb(255 255 255 / .14); border-radius: 999px; color: #c9d3e8; background: rgb(5 11 30 / .54); backdrop-filter: blur(8px); font-size: .78rem; }
.entry-card { align-self: center; width: min(450px, calc(100% - 38px)); margin: 40px auto; padding: clamp(24px, 5vw, 34px); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); box-shadow: 0 24px 70px rgb(0 0 0 / .22); }
.entry-card__title { font-size: 1.35rem; font-weight: 800; }
.entry-card > p { margin: 8px 0 0; color: var(--muted); line-height: 1.8; font-size: .86rem; }
.entry-progress { display: grid; grid-template-columns: max-content minmax(24px, 1fr) max-content; align-items: center; gap: 9px; margin: 24px 0 20px; color: var(--muted); font-size: .72rem; }
.entry-progress__step { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.entry-progress__number { display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid var(--border-strong); border-radius: 50%; font-weight: 900; }
.entry-progress__line { height: 1px; background: var(--border); }
.entry-progress__step--active { color: var(--text); }
.entry-progress__step--active .entry-progress__number { color: var(--text); border-color: var(--game-accent, var(--blue)); background: color-mix(in srgb, var(--game-accent, var(--blue)) 18%, transparent); }
.entry-progress__step--complete { color: var(--teal); }
.entry-progress__step--complete .entry-progress__number { color: #031421; border-color: var(--teal); background: var(--teal); }
.entry-step { padding: 18px; border: 1px solid var(--border); border-radius: calc(var(--radius-sm) + 2px); background: rgb(5 11 30 / .24); }
.entry-step + .entry-step { margin-top: 12px; animation: entry-reveal .22s ease-out; }
.entry-step__heading { display: flex; align-items: flex-start; gap: 10px; }
.entry-step__badge { display: grid; flex: 0 0 auto; place-items: center; width: 27px; height: 27px; margin-top: 1px; border-radius: 8px; color: var(--text); background: color-mix(in srgb, var(--game-accent, var(--blue)) 26%, transparent); font-size: .78rem; font-weight: 900; }
.entry-step__heading h2 { margin: 0; font-size: .96rem; }
.entry-step__heading p { margin: 4px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.7; }
.nickname-editor { margin-top: 14px; }
.nickname-editor__actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.nickname-editor__actions .field { min-width: 0; }
.game-entry__continue { min-width: 82px; }
.field-help { margin: 7px 2px 0; color: var(--muted); font-size: .68rem; line-height: 1.6; }
.join-form { display: grid; gap: 8px; }
.join-form .field-label { margin: 0; }
.join-form__actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.join-form__actions .button { white-space: nowrap; }
.field-label { display: block; margin: 14px 0 7px; font-size: .82rem; color: var(--muted); }
.field { width: 100%; height: 48px; padding: 0 15px; color: var(--text); outline: none; border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgb(5 11 30 / .55); }
.field:focus { border-color: var(--game-accent, var(--blue)); box-shadow: 0 0 0 3px rgb(var(--blue-rgb) / .18); }
.field--code { text-align: center; letter-spacing: .18em; font-weight: 900; text-transform: uppercase; }
.saved-nickname { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgb(5 11 30 / .35); color: var(--muted); font-size: .86rem; }
.saved-nickname__check { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: #031421; background: var(--teal); font-size: .72rem; font-weight: 1000; }
.saved-nickname__value { min-width: 0; overflow: hidden; color: var(--text); text-overflow: ellipsis; white-space: nowrap; }
.saved-nickname__edit { margin-inline-start: auto; padding: 5px 9px; border: 0; color: var(--game-accent, var(--blue-soft)); background: transparent; cursor: pointer; }
.play-mode-list { display: grid; gap: 9px; margin-top: 14px; }
.play-mode { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; min-height: 68px; padding: 10px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); text-align: start; background: rgb(5 11 30 / .42); cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.play-mode:hover { border-color: var(--border-strong); background: rgb(255 255 255 / .045); transform: translateY(-1px); }
.play-mode:focus-visible { outline: 3px solid rgb(var(--blue-rgb) / .24); border-color: var(--game-accent, var(--blue)); }
.play-mode:disabled, .private-action:disabled { opacity: .55; cursor: wait; transform: none; }
.play-mode--quick { border-color: color-mix(in srgb, var(--game-accent, var(--blue)) 46%, transparent); background: color-mix(in srgb, var(--game-accent, var(--blue)) 13%, transparent); }
.play-mode--selected { border-color: var(--game-accent, var(--blue)); background: color-mix(in srgb, var(--game-accent, var(--blue)) 14%, transparent); }
.play-mode__icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: rgb(255 255 255 / .07); font-size: 1.15rem; }
.play-mode--quick .play-mode__icon { background: color-mix(in srgb, var(--game-accent, var(--blue)) 28%, transparent); }
.play-mode__copy { display: grid; gap: 3px; min-width: 0; }
.play-mode__copy strong { font-size: .9rem; }
.play-mode__copy small { overflow: hidden; color: var(--muted); font-size: .68rem; line-height: 1.55; text-overflow: ellipsis; }
.play-mode__arrow { color: var(--muted); font-size: 1.05rem; }
.play-mode--selected .play-mode__arrow { color: var(--game-accent, var(--blue-soft)); transform: rotate(180deg); }
.private-options { margin-top: 10px; padding: 15px; border: 1px solid color-mix(in srgb, var(--game-accent, var(--blue)) 32%, transparent); border-radius: var(--radius-sm); background: rgb(5 11 30 / .5); animation: entry-reveal .22s ease-out; }
.private-options__header h3 { margin: 0; font-size: .9rem; outline: none; }
.private-options__header p { margin: 4px 0 13px; color: var(--muted); font-size: .7rem; line-height: 1.65; }
.private-action { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; width: 100%; min-height: 58px; padding: 9px 11px; border: 1px solid rgb(var(--teal-rgb) / .35); border-radius: var(--radius-sm); color: var(--text); text-align: start; background: rgb(var(--teal-rgb) / .1); cursor: pointer; }
.private-action:hover { border-color: rgb(var(--teal-rgb) / .65); background: rgb(var(--teal-rgb) / .15); }
.private-action:focus-visible { outline: 3px solid rgb(var(--teal-rgb) / .22); border-color: var(--teal); }
.private-action__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: var(--teal); background: rgb(var(--teal-rgb) / .12); font-size: 1.2rem; }
.private-action__copy { display: grid; gap: 2px; }
.private-action__copy strong { font-size: .84rem; }
.private-action__copy small { color: var(--muted); font-size: .66rem; line-height: 1.5; }
.private-options__divider { display: flex; align-items: center; gap: 10px; margin: 12px 0; color: var(--muted); font-size: .65rem; }
.private-options__divider::before, .private-options__divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.button--busy::after { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: game-spin .7s linear infinite; }
.room-page { position: fixed; inset: 0; overflow: hidden; background: var(--bg); direction: ltr; touch-action: none; }
.arena-canvas { position: absolute; inset: 0; }
.arena-canvas canvas { display: block !important; }
.arena-overlay { position: absolute; inset: 0; pointer-events: none; direction: rtl; }
.arena-overlay button, .lobby-panel, .matchmaking-panel, .joystick, .game-over, .snake-dpad { pointer-events: auto; }
.room-brand { position: absolute; inset-block-start: 18px; inset-inline-start: 20px; padding: 7px 11px; border-radius: var(--radius-sm); background: rgb(5 11 30 / .78); border: 1px solid var(--border); backdrop-filter: blur(8px); }
.room-leave { position: absolute; z-index: 15; inset-block-end: 18px; inset-inline-end: 20px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--muted); background: rgb(5 11 30 / .82); padding: 9px 14px; cursor: pointer; }
.lobby-panel, .matchmaking-panel { position: absolute; inset-block-start: 50%; inset-inline-end: clamp(14px, 4vw, 55px); transform: translateY(-50%); width: min(380px, calc(100vw - 28px)); max-height: calc(100dvh - 52px); overflow: auto; padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: rgb(10 19 48 / .94); backdrop-filter: blur(12px); }
.lobby-kicker { color: var(--game-accent, var(--blue-soft)); font-size: .72rem; font-weight: 900; }
.lobby-code-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 9px; color: var(--muted); font-size: .8rem; padding: 14px 0 16px; border-bottom: 1px solid var(--border); }
.lobby-code-row strong { color: var(--text); letter-spacing: .16em; font-size: 1.05rem; }
.icon-button { border: 0; color: var(--blue-soft); background: transparent; cursor: pointer; }
.lobby-invite { padding: 13px 0 11px; border-bottom: 1px solid var(--border); }
.lobby-invite__header { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .75rem; }
.lobby-invite__link { display: block; margin-top: 7px; overflow: hidden; padding: 9px 10px; border: 1px solid var(--border); border-radius: 9px; color: var(--blue-soft); background: rgb(5 11 30 / .42); font-size: .69rem; text-overflow: ellipsis; white-space: nowrap; }
.lobby-invite__link:hover { border-color: var(--border-strong); }
.lobby-invite__link:focus-visible, .icon-button:focus-visible { outline: 3px solid rgb(var(--blue-rgb) / .2); border-radius: 7px; }
.lobby-heading { display: flex; align-items: center; justify-content: space-between; }
.lobby-heading h2 { font-size: 1rem; }
.lobby-heading span, .lobby-help { color: var(--muted); font-size: .75rem; }
.lobby-players { display: grid; gap: 8px; }
.lobby-player { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; min-height: 44px; padding: 7px 10px; border: 1px solid transparent; border-radius: var(--radius-sm); background: rgb(255 255 255 / .035); }
.lobby-player--me { border-color: color-mix(in srgb, var(--game-accent, var(--blue)) 45%, transparent); }
.player-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--player-color); }
.lobby-player__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }
.mini-badge { font-size: .62rem; color: var(--amber); }
.ready-state { color: var(--muted); font-size: .68rem; }
.ready-state--yes { color: var(--teal); }
.lobby-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.lobby-actions .button:last-child { grid-column: 1 / -1; }
.button--ready { color: var(--teal); border-color: rgb(var(--teal-rgb) / .38); background: rgb(var(--teal-rgb) / .10); }
.matchmaking-panel { inset-inline-start: 50%; inset-inline-end: auto; transform: translate(-50%, -50%); text-align: center; }
.matchmaking-panel h2 { margin: 8px 0; }
.matchmaking-panel strong { display: block; font-size: 1.5rem; color: var(--game-accent, var(--blue-soft)); }
.matchmaking-panel p { color: var(--muted); }
.matchmaking-spinner { width: 48px; height: 48px; margin: 0 auto 16px; border-radius: 50%; border: 4px solid var(--border); border-top-color: var(--game-accent, var(--blue)); animation: game-spin .8s linear infinite; }
.game-hud { position: absolute; inset: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 18px; }
.hud-pill, .hud-code { border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgb(5 11 30 / .82); backdrop-filter: blur(8px); padding: 9px 13px; color: var(--muted); font-size: .76rem; }
.hud-stack { display: flex; gap: 8px; align-items: center; }
.survival-hud > .hud-stack, .snake-hud > .hud-stack, .territory-hud > .hud-stack { flex: 1 1 auto; min-width: 0; max-width: calc(100% - 84px); flex-wrap: wrap; }
.room-page:is([data-status="playing"], [data-status="over"], [data-status="finished"]) .room-brand { display: none; }
.hud-code { color: var(--game-accent, var(--blue-soft)); cursor: pointer; }
.connection { color: var(--teal); }
.connection--offline { color: var(--red-soft); }
.countdown-overlay { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text); background: rgb(5 11 30 / .42); font-size: clamp(7rem, 25vw, 17rem); font-weight: 1000; }
.connection-banner { position: absolute; inset-block-end: 19px; inset-inline-start: 50%; transform: translateX(-50%); padding: 10px 15px; border-radius: var(--radius-sm); background: rgb(var(--red-rgb) / .92); font-size: .77rem; }
.game-over { position: absolute; z-index: 30; inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: min(440px, calc(100vw - 30px)); padding: 30px; text-align: center; border: 1px solid var(--border); border-radius: var(--radius); background: rgb(10 19 48 / .97); }
.game-over__icon { font-size: 3.2rem; }
.game-over h2 { margin: 8px 0; }
.game-over p { color: var(--muted); }
.winner-name { color: var(--game-accent, var(--blue-soft)); }
.game-over__actions { display: grid; gap: 9px; }
.orientation-overlay { display: none; position: absolute; inset: 0; z-index: 100; place-content: center; justify-items: center; gap: 8px; text-align: center; background: var(--bg); }
.orientation-phone { font-size: 3.2rem; color: var(--game-accent, var(--blue-soft)); }
.orientation-overlay span { color: var(--muted); }
.joystick { position: absolute; z-index: 20; inset-inline-start: max(22px, env(safe-area-inset-left)); inset-block-end: max(24px, env(safe-area-inset-bottom)); width: 132px; height: 132px; border-radius: 50%; opacity: .58; touch-action: none; }
.joystick__ring { position: absolute; inset: 0; border: 2px solid rgb(255 255 255 / .28); border-radius: 50%; background: rgb(5 11 30 / .38); }
.joystick__knob { position: absolute; width: 58px; height: 58px; border-radius: 50%; inset: calc(50% - 29px); background: color-mix(in srgb, var(--game-accent, var(--blue)) 55%, transparent); border: 2px solid rgb(255 255 255 / .5); }
@keyframes game-spin { to { transform: rotate(360deg); } }
@keyframes entry-reveal { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }
@media (max-width: 880px) { .entry-page { grid-template-columns: 1fr; } .entry-visual { min-height: 54vh; border-inline-start: 0; border-block-end: 1px solid var(--border); padding: 20px 24px 38px; } .entry-visual__backdrop::after { background: linear-gradient(90deg, rgb(5 11 30 / .66), rgb(5 11 30 / .87) 72%, rgb(5 11 30 / .96)), linear-gradient(180deg, rgb(5 11 30 / .58), transparent 35%, rgb(5 11 30 / .94)); } .entry-visual__image { object-position: center; } .entry-card { margin-block: 24px 50px; } .game-hud { padding: 10px; } }
@media (max-width: 420px) { .entry-card { width: min(100% - 22px, 450px); padding: 20px 16px; } .entry-progress { font-size: .66rem; } .entry-step { padding: 15px 13px; } .join-form__actions { grid-template-columns: 1fr; } .join-form__actions .button { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .entry-step + .entry-step, .private-options { animation: none; } .play-mode { transition: none; } }
@media (max-width: 560px) and (orientation: landscape) { .game-hud { gap: 6px; padding: 8px; } .hud-stack { gap: 6px; } .hud-pill { padding: 8px 10px; } }
@media (orientation: portrait) and (max-width: 600px) { .orientation-overlay { display: grid; } }
@media (orientation: portrait) and (pointer: coarse) { .orientation-overlay { display: grid; } }
