html,
body {
    margin: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at top, rgba(248, 190, 92, 0.2), transparent 30%),
        radial-gradient(circle at 85% 10%, rgba(98, 194, 220, 0.16), transparent 26%),
        linear-gradient(170deg, #11283a 0%, #16364c 48%, #0d1d29 100%);
    color: #f7f1e6;
    font-family: "Trebuchet MS", "Avenir Next", "Segoe UI", sans-serif;
}

body {
    min-height: 100vh;
}

.mobile-shell {
    max-width: 760px;
    margin: 0 auto;
    padding: 18px;
    box-sizing: border-box;
}

.topbar,
.card {
    background:
        linear-gradient(140deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
        rgba(9, 20, 28, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 24px 50px rgba(0, 0, 0, 0.26),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.topbar {
    border-radius: 28px;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.eyebrow,
.input-label,
.roster-columns {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 11px;
}

.eyebrow {
    margin: 0 0 8px;
    color: #f8be5c;
}

.topbar h1,
.mode-panel h2,
.card h2,
.roster-header h3 {
    margin: 0;
}

.topbar h1 {
    font-size: clamp(28px, 5vw, 40px);
    line-height: 0.95;
}

.topbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.status-pill,
.phase-badge,
.timer-pill,
.lockout-pill {
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
}

.status-pill.status-good {
    color: #8ce5b0;
}

.status-pill.status-warn {
    color: #f8be5c;
}

.status-pill.status-bad {
    color: #f3a4a4;
}

.main-stack {
    margin-top: 18px;
}

.card {
    border-radius: 28px;
    padding: 20px;
}

.supporting-text {
    margin: 12px 0 0;
    color: rgba(247, 241, 230, 0.8);
    line-height: 1.45;
}

#nameForm {
    margin-top: 18px;
}

.input-label {
    display: block;
    margin-bottom: 10px;
    color: rgba(247, 241, 230, 0.72);
}

#nameInput {
    width: 100%;
    box-sizing: border-box;
    padding: 15px 16px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    color: #f7f1e6;
    font: inherit;
}

.form-actions,
.meta-row,
.drawer-header,
.roster-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.form-actions {
    margin-top: 16px;
}

.primary-button,
.ghost-button,
.choice-button {
    border: none;
    border-radius: 18px;
    font: inherit;
    cursor: pointer;
    transition: transform 140ms ease, filter 140ms ease, opacity 140ms ease;
}

.primary-button,
.choice-button {
    background: linear-gradient(135deg, #f8be5c, #ef9f2e);
    color: #1a2a34;
    font-weight: bold;
}

.primary-button {
    padding: 13px 18px;
}

.ghost-button {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.08);
    color: #f7f1e6;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.primary-button:hover,
.ghost-button:hover,
.choice-button:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
}

.meta-row {
    margin-bottom: 14px;
}

.mode-panel {
    margin-top: 18px;
    padding: 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.choice-grid {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.choice-button {
    padding: 15px 16px;
    text-align: left;
}

.choice-button.disabled {
    opacity: 0.45;
    cursor: default;
}

.drawer-tools {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.color-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.color-chip input {
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    padding: 0;
}

.draw-stage {
    position: relative;
    margin-top: 16px;
    aspect-ratio: 1 / 1;
    width: 100%;
    border-radius: 24px;
    overflow: hidden;
    background:
        radial-gradient(circle at 15% 15%, rgba(255, 255, 255, 0.2), transparent 24%),
        linear-gradient(145deg, #fafafa, #efefef 55%, #e2e2e2 100%);
}

#drawCanvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

.draw-overlay {
    position: absolute;
    inset: auto 16px 16px 16px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(17, 40, 58, 0.8);
    text-align: center;
    line-height: 1.4;
}

.roster-panel {
    margin-top: 18px;
    padding: 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.roster-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 68px;
    gap: 10px;
    margin-top: 16px;
    color: rgba(247, 241, 230, 0.62);
}

.roster-list {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.roster-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 68px;
    gap: 10px;
    align-items: center;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
}

.roster-main {
    min-width: 0;
}

.roster-main strong,
.roster-stat {
    display: block;
}

.roster-main strong {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.roster-status {
    margin-top: 4px;
    font-size: 13px;
    color: rgba(247, 241, 230, 0.66);
}

.roster-stat {
    text-align: right;
    font-weight: bold;
}

.empty-roster {
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(247, 241, 230, 0.7);
}

@media (max-width: 620px) {
    .mobile-shell {
        padding: 12px;
    }

    .topbar,
    .card {
        padding: 16px;
        border-radius: 22px;
    }

    .topbar,
    .topbar-actions,
    .drawer-header,
    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .roster-columns,
    .roster-item {
        grid-template-columns: minmax(0, 1fr) 56px;
        gap: 8px;
    }
}
