:root {
    --bg: #060811;
    --panel: rgba(16, 20, 34, .78);
    --panel-2: rgba(255, 255, 255, .055);
    --line: rgba(255, 255, 255, .10);
    --text: #f7f8fc;
    --muted: #959bad;
    --purple: #8b5cf6;
    --purple-2: #a78bfa;
    --green: #22c55e;
    --red: #ef4444;
    --amber: #f59e0b;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at 50% -15%, #2a1655 0, #0c1020 35%, var(--bg) 72%);
    color: var(--text);
    overflow-x: hidden;
}

button,
input,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.ambient {
    position: fixed;
    width: 420px;
    height: 420px;
    border-radius: 999px;
    filter: blur(100px);
    opacity: .12;
    pointer-events: none;
    z-index: -1;
    animation: drift 12s ease-in-out infinite alternate;
}

.ambient-one {
    top: 10%;
    left: -150px;
    background: #7c3aed;
}

.ambient-two {
    right: -180px;
    bottom: 5%;
    background: #2563eb;
    animation-delay: -5s;
}

@keyframes drift {
    to {
        transform: translate3d(55px, -28px, 0) scale(1.12);
    }
}

.site-header {
    position: fixed;
    z-index: 50;
    top: 0;
    left: 0;
    right: 0;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(18px, 4vw, 56px);
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    background: rgba(6, 8, 17, .62);
    backdrop-filter: blur(22px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: #fff;
    text-decoration: none;
    font-size: 20px;
    font-weight: 950;
    letter-spacing: -.5px;
}

.brand-mark {
    width: 35px;
    height: 35px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    box-shadow: 0 10px 28px rgba(139, 92, 246, .3);
    font-weight: 1000;
}

.header-actions,
.toolbar-actions,
.room-mini-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-action-button {
    width: 42px;
    height: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;

    background: rgba(255, 255, 255, 0.06);
    color: #fff;

    cursor: pointer;
}

.primary-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 13px;
    padding: 14px 20px;
    font-weight: 900;
    border: 1px solid transparent;
    transition: transform .18s ease, background .18s ease, border-color .18s ease, opacity .18s ease;
}

.primary-button {
    color: #fff;
    background: linear-gradient(135deg, #8b5cf6, #7445ee);
    box-shadow: 0 12px 32px rgba(124, 58, 237, .25);
}

.primary-button:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #9f7aea, #8157f3);
}

.secondary-button {
    color: #fff;
    background: rgba(255, 255, 255, .06);
    border-color: var(--line);
}

.secondary-button:hover {
    background: rgba(255, 255, 255, .10);
}

.primary-button:disabled,
.secondary-button:disabled {
    cursor: not-allowed;
    opacity: .5;
    transform: none;
}

.compact-button {
    padding: 10px 14px;
    font-size: 12px;
    letter-spacing: .3px;
}

.compact-button svg,
.start-button svg {
    width: 18px;
    height: 18px;
}

.hero {
    min-height: 90vh;
    display: grid;
    place-items: center;
    padding: 130px 20px 50px;
}

.hero-content {
    width: 100%;
    max-width: 900px;
    text-align: center;
}

.badge {
    display: inline-flex;
    padding: 9px 15px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: #b8bdd0;
    background: rgba(255, 255, 255, .045);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .7px;
}

h1 {
    margin: 23px 0 0;
    font-size: clamp(44px, 8vw, 80px);
    line-height: .98;
    letter-spacing: -4px;
    font-weight: 950;
}

h1 span {
    display: block;
    color: #9d7cff;
}

.hero-description {
    margin: 25px auto;
    max-width: 610px;
    color: #979cad;
    font-size: 17px;
    line-height: 1.7;
}

.text-success {
    color: var(--green) !important;
}

.word-demo {
    position: relative;
    margin: 42px auto 0;
    width: min(100%, 430px);
    padding: 30px;
    border-radius: 28px;
    border: 1px solid var(--line);
    background: linear-gradient(145deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .035));
    backdrop-filter: blur(18px);
    text-align: left;
    box-shadow: 0 26px 80px rgba(0, 0, 0, .25);
}

.demo-word,
.demo-row {
    margin: 8px 0;
    font-size: 27px;
    font-weight: 950;
    letter-spacing: 3px;
    color: #afb4c4;
}

.demo-word:first-of-type {
    color: #fff;
}

.demo-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.previous-word {
    display: none;
    color: #fff;
    min-width: 105px;
}

.word-demo.assisted .previous-word {
    display: inline;
}

.demo-help-button {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 11px;
    background: #242837;
    color: #b8bdd0;
    font-weight: 900;
    transition: .2s ease;
}

.demo-help-button:hover {
    transform: scale(1.05);
    background: #303547;
}

.demo-help-button.active {
    background: rgba(245, 158, 11, .16);
    border-color: rgba(245, 158, 11, .45);
    color: #fbbf24;
}

.demo-caption {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, .07);
    color: #7f8699;
    font-size: 12px;
    font-weight: 700;
}

.pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #8b5cf6;
    box-shadow: 0 0 0 0 rgba(139, 92, 246, .5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    70% {
        box-shadow: 0 0 0 8px rgba(139, 92, 246, 0);
    }
}

.floating-join {
    position: fixed;
    z-index: 60;
    right: clamp(18px, 4vw, 56px);
    top: 88px;
    width: min(420px, calc(100vw - 36px));
    box-shadow: 0 24px 80px rgba(0, 0, 0, .4);
}

.join-panel {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(14, 18, 31, .96);
    backdrop-filter: blur(20px);
}

.join-panel-title {
    margin-bottom: 10px;
    color: #cbd0dd;
    font-size: 13px;
    font-weight: 800;
}

.join-room-form {
    display: flex;
    gap: 9px;
}

.join-room-form input,
.modal-card input,
.modal-card select {
    width: 100%;
    min-width: 0;
    padding: 14px 15px;
    border: 1px solid rgba(255, 255, 255, .11);
    border-radius: 13px;
    outline: none;
    background: #171c2b;
    color: white;
    transition: border-color .18s, box-shadow .18s;
}

.join-room-form input {
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: 4px;
}

.join-room-form input:focus,
.modal-card input:focus,
.modal-card select:focus,
.chain-input:focus,
.guess-input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, .10);
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 20px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .75);
    backdrop-filter: blur(12px);
}

.modal-card {
    position: relative;
    z-index: 2;
    width: min(100%, 430px);
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 25px;
    background: #101522;
    box-shadow: 0 30px 100px rgba(0, 0, 0, .5);
    animation: modalIn .24s ease both;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.98);
    }
}

.modal-card h2 {
    margin: 0;
    font-size: 28px;
}

.modal-card p {
    color: #9297a7;
}

.modal-card h3 {
    margin: 24px 0 10px;
    color: #b7bbca;
    font-size: 13px;
}

.modal-card input {
    margin: 14px 0 8px;
}

.modal-close {
    position: absolute;
    top: 13px;
    right: 15px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .07);
    color: #fff;
    font-size: 24px;
}

.modal-close:hover {
    background: rgba(255, 255, 255, .13);
}

.full {
    width: 100%;
    margin-top: 12px;
}

.option-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.option {
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 13px;
    color: white;
    background: #171d2b;
    font-weight: 800;
}

.option.active {
    background: rgba(139, 92, 246, .2);
    border-color: #8b5cf6;
    color: #c4b5fd;
}

body.modal-open {
    overflow: hidden;
}

.room-page {
    min-height: 100vh;
    padding: 112px 20px 44px;
    display: grid;
    place-items: start center;
}

.room-shell {
    width: min(1120px, 100%);
    border: 1px solid var(--line);
    border-radius: 30px;
    background: rgba(11, 15, 27, .72);
    backdrop-filter: blur(22px);
    box-shadow: 0 32px 100px rgba(0, 0, 0, .25);
    overflow: hidden;
}

.room-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 26px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.small-label,
.eyebrow {
    display: block;
    color: #777f94;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 2px;
}

.room-code-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
}

.room-code-button svg {
    width: 17px;
    color: #6f778c;
}

.room-code {
    display: inline-block;
    margin-top: 3px;
    font-size: 25px;
    font-weight: 950;
    letter-spacing: 5px;
    min-width: 128px;
}

