* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    background: #2b3245;
    font-family: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", system-ui, sans-serif;
    color: #2b2b3a;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

#game {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    touch-action: none;
}

.hidden {
    display: none !important;
}

/* ---- The bar over the game ---- */

#hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: env(safe-area-inset-top) 12px 0;
    pointer-events: none;
}

#floor-label {
    font-size: 34px;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}

#pause-btn {
    position: absolute;
    right: 12px;
    pointer-events: auto;
}

/* ---- Screens over the game ---- */

.screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(25, 30, 50, 0.55);
    overflow-y: auto;
}

/* Let the confetti show through. */
#won {
    background: rgba(25, 30, 50, 0.15);
}

/* The chat and settings sit high, so the iPad keyboard doesn't cover them. */
.screen.top {
    align-items: flex-start;
    padding-top: max(3vh, env(safe-area-inset-top));
}

.card {
    background: #ffffff;
    border-radius: 32px;
    padding: 24px 32px;
    max-width: 560px;
    width: 100%;
    text-align: center;
    box-shadow: 0 12px 0 rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.card.wide {
    max-width: 760px;
}

h1 {
    margin: 0;
    font-size: 52px;
    line-height: 1.05;
    color: #e0479a;
}

h2 {
    margin: 0;
    font-size: 36px;
}

h3 {
    margin: 12px 0 0;
    font-size: 22px;
}

p {
    margin: 0;
    font-size: 26px;
}

.face {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, #fff1f8 0%, #ffd9ec 70%);
    border-radius: 50%;
}

.small-face {
    width: 150px;
    height: 150px;
    flex: none;
}

/* ---- Buttons ---- */

button {
    font: inherit;
    border: none;
    cursor: pointer;
    touch-action: manipulation;
}

button.big {
    min-height: 76px;
    min-width: 240px;
    padding: 0 36px;
    font-size: 34px;
    font-weight: 800;
    border-radius: 40px;
    color: #ffffff;
    background: #e0479a;
    box-shadow: 0 6px 0 #a3276b;
}

button.big.go {
    background: #23b26d;
    box-shadow: 0 6px 0 #16804c;
}

button.big:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}

button.small {
    min-height: 52px;
    padding: 0 24px;
    font-size: 22px;
    border-radius: 26px;
    background: #eef0f6;
    color: #3a3f55;
}

button.round {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    font-size: 24px;
    background: rgba(255, 255, 255, 0.9);
}

/* ---- Talking ---- */

.chat-top {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    text-align: left;
}

.chat-words {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.name {
    font-size: 24px;
    font-weight: 800;
    color: #6b6f85;
}

.bubble {
    position: relative;
    background: #fff4c2;
    border-radius: 24px;
    padding: 16px 20px;
    font-size: 30px;
    line-height: 1.25;
    min-height: 72px;
}

.bubble.thinking {
    font-size: 44px;
    animation: pulse 0.8s ease-in-out infinite alternate;
}

@keyframes pulse {
    to {
        opacity: 0.3;
    }
}

.you {
    align-self: flex-end;
    background: #ffd9ec;
    border-radius: 24px;
    padding: 12px 20px;
    font-size: 26px;
    max-width: 85%;
    text-align: right;
}

#chat-form {
    display: flex;
    gap: 12px;
    width: 100%;
}

input[type="text"],
input[type="password"] {
    flex: 1;
    width: 100%;
    min-height: 72px;
    padding: 0 20px;
    font: inherit;
    font-size: 28px;
    border: 4px solid #e0479a;
    border-radius: 24px;
    outline: none;
    -webkit-user-select: text;
    user-select: text;
}

#chat-form button.big {
    min-width: 0;
}

.note {
    font-size: 16px;
    color: #8a8fa5;
}

/* ---- Settings ---- */

.grown-ups {
    text-align: left;
    align-items: stretch;
}

.grown-ups h2,
.grown-ups h3 {
    text-align: center;
}

.fine {
    font-size: 17px;
    color: #555a70;
}

.row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 26px;
}

.row input[type="checkbox"] {
    width: 32px;
    height: 32px;
}

#key-input {
    font-size: 20px;
    border-color: #9aa0b8;
}

#key-status {
    font-size: 18px;
}

#settings-done-btn {
    align-self: center;
}

/* Small screens, like a phone held sideways. */
@media (max-height: 600px) {
    h1 {
        font-size: 36px;
    }

    .face {
        width: 120px;
        height: 120px;
    }

    p {
        font-size: 20px;
    }
}
