* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

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

body {
    background: #2b1467;
    background-image: linear-gradient(160deg, #2b1467 0%, #7f2f95 58%, #ff4d79 100%);
    color: #fff8e7;
    font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
}

button,
input {
    font: inherit;
}

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

.phone-shell {
    width: 100%;
    max-width: 680px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 16px;
}

.phone-header {
    display: flex;
    min-height: 76px;
    padding: 14px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    background: rgba(31, 12, 79, 0.84);
    box-shadow: 0 12px 30px rgba(19, 6, 48, 0.3);
    align-items: center;
}

.apps-button {
    display: flex;
    width: 56px;
    min-width: 56px;
    min-height: 48px;
    border: 2px solid rgba(255, 255, 255, 0.32);
    border-radius: 14px;
    background: #4a278e;
    color: #fff8e7;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    text-decoration: none;
    align-items: center;
    justify-content: center;
}

.apps-button-icon {
    margin-right: 3px;
    font-size: 25px;
    line-height: 16px;
}

.apps-button:focus {
    outline: 3px solid #ffd84d;
    outline-offset: 2px;
}

.apps-button:active {
    background: #6844ae;
}

.apps-button[aria-disabled="true"] {
    opacity: 0.55;
    pointer-events: none;
}

.phone-title {
    min-width: 0;
    margin-left: 12px;
    flex: 1 1 auto;
}

.eyebrow {
    margin: 0;
    color: #ffd84d;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.16em;
    line-height: 1.1;
    text-transform: uppercase;
}

.phone-header h1 {
    margin: 5px 0 0;
    overflow: hidden;
    font-size: 24px;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.score-pill {
    min-width: 70px;
    margin-left: auto;
    padding: 8px 10px;
    border-radius: 14px;
    background: #fff8e7;
    color: #2b1467;
    text-align: center;
}

@media (max-width: 380px) {
    .apps-button {
        width: 50px;
        min-width: 50px;
    }

    .phone-title {
        margin-left: 8px;
    }

    .phone-header h1 {
        font-size: 20px;
    }

    .phone-title .eyebrow {
        font-size: 9px;
        letter-spacing: 0.1em;
    }

    .score-pill {
        min-width: 60px;
        padding-right: 7px;
        padding-left: 7px;
    }
}

.score-pill span,
.score-pill strong {
    display: block;
}

.score-pill span {
    color: #a82571;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.score-pill strong {
    margin-top: 2px;
    font-size: 25px;
    line-height: 1;
}

.join-view,
.status-card,
.answer-card,
.leaderboard-card {
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(31, 12, 79, 0.88);
    box-shadow: 0 12px 30px rgba(19, 6, 48, 0.28);
}

.join-view {
    margin-top: 14px;
    padding: 28px 20px;
    border-radius: 22px;
    text-align: center;
}

.ticket-icon {
    width: 84px;
    height: 84px;
    margin: 0 auto 18px;
    border: 4px solid #fff8e7;
    border-radius: 22px;
    background: #ff4d79;
    box-shadow: 0 7px 0 #a82571;
    font-size: 58px;
    font-weight: 900;
    line-height: 78px;
    transform: rotate(-5deg);
}

.join-view h2 {
    margin: 8px 0 20px;
    font-size: 29px;
}

.join-view label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.join-view input {
    width: 100%;
    min-height: 56px;
    padding: 0 16px;
    border: 3px solid #8e6bd4;
    border-radius: 16px;
    background: #fff;
    color: #2b1467;
    font-size: 18px;
    font-weight: 900;
    text-align: center;
}

.join-view input:focus {
    border-color: #ffd84d;
    outline: none;
}

.primary-button {
    width: 100%;
    min-height: 56px;
    margin-top: 14px;
    border: 0;
    border-radius: 28px;
    background: #ffd84d;
    color: #2b1467;
    box-shadow: 0 6px 0 #e9862d;
    font-size: 18px;
    font-weight: 900;
}

.primary-button:active {
    box-shadow: none;
    transform: translateY(5px);
}

.primary-button:disabled {
    cursor: default;
    opacity: 0.65;
    box-shadow: none;
    transform: none;
}

.game-start-button {
    margin-top: 16px;
}

.connection-copy {
    margin: 20px 0 0;
    color: #d9c8ff;
    font-size: 13px;
}

.game-view {
    padding-bottom: 18px;
}

.round-strip {
    display: flex;
    min-height: 67px;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 18px;
    background: rgba(31, 12, 79, 0.82);
    align-items: center;
}

.phase-pill,
.network-state,
.answer-heading > span {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 14px;
    background: #58ebdf;
    color: #231052;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.round-strip > div > strong {
    display: block;
    margin-top: 5px;
    font-size: 15px;
}

.timer-pill {
    min-width: 58px;
    margin-left: auto;
    padding: 7px;
    border-radius: 13px;
    background: #fff8e7;
    color: #2b1467;
    text-align: center;
}

.timer-pill span,
.timer-pill strong {
    display: block;
}

.timer-pill span {
    color: #a82571;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.timer-pill strong {
    margin-top: 2px;
    font-size: 24px;
    line-height: 1;
}

.status-card {
    margin-top: 12px;
    padding: 17px;
    border-radius: 19px;
    text-align: center;
}

.status-card h2 {
    margin: 6px 0;
    font-size: 23px;
    line-height: 1.05;
}

.status-card p:not(.eyebrow) {
    margin: 0;
    color: #e9dcff;
    font-size: 14px;
    line-height: 1.35;
}

.status-card.is-correct {
    background: #116e64;
    border-color: #7dffe3;
}

.status-card.is-wrong {
    background: #8f275f;
    border-color: #ffabc5;
}

.status-card.is-fastest {
    background: #8a5b16;
    border-color: #ffe179;
}

.answer-card,
.leaderboard-card {
    margin-top: 12px;
    padding: 14px;
    border-radius: 19px;
}

.answer-heading,
.leaderboard-heading {
    display: flex;
    align-items: center;
}

.answer-heading h2,
.leaderboard-heading h2 {
    margin: 4px 0 0;
    font-size: 20px;
}

.answer-heading > span,
.network-state {
    margin-left: auto;
}

.answer-list {
    margin-top: 12px;
}

.answer-button {
    position: relative;
    display: block;
    width: 100%;
    min-height: 54px;
    padding: 9px 11px 9px 52px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    background: #4b278f;
    color: #fff;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.15;
    text-align: left;
}

.answer-button + .answer-button {
    margin-top: 8px;
}

.answer-button:active:not(:disabled) {
    background: #7246bf;
    transform: scale(0.985);
}

.answer-letter {
    position: absolute;
    top: 50%;
    left: 11px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff8e7;
    color: #3a1b79;
    line-height: 32px;
    text-align: center;
    transform: translateY(-50%);
}

.answer-button.is-selected {
    background: #7050cc;
    border-color: #ffd84d;
}

.answer-button.is-correct {
    background: #138b71;
    border-color: #7dffe3;
}

.answer-button.is-wrong {
    background: #a72c67;
    border-color: #ffabc5;
}

.leaderboard {
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

.leader-row {
    display: flex;
    min-height: 42px;
    padding: 8px 10px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.09);
    align-items: center;
}

.leader-row + .leader-row {
    margin-top: 6px;
}

.leader-rank {
    width: 28px;
    color: #ffd84d;
    font-weight: 900;
}

.leader-name {
    min-width: 0;
    overflow: hidden;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1 1 auto;
}

.leader-score {
    margin-left: 8px;
    color: #7dffe3;
    font-weight: 900;
}

.leader-row.is-you {
    border: 2px solid #ffd84d;
}

@media (min-width: 540px) {
    .answer-list {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .answer-button {
        width: 49.2%;
    }

    .answer-button + .answer-button {
        margin-top: 0;
    }

    .answer-button:nth-child(n+3) {
        margin-top: 8px;
    }
}

@media (max-height: 720px) {
    .phone-shell {
        padding: 10px;
    }

    .phone-header {
        min-height: 64px;
        padding: 10px 12px;
    }

    .answer-button {
        min-height: 47px;
        font-size: 13px;
    }
}