.room-code-button.is-hidden-code .room-code {
    color: #7d8495;
}

.icon-button {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, .045);
    color: #b8becd;
    transition: .18s;
}

.icon-button svg {
    width: 19px;
    height: 19px;
}

.icon-button:hover,
.icon-button.active {
    color: #fff;
    border-color: rgba(139, 92, 246, .55);
    background: rgba(139, 92, 246, .15);
}

.status-pill,
.timer-pill {
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: #b6bdce;
    background: rgba(255, 255, 255, .05);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1px;
}

.timer-pill {
    min-width: 44px;
    text-align: center;
    color: #fff;
    font-size: 15px;
}

.timer-pill.danger {
    color: #fecaca;
    border-color: rgba(239, 68, 68, .4);
    background: rgba(239, 68, 68, .12);
    animation: pulseDanger .7s infinite alternate;
}

@keyframes pulseDanger {
    to {
        transform: scale(1.06);
    }
}

.versus {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
    padding: 28px 26px 12px;
}

.player-card {
    position: relative;
    min-height: 112px;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .035);
    transition: .2s;
}

.player-card.is-me {
    border-color: rgba(139, 92, 246, .28);
    background: rgba(139, 92, 246, .055);
}

.player-empty-card {
    color: #737b8e;
}

.empty-avatar {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border: 1px dashed #4a5162;
    border-radius: 17px;
    font-size: 24px;
}

.player-empty-card strong {
    display: block;
    color: #959bad;
}

.player-empty-card span {
    display: block;
    margin-top: 4px;
    font-size: 12px;
}

.avatar {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    font-weight: 950;
    font-size: 19px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15);
}

.avatar-violet {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
}

.avatar-cyan {
    background: linear-gradient(135deg, #06b6d4, #0e7490);
}

.avatar-rose {
    background: linear-gradient(135deg, #f43f5e, #be123c);
}

.avatar-amber {
    background: linear-gradient(135deg, #f59e0b, #b45309);
}

.avatar-emerald {
    background: linear-gradient(135deg, #10b981, #047857);
}

.avatar-indigo {
    background: linear-gradient(135deg, #6366f1, #4338ca);
}

.player-info {
    min-width: 0;
}

.player-name {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 18px;
    font-weight: 900;
}

.host-chip {
    padding: 4px 6px;
    border-radius: 7px;
    background: rgba(139, 92, 246, .15);
    color: #c4b5fd;
    font-size: 9px;
    letter-spacing: .7px;
}

.player-status {
    margin-top: 7px;
    color: #8e95a8;
    font-size: 12px;
}

.presence {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 6px;
    border-radius: 50%;
    background: #ef4444;
}

.presence.online {
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, .08);
}

.ready-state {
    margin-left: auto;
    color: #22c55e;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1px;
}

.kick-button {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #636b7e;
    opacity: 0;
    transition: .18s;
}

.player-card:hover .kick-button {
    opacity: 1;
}

.kick-button:hover {
    background: rgba(239, 68, 68, .12);
    color: #f87171;
}

.kick-button svg {
    width: 16px;
}

.vs {
    align-self: center;
    color: #7658d6;
    font-size: 15px;
    font-weight: 1000;
    letter-spacing: 1px;
}

.lobby-panel {
    padding: 10px 26px 30px;
    text-align: center;
}

.connection-status {
    color: #9aa1b2;
    font-size: 13px;
}

.start-button {
    margin: 18px auto 0;
    min-width: 220px;
}

.game-panel {
    margin: 18px 26px 28px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, .075);
    border-radius: 22px;
    background: rgba(255, 255, 255, .03);
    animation: panelIn .3s ease both;
}

@keyframes panelIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
}

.panel-heading h2,
.result-panel h2 {
    margin: 5px 0 0;
    font-size: 25px;
    letter-spacing: -.6px;
}

.panel-copy {
    margin: 10px 0 20px;
    color: #8f96a8;
    font-size: 13px;
    line-height: 1.6;
}

.validation-badge {
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: #8d95a6;
    font-size: 10px;
    font-weight: 800;
}

.validation-badge.valid {
    color: #86efac;
    border-color: rgba(34, 197, 94, .3);
    background: rgba(34, 197, 94, .08);
}

.validation-badge.invalid {
    color: #fca5a5;
    border-color: rgba(239, 68, 68, .3);
    background: rgba(239, 68, 68, .08);
}

.chain-builder {
    display: grid;
    gap: 9px;
    max-width: 720px;
}

.chain-row {
    display: grid;
    grid-template-columns: 35px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 8px;
    border: 1px solid transparent;
    border-radius: 14px;
    transition: .18s;
}

.chain-row.invalid {
    border-color: rgba(239, 68, 68, .45);
    background: rgba(239, 68, 68, .055);
}

.chain-index {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: rgba(255, 255, 255, .05);
    color: #70788a;
    font-size: 11px;
    font-weight: 900;
}

.chain-fixed,
.chain-input {
    min-height: 46px;
    border-radius: 12px;
}

.chain-fixed {
    display: flex;
    align-items: center;
    padding: 0 14px;
    border: 1px solid rgba(139, 92, 246, .22);
    background: rgba(139, 92, 246, .06);
    font-weight: 950;
    letter-spacing: 2px;
}

.chain-input,
.guess-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, .10);
    outline: 0;
    background: #111725;
    color: #fff;
    font-weight: 750;
}

.chain-input:disabled {
    opacity: .75;
    cursor: not-allowed;
}

.chain-ok {
    color: #6d7486;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 1px;
}

.validation-errors {
    margin-top: 15px;
    padding: 13px 15px;
    border: 1px solid rgba(239, 68, 68, .25);
    border-radius: 12px;
    background: rgba(239, 68, 68, .07);
    color: #fca5a5;
    font-size: 12px;
    line-height: 1.7;
}

.ready-button {
    margin-top: 20px;
    min-width: 180px;
}

.assist-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, .045);
    color: #adb4c5;
    font-size: 11px;
    font-weight: 850;
}

.assist-toggle.active {
    color: #fbbf24;
    border-color: rgba(245, 158, 11, .35);
    background: rgba(245, 158, 11, .09);
}

.solve-chain {
    display: grid;
    gap: 10px;
    margin-top: 22px;
}

.solve-row {
    display: grid;
    grid-template-columns: minmax(0, 135px) minmax(120px, 180px) minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 58px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 15px;
    background: rgba(255, 255, 255, .025);
}

.assist-previous {
    display: none;
    color: #fff;
    font-weight: 900;
    letter-spacing: 1.8px;
}

.solve-chain.assisted .assist-previous {
    display: inline;
}

.solve-chain:not(.assisted) .solve-row {
    grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
}

.hint-word {
    color: #b8bece;
    font-weight: 900;
    letter-spacing: 3px;
}

.guess-input {
    border-radius: 11px;
}

.solve-row.solved {
    border-color: rgba(34, 197, 94, .25);
    background: rgba(34, 197, 94, .05);
}

.solved-check {
    justify-self: end;
    color: #22c55e;
    font-size: 22px;
    font-weight: 1000;
}

.guess-input.wrong {
    border-color: #ef4444;
}

.shake {
    animation: shake .35s ease;
}

@keyframes shake {
    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-3px);
    }
}

.result-panel {
    text-align: center;
    padding: 46px 24px;
}

.result-panel p {
    color: #9ba2b4;
}

.inline-button {
    text-decoration: none;
    margin-top: 12px;
}

.countdown-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 20px;
    background: rgba(3, 5, 10, .78);
    backdrop-filter: blur(13px);
}

.countdown-ring {
    width: 150px;
    height: 150px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid rgba(139, 92, 246, .55);
    background: radial-gradient(circle, rgba(139, 92, 246, .18), rgba(139, 92, 246, .04));
    box-shadow: 0 0 80px rgba(139, 92, 246, .20), inset 0 0 35px rgba(139, 92, 246, .08);
}

.countdown-ring span {
    font-size: 76px;
    line-height: 1;
    font-weight: 1000;
}

.countdown-ring span.pop {
    animation: countPop .35s ease;
}

@keyframes countPop {
    from {
        transform: scale(1.35);
        opacity: .3;
    }
}

.countdown-label {
    color: #b8bfd1;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 1px;
}

