@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700;800&display=swap');

:root {
    --primary: #ff4757;
    --primary-dark: #ff3838;
    --primary-light: #ff6b7a;
    --bg-1: #0f1419;
    --bg-2: #1a1f2e;
    --panel: rgba(26, 31, 46, 0.85);
    --panel-border: rgba(255, 71, 87, 0.3);
    --text-main: #ffffff;
    --text-muted: #b8c5d6;
    --danger: #ff5252;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Manrope', sans-serif;
    color: var(--text-main);
    background: 
        radial-gradient(circle at 15% 20%, rgba(255, 71, 87, 0.12), transparent 35%),
        radial-gradient(circle at 82% 12%, rgba(255, 107, 122, 0.08), transparent 38%),
        linear-gradient(145deg, var(--bg-1), var(--bg-2));
    background-attachment: fixed;
}

.host-layout {
    width: min(1220px, 100% - 32px);
    margin: 22px auto 34px;
    display: grid;
    gap: 16px;
}

.top-bar,
.control-panel,
.turn-panel,
.scoreboard-box,
.log-box,
.stage-wrap {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.top-bar {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.eyebrow {
    margin: 0;
    letter-spacing: 0.08em;
    color: var(--primary);
    text-transform: uppercase;
    font-size: 0.72rem;
    font-weight: 600;
}

h1 {
    margin: 4px 0 0;
    letter-spacing: 0.04em;
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    font-weight: 700;
    color: var(--text-main);
}

.home-link {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 700;
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 8px 14px;
    transition: all 0.3s ease;
}

.home-link:hover {
    background: rgba(255, 71, 87, 0.1);
    transform: translateY(-2px);
}

.control-panel {
    padding: 14px 18px;
    display: grid;
    gap: 10px;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.room-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.room-meta p {
    margin: 0;
    color: var(--text-muted);
}

code {
    color: var(--text-main);
    background: rgba(255, 71, 87, 0.1);
    border-radius: 8px;
    padding: 2px 8px;
    border: 1px solid rgba(255, 71, 87, 0.2);
    font-family: 'Courier New', monospace;
}

.host-status {
    margin: 0;
    color: var(--text-muted);
}

.btn {
    border: none;
    border-radius: 12px;
    padding: 11px 18px;
    font-family: inherit;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(255, 71, 87, 0.2);
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.btn.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.3);
}

.btn.accent {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.2);
}

.btn.subtle {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stage-wrap {
    padding: 14px;
}

.arena {
    min-height: 480px;
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background:
        radial-gradient(circle at center, rgba(255, 71, 87, 0.1), transparent 48%),
        linear-gradient(180deg, rgba(15, 20, 25, 0.4), rgba(15, 20, 25, 0.82));
    border: 1px solid rgba(255, 71, 87, 0.2);
}

.player-ring {
    position: absolute;
    inset: 0;
}

.ring-placeholder {
    position: absolute;
    left: 50%;
    top: 72%;
    transform: translate(-50%, -50%);
    margin: 0;
    color: var(--text-muted);
}

.host-avatar {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.host-head {
    --look-angle: 0deg;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    position: relative;
    transform: rotate(var(--look-angle));
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.hair {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 25%, #4f2f1b, #2b140c 75%);
}

.face {
    position: absolute;
    left: 50%;
    top: 54%;
    width: 82px;
    height: 90px;
    transform: translate(-50%, -50%);
    border-radius: 42% 42% 48% 48%;
    background: linear-gradient(180deg, #f5d7b6, #dfb78f);
    border: 2px solid rgba(60, 30, 16, 0.45);
}

.eye {
    position: absolute;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #311a0f;
    top: 34px;
}

.eye.left {
    left: 22px;
}

.eye.right {
    right: 22px;
}

.mouth {
    position: absolute;
    left: 50%;
    bottom: 17px;
    width: 28px;
    height: 10px;
    transform: translateX(-50%);
    border-bottom: 3px solid #6e2b1f;
    border-radius: 0 0 18px 18px;
}

.host-label {
    margin: 0;
    color: var(--primary);
    font-size: 0.9rem;
    letter-spacing: 0.03em;
    font-weight: 600;
}

.seat {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 132px;
    padding: 8px;
    border-radius: 14px;
    text-align: center;
    background: rgba(26, 31, 46, 0.9);
    border: 2px solid rgba(255, 71, 87, 0.2);
    transition: all 0.2s ease;
}

.seat.active {
    transform: translate(-50%, -50%) scale(1.05);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 71, 87, 0.2);
}

.seat.out {
    opacity: 0.45;
}

.seat.offline {
    border-style: dashed;
    opacity: 0.5;
}

.seat-name,
.seat-hp,
.seat-score,
.seat-tag {
    margin: 0;
}

.seat-name {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-main);
}

.seat-hp {
    margin-top: 4px;
    color: var(--danger);
    font-size: 0.82rem;
    font-weight: 600;
}

.seat-score {
    color: var(--primary);
    font-size: 0.78rem;
    margin-top: 2px;
    font-weight: 600;
}

.seat-tag {
    margin-top: 4px;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
}

.turn-panel {
    padding: 14px 18px;
    display: grid;
    gap: 10px;
}

.turn-line {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    color: var(--text-muted);
}

.turn-line p,
.prompt-label,
.turn-prompt,
.turn-category {
    margin: 0;
}

.prompt-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
    color: var(--primary);
    font-weight: 600;
}

.turn-prompt {
    font-size: 1.15rem;
    line-height: 1.42;
    color: var(--text-main);
}

.turn-category {
    color: var(--text-muted);
    font-size: 0.92rem;
}

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

.scoreboard-box,
.log-box {
    padding: 14px 16px;
}

h2 {
    margin: 0 0 10px;
    font-size: 1.02rem;
    color: var(--primary);
    font-weight: 700;
}

.scoreboard-list,
.event-log {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 7px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.event-log li {
    line-height: 1.35;
}

.log-correct {
    color: #6ee7b7;
}

.log-wrong {
    color: #ff7c7c;
}

.log-over {
    color: var(--primary);
    font-weight: 600;
}

@media (max-width: 980px) {
    .bottom-grid {
        grid-template-columns: 1fr;
    }

    .arena {
        min-height: 560px;
    }

    .seat {
        width: 116px;
    }
}

@media (max-width: 680px) {
    .host-layout {
        width: min(1220px, 100% - 18px);
        margin-top: 12px;
    }

    .top-bar,
    .control-panel,
    .turn-panel,
    .scoreboard-box,
    .log-box,
    .stage-wrap {
        border-radius: 14px;
    }

    .arena {
        min-height: 620px;
    }

    .host-head {
        width: 116px;
        height: 116px;
    }

    .face {
        width: 70px;
        height: 78px;
    }

    .seat {
        width: 104px;
        padding: 6px;
    }

    .seat-name {
        font-size: 0.76rem;
    }
}
