:root {
    --ink: #261b27;
    --muted: #746a75;
    --cream: #fffaf4;
    --paper: #ffffff;
    --coral: #ff6f61;
    --coral-dark: #e85349;
    --lilac: #ded2ff;
    --purple: #7151a8;
    --yellow: #ffd76a;
    --line: #eadfe4;
    --shadow: 0 24px 70px rgba(71, 41, 61, .13);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--cream);
    font-family: "DM Sans", sans-serif;
    -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

.site-header, .room-header {
    width: min(1180px, calc(100% - 40px));
    min-height: 82px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.brand { font-size: 26px; font-weight: 500; letter-spacing: -1.5px; }
.brand b { color: var(--coral); font-size: 32px; font-family: "Playfair Display", serif; }
.site-header nav { display: flex; align-items: center; gap: 28px; font-size: 14px; font-weight: 600; }
.site-header nav > a:not(.button):hover { color: var(--coral); }
.host-pill { padding: 8px 13px; background: #f1e9ff; border-radius: 999px; }

.button {
    border: 0;
    border-radius: 999px;
    padding: 14px 23px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 700;
    transition: transform .2s, box-shadow .2s, background .2s;
}
.button:hover:not(:disabled) { transform: translateY(-2px); }
.button:disabled { opacity: .6; cursor: wait; }
.button-primary { color: white; background: var(--coral); box-shadow: 0 10px 24px rgba(255, 111, 97, .28); }
.button-primary:hover:not(:disabled) { background: var(--coral-dark); }
.button-dark { color: white; background: var(--ink); }
.button-ghost { border: 1px solid var(--line); background: white; }
.button-small { padding: 9px 16px; font-size: 13px; }
.button-full { width: 100%; }
.button-meet { background: #e9f3ff; color: #1768c5; }

.hero {
    width: min(1180px, calc(100% - 40px));
    min-height: 650px;
    margin: 10px auto 70px;
    display: grid;
    grid-template-columns: 1.02fr .98fr;
    align-items: center;
    gap: 40px;
}
.eyebrow { color: var(--coral); text-transform: uppercase; letter-spacing: 2.2px; font-size: 11px; font-weight: 800; }
.hero h1, .games-section h2, .how-section h2, .start-panel h2, .modal h2, .room-shell h1 {
    font-family: "Playfair Display", serif;
    letter-spacing: -2px;
}
.hero h1 { max-width: 620px; margin: 18px 0 24px; font-size: clamp(48px, 6.1vw, 83px); line-height: .98; }
.hero h1 em { color: var(--coral); font-weight: inherit; }
.hero-copy > p { max-width: 560px; color: var(--muted); font-size: 18px; line-height: 1.65; }
.hero-actions { margin-top: 32px; display: flex; align-items: center; gap: 25px; }
.text-link { border-bottom: 1px solid var(--ink); font-size: 14px; font-weight: 700; }
.trust-row { display: flex; gap: 22px; margin-top: 38px; color: var(--muted); font-size: 12px; }

.hero-art {
    min-height: 560px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    isolation: isolate;
}
.hero-art::before {
    content: "";
    position: absolute;
    inset: 10% 3%;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #f2ebff, #e0d4ff 50%, #cbb8f1);
    z-index: -3;
}
.orbit { position: absolute; border: 1px solid rgba(113, 81, 168, .2); border-radius: 50%; z-index: -2; transform: rotate(-20deg); }
.orbit-one { width: 108%; height: 61%; }
.orbit-two { width: 75%; height: 86%; transform: rotate(31deg); }
.phone {
    width: 220px; height: 438px;
    padding: 34px 18px 20px;
    position: absolute;
    border: 8px solid var(--ink);
    border-radius: 36px;
    background: var(--paper);
    box-shadow: var(--shadow);
    text-align: center;
}
.phone-left { transform: translate(-82px, -28px) rotate(-7deg); }
.phone-right { transform: translate(95px, 38px) rotate(7deg); }
.phone-top { position: absolute; width: 75px; height: 16px; top: 0; left: calc(50% - 37px); background: var(--ink); border-radius: 0 0 12px 12px; }
.phone .avatar { width: 52px; height: 52px; margin: 8px auto 16px; display: grid; place-items: center; border-radius: 50%; font-family: "Playfair Display", serif; font-size: 24px; font-weight: 700; }
.avatar-one { background: var(--yellow); }
.avatar-two { background: var(--lilac); }
.phone small, .phone strong { display: block; }
.phone small { color: var(--muted); margin-bottom: 12px; font-size: 11px; }
.phone strong { margin: 0 auto 22px; font-family: "Playfair Display", serif; font-size: 20px; }
.mini-choice { padding: 11px; border: 1px solid var(--line); border-radius: 11px; margin: 9px 0; font-size: 12px; }
.mini-choice.selected { border-color: var(--coral); background: #fff0ee; }
.heart-pulse { width: 95px; height: 95px; margin: 40px auto 22px; display: grid; place-items: center; border-radius: 50%; color: var(--coral); background: #fff0ee; font-size: 42px; animation: pulse 1.7s infinite; }
@keyframes pulse { 50% { transform: scale(1.07); box-shadow: 0 0 0 18px rgba(255, 111, 97, .07); } }
.floating-note { position: absolute; z-index: 3; padding: 10px 15px; border-radius: 12px; background: white; box-shadow: var(--shadow); font-size: 12px; font-weight: 800; }
.note-one { top: 16%; right: 1%; color: var(--purple); transform: rotate(5deg); }
.note-two { bottom: 13%; left: 2%; color: var(--coral); transform: rotate(-5deg); }

.start-panel {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto 100px;
    padding: 45px 50px;
    display: grid;
    grid-template-columns: .8fr 1.2fr;
    align-items: center;
    gap: 40px;
    border-radius: 28px;
    color: white;
    background: var(--ink);
}
.start-panel h2 { margin: 8px 0; font-size: 36px; }
.start-panel p { margin: 0; color: #cfc4ce; }
.start-actions { display: grid; gap: 14px; }
.inline-form, .join-form { display: flex; gap: 10px; }
.inline-form input, .join-form input { flex: 1; min-width: 0; padding: 13px 18px; border: 1px solid #665866; border-radius: 999px; color: white; background: #3a2d3a; outline: none; }
.join-form input { text-transform: uppercase; letter-spacing: 3px; }
.config-note { color: #a99ca8; font-size: 11px; }

.games-section, .how-section { width: min(1180px, calc(100% - 40px)); margin: 0 auto 110px; text-align: center; }
.games-section h2, .how-section h2 { margin: 10px 0 45px; font-size: clamp(38px, 5vw, 58px); }
.game-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; text-align: left; }
.game-card { min-height: 390px; padding: 30px; position: relative; display: flex; flex-direction: column; border-radius: 24px; overflow: hidden; }
.game-lilac { background: var(--lilac); }
.game-coral { color: white; background: #f77b6f; }
.game-yellow { background: var(--yellow); }
.game-green { color: white; background: #14845f; }
.game-number { position: absolute; top: 26px; right: 28px; font: 700 60px "Playfair Display", serif; opacity: .12; }
.game-icon { width: 60px; height: 60px; display: grid; place-items: center; border-radius: 18px; background: rgba(255,255,255,.6); font: 700 30px "Playfair Display", serif; }
.game-card h3 { margin: auto 0 10px; font: 700 32px "Playfair Display", serif; }
.game-card p { min-height: 72px; margin: 0 0 22px; line-height: 1.55; opacity: .78; }
.game-tag { align-self: flex-start; padding: 7px 11px; border: 1px solid currentColor; border-radius: 999px; font-size: 11px; font-weight: 700; opacity: .75; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 35px; }
.steps b { width: 48px; height: 48px; margin: auto; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--coral); }
.steps h3 { font-family: "Playfair Display", serif; font-size: 23px; }
.steps p { color: var(--muted); }

.modal {
    width: min(520px, calc(100% - 30px));
    padding: 38px;
    border: 0;
    border-radius: 26px;
    color: var(--ink);
    box-shadow: var(--shadow);
}
.modal::backdrop { background: rgba(31, 21, 30, .7); backdrop-filter: blur(5px); }
.modal-close { position: absolute; top: 16px; right: 18px; border: 0; background: none; cursor: pointer; font-size: 28px; }
.modal h2 { margin: 8px 0 24px; font-size: 38px; }
.modal label, .join-card label { display: grid; gap: 8px; margin: 15px 0; font-size: 13px; font-weight: 700; }
.modal input[type=text], .modal input[type=url], .join-card input, .answer-form input {
    width: 100%; padding: 14px 15px; border: 1px solid var(--line); border-radius: 12px; outline: none;
}
.modal input:focus, .join-card input:focus, .answer-form input:focus { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(255, 111, 97, .1); }
.modal fieldset { padding: 0; border: 0; }
.modal legend { margin: 12px 0 5px; font-size: 13px; font-weight: 700; }
.radio-card { cursor: pointer; }
.radio-card input { position: absolute; opacity: 0; }
.radio-card span { padding: 13px 15px; display: flex; justify-content: space-between; border: 1px solid var(--line); border-radius: 12px; }
.radio-card small, .toggle-row small { color: var(--muted); font-weight: 400; }
.radio-card input:checked + span { border-color: var(--coral); background: #fff4f2; }
.toggle-row { padding: 10px 0; display: flex !important; grid-template-columns: 1fr auto; align-items: center; justify-content: space-between; }
.toggle-row span { display: grid; }
.toggle-row input { width: 42px; height: 22px; accent-color: var(--coral); }
.form-error, .game-error { min-height: 20px; color: #c63831; font-size: 13px; }
.flash { width: min(800px, calc(100% - 40px)); margin: 10px auto; padding: 13px 18px; border-radius: 12px; color: #8b3b35; background: #ffe6e2; text-align: center; }
footer { padding: 35px max(20px, calc((100% - 1180px) / 2)); display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

.room-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 0 0, rgba(222,210,255,.65), transparent 28%),
        radial-gradient(circle at 100% 100%, rgba(255,215,106,.5), transparent 28%),
        var(--cream);
}
.room-header { min-height: 72px; }
.room-code { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.room-code button { margin-left: 5px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: white; cursor: pointer; font-weight: 800; letter-spacing: 2px; }
.room-shell { width: min(900px, calc(100% - 30px)); min-height: calc(100vh - 110px); margin: 15px auto; display: grid; place-items: center; }
.loading-card, .join-card, .lobby-card, .reveal-card, .complete-card {
    width: min(650px, 100%);
    padding: clamp(28px, 6vw, 55px);
    border: 1px solid rgba(234,223,228,.8);
    border-radius: 30px;
    background: rgba(255,255,255,.92);
    box-shadow: var(--shadow);
    text-align: center;
}
.room-shell h1 { margin: 12px 0; font-size: clamp(35px, 7vw, 54px); }
.room-shell p { color: var(--muted); line-height: 1.6; }
.loader-heart { margin: 5px auto 15px; color: var(--coral); font-size: 40px; animation: pulse 1.5s infinite; }
.join-card form { max-width: 390px; margin: 25px auto 0; text-align: left; }
.lobby-top { display: flex; align-items: center; justify-content: center; gap: 12px; }
.spicy-badge { padding: 5px 9px; border-radius: 99px; color: #ab4039; background: #ffe3df; font-size: 10px; font-weight: 800; }
.players-row { margin: 35px 0; display: grid; grid-template-columns: 1fr 100px 1fr; align-items: center; }
.player { min-width: 0; display: flex; align-items: center; gap: 11px; text-align: left; }
.player > span { flex: 0 0 42px; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--lilac); font: 700 19px "Playfair Display", serif; }
.player.is-you > span { background: var(--yellow); }
.player div { min-width: 0; display: grid; }
.player b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.player small { color: var(--muted); font-size: 10px; }
.player.waiting { opacity: .5; }
.connection-line { display: flex; align-items: center; color: var(--coral); }
.connection-line i { flex: 1; height: 1px; background: var(--line); }
.connection-line span { padding: 0 7px; }
.invite-box { padding: 18px; border-radius: 15px; background: #f9f5fa; text-align: left; }
.invite-box label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 1px; }
.invite-box div { display: flex; gap: 8px; }
.invite-box input { min-width: 0; flex: 1; padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.invite-box button { border: 0; border-radius: 9px; color: white; background: var(--ink); cursor: pointer; }
.lobby-tip { margin-top: 18px; color: var(--muted); font-size: 11px; }

.game-stage { width: 100%; }
.scorebar { margin-bottom: 20px; padding: 14px 18px; display: grid; grid-template-columns: 1fr 180px 1fr; gap: 18px; align-items: center; border-radius: 18px; background: rgba(255,255,255,.9); box-shadow: 0 10px 30px rgba(71,41,61,.08); }
.scorebar .player:last-child { justify-content: flex-end; }
.scorebar .player:last-child div { order: -1; text-align: right; }
.round-count { text-align: center; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 1px; }
.round-count > div { height: 5px; margin-top: 7px; overflow: hidden; border-radius: 5px; background: var(--line); }
.round-count i { height: 100%; display: block; border-radius: 5px; background: var(--coral); transition: width .4s; }
.question-card { padding: clamp(28px, 6vw, 58px); border-radius: 30px; background: white; box-shadow: var(--shadow); text-align: center; }
.question-meta { display: flex; justify-content: center; gap: 10px; color: var(--purple); text-transform: uppercase; letter-spacing: 1.4px; font-size: 10px; font-weight: 800; }
.question-card .instruction { margin: 12px 0; font-size: 13px; }
.question-card h1 { max-width: 690px; margin: 15px auto 32px; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice { min-height: 70px; padding: 12px 16px; display: flex; align-items: center; gap: 13px; border: 1px solid var(--line); border-radius: 15px; background: white; color: var(--ink); cursor: pointer; text-align: left; font-weight: 600; transition: .2s; }
.choice:hover { border-color: var(--coral); background: #fff6f4; transform: translateY(-2px); }
.choice span { flex: 0 0 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: #f4eef9; color: var(--purple); }
.answer-form { max-width: 520px; margin: auto; display: flex; gap: 10px; }
.waiting-answer { padding: 22px; border-radius: 16px; background: #faf6fb; }
.waiting-answer .loader-heart { margin: 0 auto 5px; font-size: 30px; }
.waiting-answer p { margin: 4px 0 0; font-size: 12px; }
.dare-actions { display: flex; justify-content: center; gap: 12px; }

.reveal-card .result-icon, .complete-card .result-icon, .join-card .result-icon { width: 78px; height: 78px; margin: 0 auto 15px; display: grid; place-items: center; border-radius: 50%; color: var(--purple); background: var(--lilac); font-size: 34px; }
.result-icon.success { color: var(--coral); background: #ffe4e0; }
.reveal-answers { margin: 28px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.reveal-answers div { padding: 18px; display: grid; gap: 5px; border-radius: 14px; background: #faf6fb; }
.reveal-answers small { color: var(--muted); text-transform: uppercase; letter-spacing: 1px; font-size: 9px; }
.reveal-scores { margin: 20px 0 28px; display: flex; justify-content: space-around; }
.final-scores { margin: 35px 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; }
.final-scores > b { font: 700 28px "Playfair Display", serif; }
.final-scores .player:last-child div { order: -1; text-align: right; }
.complete-actions { display: flex; justify-content: center; gap: 10px; margin-bottom: 22px; }

@media (max-width: 800px) {
    .site-header nav > a:not(.button), .host-pill { display: none; }
    .hero { grid-template-columns: 1fr; text-align: center; }
    .hero-copy > p { margin-inline: auto; }
    .hero-actions, .trust-row { justify-content: center; }
    .hero-art { min-height: 500px; }
    .start-panel { grid-template-columns: 1fr; text-align: center; }
    .game-grid, .steps { grid-template-columns: 1fr; }
    .game-card { min-height: 330px; }
}
@media (max-width: 560px) {
    .site-header, .room-header { width: calc(100% - 28px); }
    .site-header { min-height: 68px; }
    .site-header nav { gap: 8px; }
    .hero { width: calc(100% - 28px); min-height: 0; margin-top: 40px; }
    .hero h1 { font-size: 48px; }
    .hero-copy > p { font-size: 16px; }
    .hero-actions { flex-direction: column; }
    .trust-row { flex-wrap: wrap; gap: 10px 16px; }
    .hero-art { min-height: 390px; }
    .phone { width: 160px; height: 326px; padding: 27px 12px 14px; border-width: 6px; border-radius: 28px; }
    .phone-left { transform: translate(-57px, -20px) rotate(-7deg); }
    .phone-right { transform: translate(61px, 25px) rotate(7deg); }
    .phone .avatar { width: 40px; height: 40px; margin-bottom: 9px; font-size: 18px; }
    .phone strong { margin-bottom: 11px; font-size: 14px; }
    .mini-choice { padding: 7px; margin: 6px 0; }
    .heart-pulse { width: 65px; height: 65px; margin: 26px auto 15px; font-size: 28px; }
    .floating-note { display: none; }
    .start-panel { width: calc(100% - 28px); padding: 32px 20px; }
    .inline-form, .join-form { flex-direction: column; }
    .games-section, .how-section { width: calc(100% - 28px); }
    footer { gap: 15px; flex-wrap: wrap; }
    .room-header { flex-wrap: wrap; padding: 10px 0; }
    .button-meet { order: 3; width: 100%; }
    .room-shell { min-height: calc(100vh - 100px); }
    .players-row { grid-template-columns: 1fr 35px 1fr; }
    .connection-line i { display: none; }
    .player { flex-direction: column; text-align: center; }
    .scorebar { grid-template-columns: 1fr 90px 1fr; padding: 11px; gap: 5px; }
    .scorebar .player { flex-direction: row; text-align: left; }
    .scorebar .player > span { flex-basis: 34px; width: 34px; height: 34px; }
    .scorebar .player:last-child { flex-direction: row; }
    .scorebar .player:last-child div { display: none; }
    .scorebar .player:first-child div { display: none; }
    .question-card { border-radius: 22px; }
    .choice-grid, .reveal-answers { grid-template-columns: 1fr; }
    .answer-form, .dare-actions, .complete-actions { flex-direction: column; }
    .reveal-scores { gap: 25px; }
    .final-scores { grid-template-columns: 1fr; }
    .final-scores .player { justify-content: center; }
    .final-scores .player:last-child div { order: 0; text-align: left; }
}