.toast-stack {
    position: fixed;
    z-index: 900;
    right: 20px;
    bottom: 20px;
    display: grid;
    gap: 10px;
}

.toast {
    max-width: 340px;
    padding: 12px 15px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: rgba(16, 20, 34, .96);
    color: #d7dbea;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .3);
    transform: translateY(8px);
    opacity: 0;
    transition: .2s;
    font-size: 12px;
    font-weight: 750;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success {
    border-color: rgba(34, 197, 94, .3);
}

.toast-danger {
    border-color: rgba(239, 68, 68, .3);
}



@media (max-width: 760px) {
    .site-header {
        height: 68px;
        padding: 0 14px;
    }

    .brand {
        font-size: 17px;
    }

    .brand-mark {
        width: 31px;
        height: 31px;
    }

    .compact-button {
        padding: 9px 10px;
        font-size: 0;
    }

    .compact-button svg {
        width: 19px;
        height: 19px;
    }

    .hero {
        padding-top: 105px;
    }

    h1 {
        letter-spacing: -2.5px;
    }

    .floating-join {
        top: 78px;
        right: 14px;
    }

    .room-page {
        padding: 88px 10px 24px;
    }

    .room-shell {
        border-radius: 22px;
    }

    .room-toolbar {
        padding: 17px;
    }

    .versus {
        grid-template-columns: 1fr;
        padding: 18px 16px 8px;
    }

    .versus .vs {
        text-align: center;
        margin: -6px 0;
    }

    .player-card {
        min-height: 95px;
    }

    .game-panel {
        margin: 14px 14px 20px;
        padding: 18px;
    }

    .panel-heading {
        flex-direction: column;
    }

    .solve-row,
    .solve-chain:not(.assisted) .solve-row {
        grid-template-columns: 1fr;
    }

    .assist-previous {
        min-width: 0;
    }

    .join-room-form {
        flex-direction: column;
    }

    .room-mini-meta {
        gap: 6px;
    }

    .status-pill {
        display: none;
    }
}

/* Landing typography: Tailwind CDN/preflight gibi sonradan eklenen resetlerden etkilenmesin. */
.hero-title {
    margin: 23px 0 0;
    font-size: clamp(44px, 8vw, 80px);
    line-height: 1.03;
    letter-spacing: -4px;
    font-weight: 950;
    color: var(--text);
}

.hero-title span {
    display: block;
    margin-top: 6px;
    color: #9d7cff;
}

/* Room not found */
.error-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 116px 20px 40px;
}

.error-card {
    width: min(100%, 560px);
    padding: clamp(30px, 5vw, 48px);
    text-align: center;
    border: 1px solid var(--line);
    border-radius: 30px;
    background: linear-gradient(145deg, rgba(255, 255, 255, .065), rgba(255, 255, 255, .025));
    backdrop-filter: blur(22px);
    box-shadow: 0 34px 100px rgba(0, 0, 0, .35);
    animation: errorCardIn .35s ease both;
}

@keyframes errorCardIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.985);
    }
}

.error-icon {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    margin: 0 auto 24px;
    border: 1px solid rgba(239, 68, 68, .24);
    border-radius: 22px;
    color: #f87171;
    background: rgba(239, 68, 68, .08);
    box-shadow: 0 16px 48px rgba(239, 68, 68, .08);
}

.error-icon svg {
    width: 34px;
    height: 34px;
}

.error-title {
    margin: 8px 0 0;
    font-size: clamp(32px, 6vw, 48px);
    line-height: 1.05;
    letter-spacing: -2px;
    font-weight: 950;
    color: #fff;
}

.error-description {
    max-width: 430px;
    margin: 17px auto 0;
    color: #969daf;
    font-size: 15px;
    line-height: 1.7;
}

.missing-room-code {
    width: min(100%, 330px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 26px auto 0;
    padding: 13px 15px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 14px;
    background: rgba(255, 255, 255, .035);
}

.missing-room-code span {
    color: #777f93;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .8px;
    text-transform: uppercase;
}

.missing-room-code strong {
    color: #c4b5fd;
    font-size: 16px;
    letter-spacing: 4px;
}

.error-actions {
    display: flex;
    justify-content: center;
    margin-top: 26px;
}

.error-action-link {
    text-decoration: none;
}

.error-action-link svg {
    width: 18px;
    height: 18px;
}

.error-tip {
    margin: 22px 0 0;
    color: #686f82;
    font-size: 11px;
    line-height: 1.6;
}

@media (max-width: 760px) {
    .hero-title {
        letter-spacing: -2.5px;
        line-height: 1.05;
    }

    .hero-title span {
        margin-top: 5px;
    }

    .error-page {
        padding: 94px 14px 28px;
    }

    .error-card {
        border-radius: 24px;
    }
}

/* Header floating create panel */
.floating-create {
    position: fixed;
    z-index: 60;
    right: clamp(18px, 4vw, 56px);
    top: 88px;
    width: min(390px, calc(100vw - 36px));
    box-shadow: 0 24px 80px rgba(0, 0, 0, .4);
}

.create-panel-section {
    margin-top: 15px;
}

.create-panel-label {
    display: block;
    margin-bottom: 9px;
    color: #9aa1b2;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .6px;
    text-transform: uppercase;
}

.compact-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.floating-create select {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid rgba(255, 255, 255, .11);
    border-radius: 13px;
    outline: none;
    background: #171c2b;
    color: #fff;
}

.floating-create select:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, .10);
}

/* Room invite tools */
.room-toolbar {
    justify-content: flex-end;
}

.invite-tools {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 8px 7px 13px;
    border: 1px solid rgba(255, 255, 255, .075);
    border-radius: 15px;
    background: rgba(255, 255, 255, .028);
}

.invite-label {
    margin-right: 3px;
    white-space: nowrap;
}

.invite-tools .room-code {
    min-width: 122px;
    margin: 0;
    font-size: 18px;
    line-height: 1;
    letter-spacing: 4px;
    text-align: center;
}

.invite-tools .room-code.is-masked {
    min-width: 122px;
    color: #a8afc0;
    font-size: 28px;
    line-height: .7;
    letter-spacing: 5px;
    transform: translateY(-2px);
}

.invite-tools .icon-button {
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

/* Room chat */
.chat-panel {
    margin: 18px 26px 28px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, .075);
    border-radius: 22px;
    background: rgba(255, 255, 255, .025);
}

.chat-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.chat-heading h3 {
    margin: 4px 0 0;
    font-size: 18px;
}

.chat-status {
    color: #8e95a8;
    font-size: 11px;
    font-weight: 800;
}

.chat-messages {
    height: 210px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 16px;
    background: rgba(7, 10, 18, .42);
    scrollbar-width: thin;
}

.chat-empty {
    margin: auto;
    color: #697185;
    font-size: 12px;
    text-align: center;
}

.chat-message {
    max-width: min(78%, 620px);
}

.chat-message.mine {
    align-self: flex-end;
}

.chat-message-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 7px 4px;
    color: #727b8f;
    font-size: 10px;
}

.chat-message.mine .chat-message-meta {
    justify-content: flex-end;
}

.chat-message-meta strong {
    color: #aeb5c5;
    font-weight: 850;
}

.chat-bubble {
    padding: 9px 12px;
    border: 1px solid rgba(255, 255, 255, .075);
    border-radius: 14px 14px 14px 5px;
    background: rgba(255, 255, 255, .045);
    color: #d7dbea;
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.chat-message.mine .chat-bubble {
    border-color: rgba(139, 92, 246, .24);
    border-radius: 14px 14px 5px 14px;
    background: rgba(139, 92, 246, .13);
}

.chat-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 46px;
    gap: 9px;
    margin-top: 10px;
}

.chat-form input {
    width: 100%;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 13px;
    outline: none;
    background: #111725;
    color: #fff;
}

.chat-form input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, .1);
}

.chat-send {
    min-width: 0;
    width: 46px;
    height: 44px;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 13px;
}

.chat-send svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 760px) {
    .floating-create {
        top: 78px;
        right: 14px;
    }

    .invite-tools {
        width: 100%;
        justify-content: flex-end;
    }

    .invite-label {
        display: none;
    }

    .invite-tools .room-code,
    .invite-tools .room-code.is-masked {
        margin-right: auto;
        min-width: 112px;
    }

    .chat-panel {
        margin: 14px 14px 20px;
        padding: 16px;
    }

    .chat-message {
        max-width: 90%;
    }
}

