.tbank-today {
    text-align: center;
}

.tbank-date {
    margin: 0 0 var(--space-4);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
}

.tbank-hint {
    margin: 0 auto var(--space-5);
    max-width: 36rem;
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--tile-present) 12%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--tile-present) 40%, var(--border));
    text-align: left;
}

.tbank-hint-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-2);
}

.tbank-hint-label {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--warn);
}

.tbank-hint-refresh {
    flex: none;
    min-height: 2rem;
    padding: 0 var(--space-3);
    border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--border));
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

.tbank-hint-refresh:hover {
    border-color: var(--warn);
}

.tbank-hint-text {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.5;
}

.tbank-hint-missing {
    color: var(--muted);
}

.tbank-tiles {
    margin-bottom: var(--space-4);
}

.tbank-answer {
    margin-bottom: var(--space-4);
}

.tbank-reveal.is-revealed .tbank-answer .letter-tile {
    animation: tile-flip 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.tbank-reveal.is-revealed .tbank-answer .letter-tile:nth-child(2) { animation-delay: 0.08s; }
.tbank-reveal.is-revealed .tbank-answer .letter-tile:nth-child(3) { animation-delay: 0.16s; }
.tbank-reveal.is-revealed .tbank-answer .letter-tile:nth-child(4) { animation-delay: 0.24s; }
.tbank-reveal.is-revealed .tbank-answer .letter-tile:nth-child(5) { animation-delay: 0.32s; }

/* The game marks a letter in its correct position yellow, so the answer uses the same colour. */
.tbank-answer .letter-tile {
    background: var(--tile-present);
}

@keyframes tile-flip {
    from {
        opacity: 0;
        transform: rotateX(90deg);
    }
    to {
        opacity: 1;
        transform: rotateX(0);
    }
}

.tbank-actions {
    justify-content: center;
    flex-wrap: nowrap;
}

.tbank-poll {
    margin: var(--space-4) 0 0;
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
}

.tbank-poll-question {
    margin: 0 0 var(--space-2);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
}

.tbank-poll-choices {
    display: flex;
    flex-direction: column;
    text-align: left;
    border-top: 1px solid var(--border);
}

.tbank-poll-choice {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    min-height: 2.45rem;
    padding: 0.3rem 0.15rem;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.tbank-poll-choice::before {
    content: "";
    flex: none;
    width: 1.15rem;
    height: 1.15rem;
    box-sizing: border-box;
    border: 2px solid var(--border-strong);
    border-radius: 50%;
    background: var(--surface);
}

.tbank-poll-choice:hover {
    background: var(--surface-2);
}

.tbank-poll.is-counting .tbank-poll-choice:not(.is-picked) {
    opacity: 0.4;
}

.tbank-poll-choice.is-picked::before {
    border-color: var(--brand);
    background:
        radial-gradient(circle, var(--brand) 0 42%, transparent 46%),
        var(--surface);
}

.tbank-poll-counting {
    display: grid;
    gap: 0.55rem;
    padding: 0.75rem 0.15rem 0.45rem;
    border-top: 1px solid var(--border);
}

.tbank-poll-counting span {
    display: block;
    height: 0.5rem;
    overflow: hidden;
    border-radius: 999px;
    background: var(--surface-3);
}

.tbank-poll-counting span::after {
    content: "";
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: var(--tile-present);
    animation: tbank-poll-count 1.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.tbank-poll-counting span:nth-child(2)::after { animation-delay: 0.12s; }
.tbank-poll-counting span:nth-child(3)::after { animation-delay: 0.24s; }

@keyframes tbank-poll-count {
    0% { width: 0; }
    38% { width: 100%; }
    68% { width: 100%; }
    100% { width: 18%; }
}

.tbank-poll-results {
    display: grid;
    gap: 0.35rem;
    margin: 0;
    text-align: left;
}

.tbank-poll-bar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 2.15rem;
    padding: 0.3rem 0.7rem;
    overflow: hidden;
    border-radius: 8px;
    background: var(--surface-2);
    font-size: 0.9rem;
    font-weight: 650;
    line-height: 1.25;
}

.tbank-poll-bar-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    background: color-mix(in srgb, var(--brand) 28%, var(--surface-3));
    transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.tbank-poll-bar.is-mine .tbank-poll-bar-fill {
    background: color-mix(in srgb, var(--brand) 48%, var(--surface-3));
}

.tbank-poll-bar-label,
.tbank-poll-bar-pct {
    position: relative;
    z-index: 1;
}

.tbank-poll-bar-label {
    min-width: 0;
}

.tbank-poll-bar-pct {
    flex: none;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.tbank-poll-error {
    margin: 0;
    color: var(--danger);
    font-size: 0.9rem;
    text-align: center;
}

.tbank-poll-yesterday {
    margin-top: var(--space-2);
    padding: 0;
    border: 0;
    background: none;
    color: var(--muted);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.15em;
    cursor: pointer;
}

.tbank-poll-yesterday:hover {
    color: var(--text);
}

.tbank-poll-dialog {
    width: min(28rem, calc(100vw - 2rem));
    margin: auto;
    padding: var(--space-5);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--text);
    text-align: left;
    box-shadow: var(--shadow-lg);
}

.tbank-poll-dialog::backdrop {
    background: rgb(0 0 0 / 0.45);
}

.tbank-poll-dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.tbank-poll-dialog-title {
    margin: 0;
    font-size: 1.2rem;
}

.tbank-poll-dialog-close {
    flex: none;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.tbank-poll-dialog-close:hover {
    background: var(--surface-3);
}

.tbank-poll-dialog-status {
    margin: 0;
    color: var(--muted);
    text-align: center;
}

.tbank-poll-dialog .tbank-poll-results {
    margin-top: 0;
}

@media (prefers-reduced-motion: reduce) {
    .tbank-poll-counting span::after {
        animation: none;
        width: 60%;
    }

    .tbank-poll-bar-fill {
        transition: none;
    }
}

@media (max-width: 560px) {
    .tbank-actions .btn {
        padding-inline: var(--space-3);
    }
}

/* --- Archive calendar --- */

.calendar {
    margin-bottom: var(--space-5);
}

.calendar-title {
    margin: 0 0 var(--space-2);
    font-size: 1rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}

.calendar-weekday {
    padding: var(--space-1) 0;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
}

.calendar-day {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 3.6rem;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
}

.calendar-day.is-blank {
    background: transparent;
    border-color: transparent;
}

.calendar-day.is-out {
    background: transparent;
    border-style: dashed;
}

.calendar-num {
    font-size: 0.72rem;
    color: var(--muted);
}

.calendar-word {
    font-size: clamp(0.62rem, 2.4vw, 0.85rem);
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--text);
    overflow-wrap: anywhere;
}

.calendar-day.has-word {
    border-color: color-mix(in srgb, var(--tile-present) 45%, var(--border));
    background: color-mix(in srgb, var(--tile-present) 8%, var(--surface));
}
