/* Redesign layer (preview). Loaded after style.css and overrides it:
   one primary and one secondary button, 44px+ touch targets, a deck instead
   of the tile grid, a timer ring, and a result-first end screen. */

:root {
    --cream: #f5f1e8;
    --teal-soft: #1d5669;
    --tap: 48px;
}

/* ---- Focus: every control gets a visible ring ---- */
button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--cream);
    outline-offset: 3px;
}
.modal-content.card button:focus-visible,
.modal-content.card a:focus-visible,
.modal-content.card input:focus-visible {
    outline-color: var(--teal-bg);
}

/* ---- Buttons ---- */
.rd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    padding: 10px 22px;
    border-radius: 999px;
    border: 1.5px solid var(--gold-text);
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 1.5px;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
}
.rd-btn:active { transform: scale(0.98); }
.rd-btn-primary { background: var(--gold-text); color: var(--teal-bg); min-height: 60px; font-size: 1.05rem; letter-spacing: 2px; }
.rd-btn-primary:hover { background: #d4b877; }
.rd-btn-big { min-height: 64px; font-size: 1.2rem; letter-spacing: 3px; }
.rd-btn-secondary { background: transparent; color: var(--gold-text); }
.rd-btn-secondary:hover { background: rgba(196, 163, 90, 0.15); }
.rd-btn-quiet { background: transparent; border-color: transparent; color: var(--cream); min-height: var(--tap); font-size: 0.85rem; text-decoration: underline; text-underline-offset: 4px; }
.rd-btn-narrow { width: auto; min-width: 200px; }
.rd-btn-add { width: auto; min-height: var(--tap); padding: 8px 20px; font-size: 0.9rem; }
.rd-btn:disabled { opacity: 0.45; cursor: not-allowed; }
/* On the cream cards the outline button needs teal to stay readable */
.modal-content.card .rd-btn-secondary { color: var(--teal-bg); border-color: var(--teal-bg); }
.modal-content.card .rd-btn-primary { background: var(--teal-bg); border-color: var(--teal-bg); color: var(--cream); }
.modal-content.card .rd-btn-primary:hover { background: #124d62; }

.rd-actions {
    width: 100%;
    max-width: 420px;
    margin-top: auto;
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.rd-row { width: 100%; display: flex; gap: 12px; }
.rd-row .rd-btn { flex: 1; padding-left: 10px; padding-right: 10px; font-size: 0.85rem; letter-spacing: 1px; }

.rd-text-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 4px 8px;
    color: var(--gold-text);
    font-size: 0.95rem;
    text-align: center;
    text-underline-offset: 4px;
}
.rd-text-link-quiet { color: var(--cream); font-size: 0.85rem; }
.rd-label { font-size: 0.8rem; font-weight: 700; letter-spacing: 1.5px; color: var(--gold-text); }

/* ---- Title ---- */
#title-screen { justify-content: flex-start; }
.rd-title-top {
    margin-top: auto;
    padding-top: 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
#title-screen .rd-actions { margin-top: auto; padding-top: 32px; }
.rd-scales { width: 56px; height: 56px; color: var(--gold-text); }
#title-screen .game-title { font-size: clamp(2.4rem, 11vw, 3.6rem); line-height: 1.12; margin: 20px 0 0; }
#title-screen .divider { width: 180px; margin: 18px auto 14px; }
#title-screen .sub-title { margin-bottom: 0; letter-spacing: 4px; font-size: 0.9rem; }
.rd-tagline { margin-top: 28px; font-size: 1.25rem; line-height: 1.5; color: var(--cream); }

/* ---- Theme picker ---- */
#theme-select-screen .screen-title { text-decoration: none; }
.theme-tile.disabled h3,
.theme-tile.disabled span:not(.theme-icon) { color: #595959; }
#back-to-rules-button { margin-top: 24px; }

/* ---- Menu arrow and menu ---- */
.down-arrow {
    width: 44px;
    height: 44px;
    top: max(12px, env(safe-area-inset-top));
    border: none;
    padding: 0;
    background-color: transparent;
    will-change: auto;
}
.down-arrow::after {
    content: '';
    width: 12px;
    height: 12px;
    margin-top: -6px;
    border-right: 2.5px solid var(--gold-text);
    border-bottom: 2.5px solid var(--gold-text);
    transform: rotate(45deg);
}
.down-arrow:hover { animation: none; }
.top-nav { top: max(12px, env(safe-area-inset-top)); background-color: var(--teal-soft); gap: 4px; padding: 4px 8px; max-width: calc(100% - 24px); }
.nav-link { min-height: 44px; padding: 8px 10px; font-size: 0.8rem; letter-spacing: 0.5px; }
.nav-link:hover { animation: none; }

/* ---- Draw a topic ---- */
#topic-select-screen,
#topic-display-screen,
#time-up-screen { justify-content: flex-start; gap: 16px; }
.rd-deck-head { margin-top: 52px; text-align: center; }
#topic-select-theme-title.screen-title { margin: 0; font-size: clamp(1.6rem, 6vw, 2.2rem); }
#topic-select-screen .current-theme-text { margin: 6px 0 0; font-size: 1.05rem; color: var(--gold-text); }
.rd-topics-left { margin-top: 4px; font-size: 1rem; color: var(--cream); }

.rd-deck {
    position: relative;
    flex: none;
    width: min(56vw, 220px);
    aspect-ratio: 234 / 314;
    margin: 8px 16px 16px 0;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.rd-deck:hover { transform: translateY(-3px); }
.rd-deck-card {
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background: var(--cream);
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.rd-deck-card-3 { transform: translate(16px, 16px); background: #d9d2c0; }
.rd-deck-card-2 { transform: translate(8px, 8px); background: #e8e2d3; }
.rd-deck-card-1 { border: 2px solid var(--gold-text); padding: 10px; display: flex; }
.rd-deck-face {
    flex: 1;
    border: 1px solid var(--gold-text);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--teal-bg);
}
.rd-deck-face .rd-scales { width: 30%; height: auto; color: var(--teal-bg); }
.rd-deck-name { font-family: 'Playfair Display', serif; font-size: 1rem; line-height: 1.25; }
.rd-deck-drawing .rd-deck-card-1 { transform: translateY(-40px) rotate(-6deg); opacity: 0; }
.rd-deck-spent .rd-deck-card-3,
.rd-deck-spent .rd-deck-card-2 { opacity: 0; }
.rd-deck-spent .rd-deck-card-1 { opacity: 0.45; }
.rd-deck-empty { max-width: 340px; text-align: center; font-size: 1rem; line-height: 1.45; color: var(--cream); }
.rd-deck-empty a { color: var(--gold-text); }

.rd-length { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.rd-chips { display: flex; gap: 8px; }
.rd-chip {
    width: 54px;
    height: var(--tap);
    border-radius: 999px;
    border: 1.5px solid var(--gold-text);
    background: transparent;
    color: var(--gold-text);
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
}
.rd-chip[aria-pressed="true"] { background: var(--gold-text); color: var(--teal-bg); }

/* ---- Discussion ---- */
#topic-display-screen .topic-card {
    width: 100%;
    max-width: 420px;
    min-height: 0;
    margin: 52px 0 0;
    padding: 22px 20px;
    border-radius: 16px;
    background: var(--cream);
}
#topic-display-screen #topic-text { font-size: clamp(1.2rem, 5.2vw, 1.6rem); line-height: 1.3; color: var(--teal-bg); }
.opener-line { font-size: 1rem; letter-spacing: 0; color: var(--cream); }
.opener-line strong { font-size: 1rem; color: var(--gold-text); }
#timer-display { max-width: none; width: auto; margin: 0; }

.rd-ring {
    position: relative;
    width: min(60vw, 236px);
    aspect-ratio: 1;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--cream);
    cursor: pointer;
}
.rd-ring-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.rd-ring-track { fill: none; stroke: var(--teal-soft); stroke-width: 12; }
.rd-ring-fill { fill: none; stroke: var(--gold-text); stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset 0.3s linear; }
.rd-ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.rd-ring-time { font-family: 'Playfair Display', serif; font-size: clamp(2.6rem, 14vw, 3.9rem); line-height: 1; font-variant-numeric: tabular-nums; }
.rd-ring-hint { font-size: 0.8rem; letter-spacing: 2px; color: var(--gold-text); }
.rd-ring-paused .rd-ring-time { opacity: 0.55; }

.rd-nudge {
    width: 100%;
    max-width: 420px;
    min-height: var(--tap);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--gold-text);
    border-radius: 12px;
    background: transparent;
    color: var(--cream);
    font-family: 'Lato', sans-serif;
    font-size: 0.95rem;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
}
.rd-nudge svg { flex: none; width: 24px; height: 24px; color: var(--gold-text); }

.rd-vote {
    width: 100%;
    max-width: 420px;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 0;
    color: var(--gold-text);
}
.rd-vote .side-vote-label { text-align: left; font-size: 0.85rem; letter-spacing: 1.5px; }
.stepper { gap: 10px; }
.stepper-btn { width: var(--tap); height: var(--tap); border-width: 1.5px; font-size: 1.5rem; }
.stepper-count { color: var(--cream); }

/* ---- The verdict ---- */
#time-up-screen { text-align: center; gap: 18px; }
.rd-eyebrow { margin-top: 36px; font-family: 'Lato', sans-serif; font-size: 0.85rem; font-weight: 700; letter-spacing: 3px; color: var(--gold-text); }
.rd-verdict { min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.rd-verdict-pre { font-size: 0.8rem; font-weight: 700; letter-spacing: 3px; color: var(--cream); }
.rd-verdict-big { font-family: 'Playfair Display', serif; font-size: clamp(4rem, 22vw, 6rem); line-height: 1; color: var(--gold-text); }
.rd-verdict-words { font-size: clamp(2.2rem, 11vw, 3.2rem); line-height: 1.1; }
.rd-verdict-sub { font-family: 'Playfair Display', serif; font-size: 1.6rem; color: var(--cream); }
.rd-verdict-prompt { max-width: 300px; font-family: 'Playfair Display', serif; font-size: 1.5rem; line-height: 1.3; color: var(--cream); }
#time-up-screen #time-up-topic.rd-verdict-topic { font-family: 'Lato', sans-serif; font-weight: 400; margin: 0; max-width: 420px; font-size: 1rem; line-height: 1.45; color: var(--cream); }
.rd-verdict-topic::before { content: '\201C'; }
.rd-verdict-topic::after { content: '\201D'; }

.rd-bars { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.rd-bar { display: flex; height: 40px; border-radius: 8px; overflow: hidden; font-weight: 700; font-size: 0.9rem; margin-bottom: 6px; }
.rd-bar span { display: flex; align-items: center; min-width: 0; padding: 0 12px; white-space: nowrap; color: var(--teal-bg); flex-basis: 0; }
.rd-bar-agree { background: var(--gold-text); }
.rd-bar-disagree { background: var(--cream); justify-content: flex-end; }

#time-up-screen .rating { margin: 0; color: var(--gold-text); }
.rating-stars { gap: 0; }
.star { width: var(--tap); height: var(--tap); padding: 8px; font-size: 0; color: var(--gold-text); }
.star svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.star.on svg { fill: currentColor; }

/* ---- How it works ---- */
.modal-content.card.rd-how { width: calc(100% - 8px); max-width: 420px; max-height: none; padding: 28px 22px 22px; gap: 18px; text-align: left; color: var(--teal-bg); }
.rd-how .modal-title { margin: 0 32px 0 0; color: var(--teal-bg); font-size: 1.7rem; }
.rd-steps { list-style: none; display: flex; flex-direction: column; gap: 16px; }
.rd-steps li { display: flex; gap: 14px; align-items: flex-start; font-size: 1.1rem; line-height: 1.4; }
.rd-step-num { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--teal-bg); color: var(--cream); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.rd-how-dogbox { padding-top: 16px; border-top: 1px solid var(--gold-text); font-size: 1rem; line-height: 1.5; }
.rd-inline-link { display: inline; padding: 10px 0; border: none; background: none; color: var(--teal-bg); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---- Rules pop-up in sentence case ---- */
#rules-popup-content p, #rules-popup-content li { line-height: 1.55; }
.close-btn { min-width: 44px; min-height: 44px; top: 6px; right: 8px; }
.remove-player { min-width: 44px; min-height: 44px; font-size: 1.4rem; }
#paused-modal .modal-content.card { align-items: center; padding-bottom: 28px; }

/* Short phones: tighten the vertical rhythm so the main button stays on screen */
@media (max-height: 700px) {
    #topic-select-screen, #topic-display-screen, #time-up-screen { gap: 10px; }
    .rd-deck { width: min(40vw, 160px); }
    .rd-ring { width: min(46vw, 180px); }
    .rd-ring-time { font-size: 2.4rem; }
    .rd-verdict { min-height: 110px; }
    .rd-verdict-big { font-size: 3.6rem; }
    .rd-tagline { margin-top: 16px; }
    .rd-eyebrow { margin-top: 28px; }
}

@media (prefers-reduced-motion: reduce) {
    .rd-deck, .rd-deck-card, .rd-ring-fill, .rd-btn { transition: none; }
}