.username-input-wrap {
    position: relative;
    width: 100%;
}

.username-input-wrap #usernameInput {
    width: 100%;
    padding-right: 58px;
}

.random-name-button {
    position: absolute;
    top: 54%;
    right: 8px;

    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    transform: translateY(-50%);

    padding: 0;
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 10px;

    background: rgba(139, 92, 246, 0.12);
    color: #fff;

    font-size: 18px;
    line-height: 1;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.15s ease;
}

.random-name-button:hover {
    background: rgba(139, 92, 246, 0.24);
    border-color: #8b5cf6;

    transform: translateY(-50%) scale(1.05);
}

.random-name-button:active {
    transform: translateY(-50%) scale(0.94);
}
/* =========================
   WordWar final refinements
========================= */

/* Status page variants */
.status-room-not-found .error-icon,
.status-kicked .error-icon,
.status-server-error .error-icon {
    color: #f87171;
    border-color: rgba(239, 68, 68, .24);
    background: rgba(239, 68, 68, .08);
}

.status-room-full .error-icon {
    color: #fbbf24;
    border-color: rgba(245, 158, 11, .28);
    background: rgba(245, 158, 11, .09);
}

.status-room-closed .error-icon,
.status-not-found .error-icon {
    color: #a78bfa;
    border-color: rgba(139, 92, 246, .28);
    background: rgba(139, 92, 246, .09);
}

.status-connection-lost .error-icon {
    color: #60a5fa;
    border-color: rgba(59, 130, 246, .28);
    background: rgba(59, 130, 246, .08);
}

/* Seed word is not counted as player word #1 */
.chain-seed-row {
    display: grid;
    grid-template-columns: 85px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
    padding: 8px;
}

.chain-seed-label {
    color: #777f94;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 1.4px;
}

/* Header chat */
.room-header-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.mobile-chat-button,
.mobile-chat-backdrop,
.chat-close-button {
    display: none;
}

/* Compact ready icon exists on all sizes but text remains on desktop */
.ready-check {
    display: none;
}

/* Keep long names from breaking cards */
.player-name-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 760px) {
    /* Player cards side-by-side */
    .versus {
        grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
        gap: 6px;
        align-items: stretch;
        padding: 14px 10px 8px;
    }

    .versus .vs {
        display: grid;
        place-items: center;
        margin: 0;
        font-size: 10px;
        letter-spacing: 0;
    }

    .player-card {
        min-width: 0;
        min-height: 78px;
        gap: 8px;
        padding: 10px;
        border-radius: 16px;
    }

    .avatar,
    .empty-avatar {
        width: 38px;
        height: 38px;
        flex: 0 0 38px;
        border-radius: 12px;
        font-size: 13px;
    }

    .player-info {
        min-width: 0;
        overflow: hidden;
    }

    .player-name {
        display: flex;
        flex-wrap: nowrap;
        min-width: 0;
        gap: 4px;
        font-size: 12px;
        line-height: 1.1;
    }

    .player-name-text {
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .host-chip {
        flex: 0 0 20px;
        width: 20px;
        height: 20px;
        display: grid;
        place-items: center;
        padding: 0;
        font-size: 0;
        border-radius: 7px;
    }

    .host-chip::after {
        content: "★";
        font-size: 9px;
    }

    .player-status {
        display: flex;
        align-items: center;
        margin-top: 5px;
        font-size: 0;
    }

    .player-status .presence {
        width: 7px;
        height: 7px;
        margin: 0;
    }

    .player-status-text {
        display: none;
    }

    .ready-state {
        position: absolute;
        top: 10px;
        right: 10px;
        margin: 0;
        font-size: 0;
    }

    .ready-text {
        display: none;
    }

    .ready-check {
        width: 22px;
        height: 22px;
        display: grid;
        place-items: center;
        border-radius: 999px;
        background: rgba(34, 197, 94, .12);
        color: #22c55e;
        font-size: 14px;
        font-weight: 950;
    }

    .kick-button {
        top: auto;
        bottom: 6px;
        right: 6px;
        width: 30px;
        height: 30px;
        opacity: 1;
    }

    .player-empty-card strong {
        max-width: 90px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 11px;
    }

    .player-empty-card span {
        display: none;
    }

    .lobby-panel {
        padding-top: 8px;
    }

    .connection-status {
        font-size: 11px;
    }

    /* Chat lives in the header on mobile */
    .mobile-chat-button {
        position: relative;
        width: 38px;
        height: 38px;
        flex: 0 0 38px;
        display: grid;
        place-items: center;
        padding: 0;
        border: 1px solid rgba(255, 255, 255, .10);
        border-radius: 11px;
        background: rgba(255, 255, 255, .055);
        color: #d8dceb;
    }

    .mobile-chat-button svg {
        width: 19px;
        height: 19px;
    }

    .mobile-chat-button:hover {
        color: #fff;
        border-color: rgba(139, 92, 246, .45);
        background: rgba(139, 92, 246, .12);
    }

    .chat-notification-dot {
        position: absolute;
        top: -3px;
        right: -3px;
        width: 11px;
        height: 11px;
        border: 2px solid #080b14;
        border-radius: 50%;
        background: #f43f5e;
        animation: chatNotice 1s ease-in-out infinite alternate;
    }

    @keyframes chatNotice {
        from { transform: scale(.9); box-shadow: 0 0 0 0 rgba(244, 63, 94, .5); }
        to { transform: scale(1.1); box-shadow: 0 0 0 7px rgba(244, 63, 94, 0); }
    }

    .room-header-actions {
        margin-left: auto;
        gap: 6px;
    }

    .room-mini-meta {
        gap: 5px;
    }

    .chat-panel {
        position: fixed;
        z-index: 720;
        left: 10px;
        right: 10px;
        bottom: max(10px, env(safe-area-inset-bottom));
        width: auto;
        max-height: min(72vh, 570px);
        margin: 0;
        display: flex;
        flex-direction: column;
        padding: 16px;
        border-radius: 22px;
        background: rgba(13, 17, 29, .985);
        backdrop-filter: blur(24px);
        box-shadow: 0 28px 100px rgba(0, 0, 0, .58);
        transform: translateY(calc(100% + 30px));
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: transform .24s ease, opacity .18s ease, visibility .18s ease;
    }

    .chat-panel.mobile-open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .chat-heading-actions {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .chat-close-button {
        width: 34px;
        height: 34px;
        display: grid;
        place-items: center;
        padding: 0;
        border: 1px solid rgba(255,255,255,.08);
        border-radius: 10px;
        background: rgba(255,255,255,.055);
        color: #cdd2df;
        font-size: 22px;
        line-height: 1;
    }

    .chat-messages {
        height: min(48vh, 360px);
        min-height: 210px;
    }

    .mobile-chat-backdrop {
        position: fixed;
        inset: 0;
        z-index: 710;
        display: block;
        background: rgba(3, 5, 10, .70);
        backdrop-filter: blur(5px);
    }

    body.mobile-chat-open {
        overflow: hidden;
    }

    .chat-message {
        max-width: 90%;
    }

    .chain-seed-row {
        grid-template-columns: 1fr;
        gap: 7px;
        padding: 4px 8px 8px;
    }
}

/* Mobile landing header actions */
@media (max-width: 760px) {
    .header-actions {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 3px;
        border: 1px solid rgba(255,255,255,.08);
        border-radius: 14px;
        background: rgba(255,255,255,.035);
    }

    .header-actions .compact-button {
        width: 38px;
        min-width: 38px;
        height: 38px;
        min-height: 38px;
        padding: 0;
        gap: 0;
        border: 0;
        border-radius: 10px;
        font-size: 0;
        line-height: 1;
        box-shadow: none;
    }

    .header-actions .secondary-button {
        background: transparent;
    }

    .header-actions .primary-button {
        background: linear-gradient(135deg, #8b5cf6, #7445ee);
        box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
    }

    .header-actions .compact-button svg {
        width: 18px;
        height: 18px;
    }
}


/* ===== WordWar v5 fixes ===== */

/* Sistem başlangıç kelimesi yok; tüm zinciri oyuncu kurar. */
.chain-seed-row {
    display: none !important;
}

/* Mobil chat body seviyesine portal olarak taşınır ve backdrop'un kesin üstünde kalır. */
@media (max-width: 760px) {
    .mobile-chat-backdrop {
        z-index: 9998 !important;
    }

    .chat-panel.mobile-open {
        z-index: 9999 !important;
        isolation: isolate;
    }

    /* Landing: son kullandığımız kompakt, tek grup görünümü. */
    .site-header .header-actions {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 3px;
        border: 1px solid rgba(255, 255, 255, .08);
        border-radius: 14px;
        background: rgba(255, 255, 255, .035);
    }

    .site-header .header-actions .compact-button {
        width: 38px;
        min-width: 38px;
        height: 38px;
        min-height: 38px;
        padding: 0;
        border: 0;
        border-radius: 10px;
        font-size: 0;
        line-height: 1;
        gap: 0;
        box-shadow: none;
    }

    .site-header .header-actions .secondary-button {
        background: transparent;
        color: #d7dbea;
    }

    .site-header .header-actions .primary-button {
        background: linear-gradient(135deg, #8b5cf6, #7445ee);
        color: #fff;
        box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
    }

    .site-header .header-actions .compact-button svg {
        width: 18px;
        height: 18px;
    }
}

/* =========================================================
   V6 - floating room panels / numeric rooms / room browser
   ========================================================= */

.join-room-form-stacked {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
}

.join-room-form-stacked input,
.floating-create input {
    width: 100%;
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid rgba(255, 255, 255, .11);
    border-radius: 13px;
    outline: none;
    background: #171c2b;
    color: #fff;
    transition: border-color .18s, box-shadow .18s;
}

.join-room-form-stacked input:focus,
.floating-create input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, .10);
}

#joinRoomCode {
    letter-spacing: 4px;
    font-weight: 900;
}

.optional-label {
    margin-left: 5px;
    color: #666f83;
    font-size: 9px;
    letter-spacing: .7px;
}

.rooms-link {
    display: block;
    margin-top: 12px;
    color: #9f8af7;
    text-align: center;
    text-decoration: none;
    font-size: 11px;
    font-weight: 800;
}

.rooms-link:hover {
    color: #c4b5fd;
}

/* Oda sayfasında artık davet linki yok; kod ve görünürlük kontrolü tek blok. */
.invite-tools {
    margin-left: auto;
}

.rooms-page {
    min-height: 100vh;
    padding: 112px 20px 50px;
}

.rooms-shell {
    width: min(1040px, 100%);
    margin: 0 auto;
}

.rooms-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.rooms-heading h1 {
    margin: 7px 0 0;
    font-size: clamp(34px, 6vw, 54px);
    line-height: 1;
    letter-spacing: -2px;
}

.rooms-heading p {
    max-width: 600px;
    margin: 13px 0 0;
    color: #8f96a8;
    line-height: 1.6;
}

.rooms-count {
    flex: 0 0 auto;
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255,255,255,.04);
    color: #9ba2b5;
    font-size: 11px;
    font-weight: 850;
}

