* {
    box-sizing: border-box;
}

:root {
    --bg: #07111f;
    --panel: rgba(15, 27, 46, 0.92);
    --panel-soft: #13223a;
    --border: rgba(255, 255, 255, 0.09);
    --text: #f5f7fb;
    --muted: #8fa0b8;
    --accent: #4fd1c5;
    --accent-strong: #2bb8aa;
    --accent-soft: rgba(79, 209, 197, 0.12);
    --danger: #ff7b7b;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, Arial, sans-serif;
    background:
        radial-gradient(circle at top, #132641 0%, #07111f 45%, #040a12 100%);
    color: var(--text);
}

button,
input {
    font: inherit;
}

button {
    border: none;
}

.app-shell {
    width: min(100% - 32px, 760px);
    margin: 0 auto;
    padding: 36px 0 60px;
}

.hero {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 26px;
}

.logo {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--accent), #6ee7f2);
    color: #04111c;
    font-weight: 900;
    font-size: 22px;
    box-shadow: 0 12px 30px rgba(79, 209, 197, 0.22);
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 12px;
    font-weight: 800;
}

h1 {
    margin: 0;
    font-size: clamp(32px, 7vw, 54px);
    line-height: 1;
}

.subtitle {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.panel {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--panel);
    backdrop-filter: blur(18px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.section-title span {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12px;
    font-weight: 900;
}

.section-title h2 {
    margin: 0;
    font-size: 24px;
}

.field {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.field span {
    color: #c7d2e1;
    font-size: 14px;
    font-weight: 700;
}

.field input {
    width: 100%;
    padding: 15px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    outline: none;
    background: #0b1728;
    color: var(--text);
    transition: 0.2s ease;
}

.field input::placeholder {
    color: #53657f;
}

.field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.btn {
    width: 100%;
    min-height: 50px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 900;
    transition: 0.18s ease;
}

.btn:active {
    transform: scale(0.985);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #58e1d5);
    color: #05131d;
}

.btn-primary:hover {
    filter: brightness(1.06);
}

.btn-secondary {
    background: #16263f;
    color: var(--text);
    border: 1px solid var(--border);
}

.separator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0;
    color: var(--muted);
    font-size: 13px;
}

.separator::before,
.separator::after {
    content: "";
    height: 1px;
    flex: 1;
    background: var(--border);
}

.message {
    min-height: 22px;
    margin: 16px 0 0;
    color: var(--danger);
    text-align: center;
}

.room-code-card {
    padding: 22px;
    margin-bottom: 24px;
    text-align: center;
    border: 1px solid rgba(79, 209, 197, 0.18);
    border-radius: 18px;
    background: var(--accent-soft);
}

.room-code-card p,
.room-code-card small {
    margin: 0;
    color: var(--muted);
}

.room-code-card strong {
    display: block;
    margin: 8px 0;
    color: var(--accent);
    font-size: 42px;
    letter-spacing: 0.12em;
}

.players-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.players-header h3 {
    margin: 0;
}

.status-dot {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 12px;
}

.status-dot span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 14px #4ade80;
}

.players-list {
    display: grid;
    gap: 10px;
    padding: 0;
    margin: 16px 0 24px;
    list-style: none;
}

.players-list li {
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--panel-soft);
    border: 1px solid var(--border);
    font-weight: 700;
}

.game-topbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 22px;
}

.letter-card,
.timer-card {
    padding: 18px;
    border-radius: 18px;
    text-align: center;
    background: var(--panel-soft);
    border: 1px solid var(--border);
}

.letter-card span,
.timer-card span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
}

.letter-card strong {
    color: var(--accent);
    font-size: 42px;
}

.timer-card strong {
    font-size: 34px;
}

.game-form {
    display: grid;
    gap: 4px;
}

.results-grid {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
}

.results-grid > div {
    padding: 18px;
    border-radius: 18px;
    background: var(--panel-soft);
    border: 1px solid var(--border);
}

.results-grid h3 {
    margin: 0 0 12px;
    color: var(--accent);
}

.results-grid ul {
    margin: 0;
    padding-left: 20px;
    color: #d7dfeb;
}

.results-grid li {
    margin-bottom: 6px;
}

[hidden] {
    display: none !important;
}

@media (max-width: 560px) {
    .app-shell {
        width: min(100% - 20px, 760px);
        padding-top: 20px;
    }

    .panel {
        padding: 18px;
        border-radius: 20px;
    }

    .hero {
        align-items: flex-start;
    }

    .logo {
        width: 54px;
        height: 54px;
        border-radius: 16px;
    }

    .game-topbar {
        grid-template-columns: 1fr 1fr;
    }
}