.rooms-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.room-list-card {
    padding: 20px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 22px;
    background: rgba(16,20,34,.72);
    backdrop-filter: blur(18px);
    box-shadow: 0 20px 65px rgba(0,0,0,.18);
}

.room-list-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.room-list-code {
    display: block;
    margin-top: 5px;
    color: #fff;
    font-size: 24px;
    letter-spacing: 5px;
}

.room-lock-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 8px;
    border: 1px solid rgba(34,197,94,.22);
    border-radius: 9px;
    background: rgba(34,197,94,.07);
    color: #86efac;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .6px;
}

.room-lock-badge.locked {
    border-color: rgba(245,158,11,.24);
    background: rgba(245,158,11,.08);
    color: #fbbf24;
}

.room-lock-badge svg {
    width: 13px;
    height: 13px;
}

.room-list-host {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 18px;
    color: #d8dce8;
    font-size: 12px;
}

.room-list-host span:last-child {
    color: #70798e;
}

.room-list-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.room-list-meta span {
    padding: 7px 9px;
    border-radius: 9px;
    background: rgba(255,255,255,.04);
    color: #7f8799;
    font-size: 10px;
}

.room-list-meta strong {
    color: #cbd0de;
}

.room-list-password {
    width: 100%;
    margin-top: 14px;
    padding: 12px 13px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 12px;
    outline: 0;
    background: #111725;
    color: #fff;
}

.room-list-password:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 4px rgba(139,92,246,.10);
}

.room-list-join {
    width: 100%;
    margin-top: 14px;
}

.rooms-empty {
    padding: 60px 24px;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: rgba(255,255,255,.03);
    text-align: center;
}

.rooms-empty-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    margin: 0 auto 17px;
    border: 1px solid rgba(139,92,246,.28);
    border-radius: 18px;
    background: rgba(139,92,246,.09);
    color: #bba8ff;
    font-size: 30px;
}

.rooms-empty h2 {
    margin: 0;
    font-size: 24px;
}

.rooms-empty p {
    margin: 8px 0 0;
    color: #858da0;
}

.rooms-home-link {
    text-decoration: none;
}

@media (max-width: 760px) {
    .rooms-page {
        padding: 92px 12px 28px;
    }

    .rooms-heading {
        align-items: flex-start;
        margin-bottom: 18px;
    }

    .rooms-heading p {
        font-size: 13px;
    }

    .rooms-grid {
        grid-template-columns: 1fr;
    }

    .room-list-card {
        padding: 16px;
        border-radius: 18px;
    }

    .rooms-home-link {
        width: 38px;
        min-width: 38px;
        height: 38px;
        padding: 0;
        font-size: 0;
    }

    .rooms-home-link::after {
        content: "←";
        font-size: 18px;
    }
}
/* =========================
   JOIN PANEL
========================= */

.floating-join {
    width: min(360px, calc(100vw - 36px));
}

.join-inputs {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.join-inputs input {
    width: 100%;
    height: 44px;

    padding: 0 13px;

    border: 1px solid rgba(255, 255, 255, .11);
    border-radius: 12px;

    outline: none;

    background: #171c2b;
    color: #fff;

    transition:
        border-color .18s ease,
        box-shadow .18s ease;
}

.join-inputs input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, .10);
}

#joinRoomCode {
    font-weight: 900;
    letter-spacing: 3px;
}

.join-panel-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px;

    margin-top: 11px;
}

.rooms-button {
    min-height: 44px;
    padding: 0 14px;

    text-decoration: none;
}

.rooms-button svg {
    width: 18px;
    height: 18px;
}

.join-submit-button {
    min-width: 92px;
    min-height: 44px;
    padding: 0 18px;
}


/* MOBİL */

@media (max-width: 760px) {

    .floating-join {
        width: min(330px, calc(100vw - 28px));
    }

    .join-inputs input {
        height: 42px;
    }

    .join-panel-actions {
        grid-template-columns: 44px minmax(0, 1fr);
    }

    .rooms-button {
        width: 44px;
        min-width: 44px;
        height: 44px;

        padding: 0;

        display: grid;
        place-items: center;
    }

    .rooms-button span {
        display: none;
    }

    .rooms-button svg {
        width: 19px;
        height: 19px;
    }

    .join-submit-button {
        width: 100%;
    }

}
/* =========================
   ROOM TOP PLAYER BAR
========================= */

.room-toolbar-with-players {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 22px;
    padding: 20px 26px;
}

.toolbar-versus {
    min-width: 0;

    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        34px
        minmax(0, 1fr);

    align-items: center;
    gap: 10px;
}

/*
 * Eski versus stilleri burada
 * toolbar görünümüne küçültülüyor.
 */
.toolbar-versus .player-card {
    min-width: 0;
    min-height: 72px;

    padding: 11px 13px;

    gap: 10px;

    border-radius: 15px;
}

.toolbar-versus .avatar,
.toolbar-versus .empty-avatar {
    width: 42px;
    height: 42px;

    flex: 0 0 42px;

    border-radius: 13px;

    font-size: 14px;
}

.toolbar-versus .player-name {
    min-width: 0;

    flex-wrap: nowrap;

    gap: 6px;

    font-size: 13px;
}

.toolbar-versus .player-name-text {
    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.toolbar-versus .host-chip {
    padding: 3px 5px;

    border-radius: 6px;

    font-size: 7px;
}

.toolbar-versus .player-status {
    margin-top: 4px;

    font-size: 9px;
}

.toolbar-versus .presence {
    width: 6px;
    height: 6px;

    margin-right: 4px;
}

.toolbar-versus .ready-state {
    margin-left: auto;

    font-size: 8px;
}

.toolbar-versus .vs {
    display: grid;
    place-items: center;

    color: #8b5cf6;

    font-size: 11px;
    font-weight: 1000;
}

.toolbar-versus .kick-button {
    width: 28px;
    height: 28px;

    top: 5px;
    right: 5px;
}

.toolbar-versus .kick-button svg {
    width: 18px;
}


/* Davet kodunu sabit sağ tarafta tut */

.room-toolbar-with-players .invite-tools {
    margin-left: 0;

    flex: 0 0 auto;
}


/* =========================
   MOBILE
========================= */

@media (max-width: 900px) {

    .room-toolbar-with-players {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .room-toolbar-with-players .invite-tools {
        width: 100%;

        justify-content: flex-end;

        border-top: 1px solid rgba(255,255,255,.06);

        padding-top: 12px;
    }

}


@media (max-width: 760px) {

    .room-toolbar-with-players {
        padding: 12px 10px;
    }

    .toolbar-versus {
        grid-template-columns:
            minmax(0, 1fr)
            20px
            minmax(0, 1fr);

        gap: 5px;
    }

    .toolbar-versus .player-card {
        min-height: 58px;

        padding: 7px;

        gap: 6px;

        border-radius: 12px;
    }

    .toolbar-versus .avatar,
    .toolbar-versus .empty-avatar {
        width: 32px;
        height: 32px;

        flex: 0 0 32px;

        border-radius: 10px;

        font-size: 11px;
    }

    .toolbar-versus .player-name {
        font-size: 10px;
    }

    .toolbar-versus .player-status {
        font-size: 0;
    }

    .toolbar-versus .player-status .presence {
        margin: 0;
    }

    .toolbar-versus .host-chip {
        width: 17px;
        height: 17px;

        padding: 0;

        display: grid;
        place-items: center;

        font-size: 0;
    }

    .toolbar-versus .host-chip::after {
        content: "★";

        font-size: 7px;
    }

    .toolbar-versus .ready-state {
        position: absolute;

        top: 5px;
        right: 5px;

        font-size: 0;
    }

    .toolbar-versus .ready-check {
        width: 18px;
        height: 18px;

        font-size: 11px;
    }

    .toolbar-versus .vs {
        font-size: 8px;
    }

}

.ready-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.ready-actions .ready-button {
    margin-top: 0;
}

@media (max-width: 560px) {
    .ready-actions {
        flex-direction: column;
    }

    .ready-actions .ready-button {
        width: 100%;
    }
}
/* =========================================================
   V7 - Ortak header / footer / kalıcı oyuncu kimliği
   ========================================================= */
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.header-user {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    height: 44px;
    padding: 5px 11px 5px 6px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 14px;
    background: rgba(255,255,255,.045);
}

.header-user-avatar {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    color: #fff;
    font-size: 12px;
    font-weight: 950;
}

.header-user-text {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 2px;
    white-space: nowrap;
}

.header-user-name {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #eceefa;
    font-size: 12px;
    font-weight: 900;
}

.header-user-tag {
    color: #9f8af7;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .7px;
}

.header-user.is-empty {
    opacity: .5;
}

.site-footer {
    width: 100%;
    padding: 0 20px 26px;
}

.site-footer-inner {
    width: min(1120px, 100%);
    min-height: 64px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px 18px;
    border: 1px solid rgba(255,255,255,.065);
    border-radius: 18px;
    background: rgba(11,15,27,.5);
    color: #6f778a;
    font-size: 10px;
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #dfe3ef;
    text-decoration: none;
    font-weight: 900;
}

.footer-mark {
    width: 27px;
    height: 27px;
    border-radius: 9px;
    font-size: 10px;
}

.footer-copy { margin-right: auto; }
.footer-security { color: #626a7d; }

.identity-gate { z-index: 2000; }
body.identity-required { overflow: hidden; }
body.identity-required .site-header,
body.identity-required main,
body.identity-required .site-footer { pointer-events: none; user-select: none; }

.identity-card {
    width: min(100%, 470px);
    padding: 32px;
}

.identity-card h2 {
    margin: 7px 0 0;
    font-size: 29px;
    letter-spacing: -.7px;
}

.identity-card > p {
    margin: 10px 0 20px;
    line-height: 1.6;
}

.identity-name-wrap #identityUsername {
    width: 100%;
    margin: 0;
    padding-right: 58px;
}

.identity-preview {
    margin-top: 12px;
    padding: 12px 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 12px;
    background: rgba(255,255,255,.03);
}

.identity-preview > span {
    color: #757d90;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .8px;
    text-transform: uppercase;
}

.identity-preview strong {
    min-width: 0;
    color: #e5e7f1;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.identity-preview-tag { color: #9f8af7; letter-spacing: 1px; }
.identity-note {
    margin: 12px 0 0 !important;
    color: #687084 !important;
    font-size: 10px !important;
    text-align: center;
}

.panel-inline-error,
.join-modal-error {
    margin-top: 11px;
    padding: 10px 12px;
    border: 1px solid rgba(239,68,68,.25);
    border-radius: 11px;
    background: rgba(239,68,68,.07);
    color: #fca5a5;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
}

.room-owner-identity {
    margin: 5px 0 0;
    color: #9381dc;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .5px;
}

@media (max-width: 900px) {
    .site-header { padding-left: 14px; padding-right: 14px; }
    .header-right { gap: 5px; }
    .header-user { padding-right: 7px; }
    .header-user-text { display: none; }
    .header-user { width: 42px; padding: 4px; justify-content: center; }
    .header-user-avatar { width: 32px; height: 32px; }
}

@media (max-width: 760px) {
    .site-footer { padding: 0 10px 16px; }
    .site-footer-inner { flex-wrap: wrap; gap: 8px 12px; border-radius: 14px; }
    .footer-copy { width: calc(100% - 120px); margin-right: 0; }
    .footer-security { width: 100%; }
    .identity-card { padding: 25px 20px; }
}


/* =========================
   PROFILE EDIT MODAL
========================= */
.header-user {
    appearance: none;
    font: inherit;
    text-align: left;
}

.header-user:not(:disabled) {
    cursor: pointer;
}

.header-user:not(:disabled):hover {
    border-color: rgba(139, 92, 246, .35);
    background: rgba(139, 92, 246, .09);
}

.header-user:disabled {
    cursor: default;
}

.profile-edit-card {
    width: min(100%, 440px);
}

.profile-field-label {
    display: block;
    margin: 20px 0 8px;
    color: #9aa1b2;
    font-size: 11px;
    font-weight: 850;
}

.profile-edit-card #editUsernameInput {
    width: 100%;
    margin: 0;
    padding: 14px 15px;
    border: 1px solid rgba(255, 255, 255, .11);
    border-radius: 13px;
    outline: none;
    background: #171c2b;
    color: #fff;
}

.profile-edit-card #editUsernameInput:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, .10);
}

.profile-tag-preview {
    margin-top: 14px;
}

.profile-tag-preview strong {
    color: #c4b5fd;
    letter-spacing: 3px;
}

.profile-modal-actions {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 9px;
    margin-top: 18px;
}

@media (max-width: 520px) {
    .profile-modal-actions {
        grid-template-columns: 1fr;
    }
}


/* =========================
   TURN-BASED GAMEPLAY
========================= */
.turn-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.turn-badge {
    padding: 8px 11px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 999px;
    background: rgba(255,255,255,.045);
    color: #9ca3b5;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .8px;
}

.turn-badge.mine {
    border-color: rgba(139,92,246,.38);
    background: rgba(139,92,246,.12);
    color: #c4b5fd;
}

.turn-clock {
    min-width: 48px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(139,92,246,.28);
    border-radius: 12px;
    background: rgba(139,92,246,.08);
    color: #fff;
    font-size: 17px;
    font-weight: 950;
    font-variant-numeric: tabular-nums;
}

.turn-clock.danger {
    color: #fecaca;
    border-color: rgba(239,68,68,.4);
    background: rgba(239,68,68,.10);
}

.player-card.is-turn {
    border-color: rgba(139,92,246,.48);
    box-shadow: inset 0 0 0 1px rgba(139,92,246,.10), 0 0 30px rgba(139,92,246,.06);
}

.solve-row {
    grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
}

.solve-row.current {
    border-color: rgba(139,92,246,.30);
    background: rgba(139,92,246,.055);
}

.solve-row.locked-row {
    opacity: .62;
}

.guess-waiting {
    min-height: 45px;
    display: flex;
    align-items: center;
    padding: 0 14px;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 11px;
    background: rgba(255,255,255,.025);
    color: #697185;
    font-size: 12px;
    font-weight: 700;
}

.live-guess-display {
    position: relative;
    min-height: 45px;
    display: flex;
    align-items: center;
    padding: 0 14px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 11px;
    background: #111725;
    color: #70788a;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .2px;
}

.live-guess-display.typing {
    color: #fff;
    border-color: rgba(139,92,246,.38);
    box-shadow: 0 0 0 4px rgba(139,92,246,.07);
}

.typing-caret {
    width: 2px;
    height: 19px;
    margin-left: 2px;
    background: #a78bfa;
    animation: typingCaret .75s steps(1) infinite;
}

@keyframes typingCaret {
    50% { opacity: 0; }
}

.solved-label {
    color: #86efac;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1px;
}

/* Eski yardımlı mod artık oyunda kullanılmıyor. */
.assist-toggle,
.assist-previous {
    display: none !important;
}

@media (max-width: 760px) {
    .turn-info { width: 100%; justify-content: space-between; }
    .solve-row { grid-template-columns: 1fr; }
    .turn-clock { min-width: 44px; }
}

/* =========================
   DUAL BATTLE BOARD
========================= */
.solve-chain {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}

.battle-board {
    min-width: 0;
    padding: 14px;
    border: 1px solid rgba(255,255,255,.075);
    border-radius: 18px;
    background: rgba(255,255,255,.018);
    transition: opacity .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.battle-board.is-active {
    border-color: rgba(139,92,246,.34);
    background: rgba(139,92,246,.045);
    box-shadow: 0 14px 44px rgba(0,0,0,.12);
}

.battle-board.is-paused {
    opacity: .58;
}

.battle-board-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.battle-board-head > div {
    min-width: 0;
}

.battle-board-kicker {
    display: block;
    margin-bottom: 4px;
    color: #777f94;
    font-size: 9px;
    font-weight: 950;
    letter-spacing: 1.25px;
}

.battle-board-head strong {
    display: block;
    overflow: hidden;
    color: #e8eaf2;
    font-size: 12px;
    line-height: 1.35;
    text-overflow: ellipsis;
}

.battle-board-state {
    flex: 0 0 auto;
    padding: 5px 7px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 999px;
    color: #727b8f;
    font-size: 8px;
    font-weight: 950;
    letter-spacing: .8px;
}

.battle-board-state.active {
    border-color: rgba(34,197,94,.28);
    background: rgba(34,197,94,.08);
    color: #86efac;
}

.battle-board-rows {
    display: grid;
    gap: 8px;
}

.battle-board .solve-row {
    grid-template-columns: minmax(72px, 110px) minmax(0, 1fr) 28px;
    gap: 9px;
    min-height: 56px;
    padding: 8px 9px;
}

.battle-board .hint-word {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    letter-spacing: 2px;
}

.battle-board .solved-label {
    align-self: center;
}

.battle-board .solved-check,
.battle-board .solve-check-slot {
    width: 28px;
    min-width: 28px;
    justify-self: end;
    align-self: end;
    text-align: right;
}

.battle-board .solved-check {
    color: #22c55e;
    font-size: 22px;
    line-height: 1;
    font-weight: 1000;
}

.battle-board .guess-input,
.battle-board .guess-waiting,
.battle-board .live-guess-display {
    min-width: 0;
}

@media (max-width: 760px) {
    .solve-chain {
        grid-template-columns: 1fr;
    }

    .battle-board {
        padding: 11px;
        border-radius: 16px;
    }

    .battle-board .solve-row {
        grid-template-columns: minmax(60px, 88px) minmax(0, 1fr) 24px;
        gap: 7px;
    }

    .battle-board .solved-check,
    .battle-board .solve-check-slot {
        width: 24px;
        min-width: 24px;
    }
}

/* =========================
   BATTLE UX V2
   - kompakt satırlar
   - tik her zaman en sağda
   - yakın cevap titremesi
   - tek harflik ipucu aksiyonu
========================= */

.battle-board.is-paused {
    opacity: .72;
}

.battle-board .solve-row {
    min-height: 50px;
    padding: 7px 9px;
    align-items: center;
}

.battle-board .solved-check,
.battle-board .solve-check-slot {
    align-self: center;
    justify-self: end;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    margin: 0;
}

.battle-board .solved-check {
    border-radius: 999px;
    background: rgba(34,197,94,.10);
    color: #22c55e;
    font-size: 17px;
    line-height: 1;
}

.solve-complete-space {
    min-width: 0;
}

.guess-control {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
    align-items: center;
}

.hint-letter-button {
    height: 44px;
    padding: 0 11px;
    border: 1px solid rgba(245,158,11,.30);
    border-radius: 11px;
    background: rgba(245,158,11,.09);
    color: #fbbf24;
    font-size: 9px;
    font-weight: 950;
    letter-spacing: .55px;
    white-space: nowrap;
    transition: transform .16s ease, background .16s ease, border-color .16s ease, opacity .16s ease;
}

.hint-letter-button:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: rgba(245,158,11,.50);
    background: rgba(245,158,11,.15);
}

.hint-letter-button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.guess-waiting {
    min-height: 42px;
    border-color: transparent;
    background: transparent;
    color: #626a7c;
}

.near-shake {
    border-color: rgba(245,158,11,.65) !important;
    box-shadow: 0 0 0 4px rgba(245,158,11,.10) !important;
    animation: wordwarNearShake .42s ease;
}

@keyframes wordwarNearShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(3px); }
}

@media (max-width: 760px) {
    .guess-control {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .hint-letter-button {
        width: 42px;
        padding: 0;
        font-size: 0;
    }

    .hint-letter-button::after {
        content: "💡";
        font-size: 16px;
    }
}

/* =========================
   BATTLE VISUAL POLISH V3
========================= */
.game-panel#playPanel {
    margin-top: 14px;
    padding: 18px;
    background: rgba(12, 16, 28, .72);
}

#playPanel .panel-heading {
    align-items: center;
    margin-bottom: 14px;
}

#playPanel .panel-heading h2 {
    margin-top: 3px;
    font-size: clamp(20px, 2.4vw, 28px);
    letter-spacing: -.8px;
}

.solve-chain {
    gap: 12px;
}

.battle-board {
    padding: 12px;
    border-radius: 17px;
    background: rgba(255,255,255,.018);
}

.battle-board.is-active {
    border-color: rgba(139,92,246,.48);
    background: linear-gradient(180deg, rgba(139,92,246,.07), rgba(139,92,246,.025));
    box-shadow: inset 0 0 0 1px rgba(139,92,246,.06), 0 16px 38px rgba(0,0,0,.13);
}

.battle-board.is-paused {
    opacity: .86;
    border-color: rgba(255,255,255,.065);
}

.battle-board-head {
    align-items: center;
    margin-bottom: 9px;
}

.battle-board-identity {
    min-width: 0;
    flex: 1;
}

.battle-board-title-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
}

.battle-board-kicker {
    margin: 0;
    color: #aeb5c6;
    font-size: 10px;
    letter-spacing: 1.35px;
}

.battle-board-progress-count {
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(255,255,255,.05);
    color: #747d90;
    font-size: 9px;
    font-weight: 900;
}

.battle-board-head strong {
    color: #878fa2;
    font-size: 11px;
    font-weight: 750;
}

.battle-board-state {
    padding: 5px 8px;
}

.battle-progress {
    height: 3px;
    margin-bottom: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255,255,255,.045);
}

.battle-progress > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
    transition: width .25s ease;
}

.battle-board-rows {
    gap: 7px;
}

.battle-board .solve-row {
    grid-template-columns: minmax(62px, 92px) minmax(0, 1fr) 30px;
    min-height: 48px;
    padding: 6px 8px;
    gap: 8px;
    border-radius: 13px;
}

.battle-board .solve-row.solved {
    min-height: 46px;
    border-color: rgba(34,197,94,.20);
    background: rgba(34,197,94,.045);
}

.battle-board .solve-row.current {
    border-color: rgba(139,92,246,.44);
    background: rgba(139,92,246,.075);
    box-shadow: inset 0 0 0 1px rgba(139,92,246,.05);
}

.battle-board .solve-row.locked-row:not(.solved) {
    opacity: .72;
}

.battle-board .hint-word {
    font-size: 12px;
    letter-spacing: 2.3px;
}

.battle-board .guess-input,
.battle-board .live-guess-display {
    min-height: 42px;
    height: 42px;
}

.battle-board .guess-input {
    border-radius: 10px;
    padding: 0 12px;
}

.guess-waiting {
    min-height: 34px;
    padding: 0 10px;
    justify-content: flex-start;
    color: #555e70;
    font-size: 11px;
}

.battle-board .solved-check,
.battle-board .solve-check-slot {
    width: 30px;
    height: 30px;
}

.battle-board .solved-check {
    justify-self: end;
    border: 1px solid rgba(34,197,94,.18);
    background: rgba(34,197,94,.10);
    font-size: 16px;
}

.hint-letter-button {
    height: 42px;
    border-radius: 10px;
}

.turn-info {
    gap: 8px;
}

.turn-badge,
.turn-clock {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 760px) {
    .game-panel#playPanel {
        margin: 10px 8px 16px;
        padding: 12px;
    }

    #playPanel .panel-heading {
        gap: 8px;
    }

    .solve-chain {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .battle-board {
        padding: 10px;
    }

    .battle-board .solve-row {
        grid-template-columns: 58px minmax(0, 1fr) 28px;
        min-height: 46px;
        padding: 6px;
    }

    .battle-board .hint-word {
        font-size: 11px;
        letter-spacing: 1.8px;
    }

    .battle-board .solved-check,
    .battle-board .solve-check-slot {
        width: 28px;
        height: 28px;
    }

    .battle-board-head strong {
        font-size: 10px;
    }
}

/* =========================
   SOLVED WORDS + GAME REPORT
========================= */
.battle-board .solved-word {
    color: #e8fff0;
    font-weight: 950;
    letter-spacing: .7px;
    text-transform: none;
}

.game-report {
    width: min(100%, 980px);
    margin: 28px auto 0;
    text-align: left;
}

.report-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.report-summary > span {
    padding: 13px 14px;
    border: 1px solid rgba(255,255,255,.075);
    border-radius: 13px;
    background: rgba(255,255,255,.03);
}

.report-summary small {
    display: block;
    color: #747d90;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 1.2px;
}

.report-summary strong {
    display: block;
    margin-top: 5px;
    color: #fff;
    font-size: 19px;
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.report-player {
    padding: 16px;
    border: 1px solid rgba(255,255,255,.075);
    border-radius: 17px;
    background: rgba(255,255,255,.025);
}

.report-player.winner {
    border-color: rgba(34,197,94,.28);
    background: linear-gradient(180deg, rgba(34,197,94,.07), rgba(34,197,94,.025));
}

.report-player-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.report-player-head h3 {
    margin: 4px 0 0;
    color: #fff;
    font-size: 16px;
}

.report-score {
    padding: 7px 10px;
    border-radius: 10px;
    background: rgba(139,92,246,.11);
    color: #c4b5fd;
    font-size: 16px;
}

.report-player.winner .report-score {
    background: rgba(34,197,94,.10);
    color: #86efac;
}

.report-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.report-stats span {
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(255,255,255,.035);
    color: #7f8799;
    font-size: 9px;
}

.report-stats b {
    color: #d7dbea;
}

.report-answers {
    display: grid;
    gap: 5px;
    margin-top: 12px;
}

.report-answer {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) 24px;
    align-items: center;
    gap: 8px;
    padding: 8px 9px;
    border-radius: 9px;
    background: rgba(255,255,255,.025);
}

.report-answer > span {
    color: #5f687a;
    font-size: 9px;
    font-weight: 900;
}

.report-answer strong {
    overflow: hidden;
    color: #aeb5c5;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-answer i {
    justify-self: end;
    color: #596274;
    font-style: normal;
    font-weight: 950;
}

.report-answer.solved strong,
.report-answer.solved i {
    color: #86efac;
}

@media (max-width: 760px) {
    .report-summary,
    .report-grid {
        grid-template-columns: 1fr;
    }

    .game-report {
        margin-top: 20px;
    }
}

/* =========================================================
   FINAL BATTLE ROW LAYOUT FIX
   ========================================================= */
.battle-board-rows {
    display: grid;
    gap: 9px;
    width: 100%;
}

.battle-board-rows .solve-row {
    width: 100%;
    min-width: 0;
    min-height: 58px;
    display: grid !important;
    grid-template-columns: minmax(110px, 170px) minmax(0, 1fr) 34px !important;
    align-items: center !important;
    gap: 10px;
    padding: 8px 10px;
}

.battle-board-rows .hint-word {
    grid-column: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.battle-board-rows .guess-control {
    grid-column: 2 !important;
    width: 100%;
    min-width: 0;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center;
    gap: 8px;
}

.battle-board-rows .guess-control .guess-input {
    grid-column: 1 !important;
    width: 100%;
    min-width: 0;
    margin: 0 !important;
}

.battle-board-rows .hint-letter-button {
    grid-column: 2 !important;
    position: static !important;
    width: auto !important;
    min-width: 68px;
    height: 42px;
    margin: 0 !important;
    padding: 0 11px;
    justify-self: end !important;
    align-self: center !important;
    white-space: nowrap;
}

.battle-board-rows .live-guess-display {
    grid-column: 2 !important;
    min-width: 0;
    width: 100%;
}

.battle-board-rows .guess-waiting {
    grid-column: 2 / 4 !important;
    justify-self: end !important;
    align-self: center !important;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 2px 0 0 !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    color: #656d80;
    font-size: 11px;
    font-weight: 750;
    line-height: 1;
    text-align: right !important;
    white-space: nowrap;
}

.battle-board-rows .waiting-hourglass {
    display: inline-block;
    font-size: 13px;
    line-height: 1;
    opacity: .8;
}

.battle-board-rows .solve-check-slot,
.battle-board-rows .solved-check {
    grid-column: 3 !important;
    justify-self: end !important;
    align-self: center !important;
}

.battle-board-rows .solve-row.solved {
    grid-template-columns: minmax(0, 1fr) 34px !important;
    min-height: 54px;
}

.battle-board-rows .solve-row.solved .solved-word {
    grid-column: 1 !important;
}

.battle-board-rows .solve-row.solved .solve-complete-space {
    display: none !important;
}

.battle-board-rows .solve-row.solved .solved-check {
    grid-column: 2 !important;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(34,197,94,.12);
    color: #22c55e;
}

.battle-board-rows .solve-row.locked-row {
    opacity: .72;
}

.battle-board-rows .solve-row.solved.locked-row {
    opacity: .9;
}

@media (max-width: 760px) {
    .battle-board-rows .solve-row {
        grid-template-columns: minmax(82px, 112px) minmax(0, 1fr) 30px !important;
        min-height: 54px;
        gap: 7px;
        padding: 7px 8px;
    }

    .battle-board-rows .guess-control {
        grid-template-columns: minmax(0, 1fr) 42px !important;
    }

    .battle-board-rows .hint-letter-button {
        width: 42px !important;
        min-width: 42px;
        padding: 0 !important;
        font-size: 0 !important;
    }

    .battle-board-rows .hint-letter-button::after {
        content: "💡";
        font-size: 16px;
    }

    .battle-board-rows .guess-waiting {
        font-size: 10px;
        gap: 4px;
    }

    .battle-board-rows .solve-row.solved {
        grid-template-columns: minmax(0, 1fr) 30px !important;
    }
}
