/* ── Daily Challenge ──────────────────────────
   Builds on ../challenge/style.css (cards, meta line, result card, game card). */

.daily-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.daily-heading {
    margin-bottom: 2px;
}

.daily-date {
    font-size: 14px;
    color: #777777;
}

.daily-start .play-button {
    margin-top: 6px;
}

.daily-start .error-message-container {
    margin-top: 10px;
    color: #cc4b3c;
}

/* Share buttons: invite (before the result) and result card */
.daily-share {
    margin-bottom: 20px;
}

.daily-share-title {
    margin-bottom: 6px;
    font-size: 13px;
    color: #777777;
}

.daily-share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.daily-share-buttons .share-button {
    margin: 0;
    padding: 8px 14px;
    font-size: 14px;
}

.daily-share-result {
    margin-top: 14px;
}

.daily-share-result .share-button {
    padding: 6px 12px;
    font-size: 13px;
}

/* Links in the date line ("World ranking", "Play today's puzzle") */
.daily-link {
    color: #3f8a8f;
    font-weight: bold;
    text-decoration: none;
    white-space: nowrap;
}

.daily-link:hover {
    text-decoration: underline;
}

/* "🏆 Global Leaderboard": next to How to play, in the leaderboard's own colours */
.daily-title-actions {
    align-items: center;
    gap: 10px;
}

.leaderboard-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 999px;
    background: linear-gradient(160deg, #10683c 0%, #0a4227 100%);
    box-shadow: 0 3px 0 #06301c, 0 6px 14px rgba(10, 66, 39, 0.25);
    font-family: 'Fredoka One', cursive;
    font-size: 15px;
    color: #f2c94c;
    text-decoration: none;
    white-space: nowrap;
}

.leaderboard-btn:hover {
    background: #127a46;
}

.leaderboard-btn:focus-visible {
    outline: 3px solid #f2c94c;
    outline-offset: 2px;
}

/* Phones: the button and How to play go on their own line under the title */
@media (max-width: 481px) {
    .daily-title-row {
        flex-wrap: wrap;
    }
    .leaderboard-btn {
        padding: 8px 14px;
        font-size: 14px;
    }
}

/* "Playing as 🐮 Clever Bull 4821" */
.daily-whoami {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    font-size: 13px;
    color: #777777;
}

.daily-whoami a {
    color: #444444;
    font-weight: bold;
    text-decoration: none;
}

.daily-whoami a:hover {
    text-decoration: underline;
}

.cnb-avatar {
    display: block;
    flex: 0 0 auto;
}

/* Sign in to play / you're on the ranking */
.daily-account {
    border: 2px solid #5ca4a9;
}

.daily-account.is-ranked {
    border-color: #0bbb62;
}

.daily-account-form {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 4px 0 8px;
}

.daily-account-form.hide {
    display: none;
}

.daily-account-form input {
    flex: 1 1 220px;
    min-width: 0;
    height: 38px;
    padding: 0 10px;
    border: 1px dotted #aeaeae;
    border-radius: 3px;
    font-family: 'Maven Pro', sans-serif;
    font-size: 15px;
    color: #444444;
}

.daily-code {
    flex: 0 1 160px;
    letter-spacing: 3px;
    font-variant-numeric: tabular-nums;
}

.daily-account-form input:focus {
    outline: none;
    border: 2px dotted #5ca4a9;
}

.daily-account-form .play-button {
    flex: 0 0 auto;
    padding: 8px 20px;
}

.daily-account .error-message-container {
    margin-bottom: 8px;
    color: #cc4b3c;
}

.daily-account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0 0 !important;
}

.daily-me {
    display: flex;
    align-items: center;
    gap: 12px;
}

.daily-me p {
    margin-bottom: 2px !important;
}

.daily-me strong {
    font-family: 'Fredoka One', cursive;
    font-weight: normal;
    font-size: 17px;
    color: #333333;
}

a.cert-btn {
    display: inline-block;
    text-decoration: none;
}

.cert-btn.is-danger {
    border-color: #cc4b3c;
    color: #cc4b3c;
}

.cert-btn.is-danger:hover:not(:disabled),
.cert-btn.is-danger:focus-visible {
    background: #cc4b3c;
    color: #ffffff;
}

/* Ranking page */
.ranking-mine {
    margin-bottom: 20px;
}

.ranking-mine .daily-me {
    margin-bottom: 10px;
}

.ranking-player {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #333333;
    text-decoration: none;
}

a.ranking-player:hover span {
    text-decoration: underline;
}

.ranking-player.is-guest {
    color: #999999;
    font-style: italic;
}

.ranking-mine .create-cta-button {
    display: inline-block;
    margin-top: 10px;
}

.ranking-next {
    margin-top: 4px;
}

/* Ranking page: a wider page, today's standing (left) and the all-time Global Leaderboard (right) */
body.page-wide .app-wrapper {
    width: 1080px;
    max-width: 100%;
}

body.page-wide .site-header-inner {
    max-width: 1080px;
}

.ranking-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr);
    gap: 24px;
    align-items: start;
}

.ranking-columns.hide {
    display: none;
}

/* Global Leaderboard: a dark trophy-cabinet card, unlike the white table beside it */
.global-board {
    padding: 22px 20px 18px;
    border-radius: 14px;
    background: linear-gradient(160deg, #10683c 0%, #0a4227 100%);
    color: #e9f5ee;
    box-shadow: 0 6px 18px rgba(10, 66, 39, 0.25);
}

.global-kicker {
    margin: 0 0 2px;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #f2c94c;
}

.global-title {
    margin: 0 0 4px;
    font-family: 'Fredoka One', cursive;
    font-weight: normal;
    font-size: 24px;
    color: #ffffff;
}

.global-sub {
    margin: 0 0 14px;
    font-size: 13px;
    color: #b9dcc8;
}

.global-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.global-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.07);
    color: inherit;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.global-row.is-top1 {
    background: rgba(242, 201, 76, 0.18);
    box-shadow: inset 0 0 0 1px rgba(242, 201, 76, 0.55);
}

.global-place {
    flex: 0 0 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    font-family: 'Fredoka One', cursive;
    font-size: 14px;
    line-height: 24px;
    text-align: center;
    color: #ffffff;
}

.is-top1 .global-place { background: #f2c94c; border-color: #f2c94c; color: #5a4300; }
.is-top2 .global-place { background: #d7dde2; border-color: #d7dde2; color: #3c4650; }
.is-top3 .global-place { background: #d79a5b; border-color: #d79a5b; color: #4a2a0c; }

.global-player {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    align-items: center;
    gap: 10px;
}

.global-player .cnb-avatar {
    border-radius: 50%;
    background: #ffffff;
}

.global-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.global-name {
    overflow: hidden;
    font-weight: bold;
    color: #ffffff;
    white-space: nowrap;
    text-overflow: ellipsis;
}

a.global-row:hover,
a.global-row:focus-visible {
    background: rgba(255, 255, 255, 0.16);
}

a.global-row.is-top1:hover,
a.global-row.is-top1:focus-visible {
    background: rgba(242, 201, 76, 0.28);
}

a.global-row:focus-visible {
    outline: 2px solid #f2c94c;
    outline-offset: 2px;
}

.global-detail {
    font-size: 12px;
    color: #b9dcc8;
}

.global-wins {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 44px;
    line-height: 1;
}

.global-wins strong {
    font-family: 'Fredoka One', cursive;
    font-weight: normal;
    font-size: 22px;
    color: #f2c94c;
}

.global-wins span {
    margin-top: 2px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #b9dcc8;
}

/* Narrower screens: the Global Leaderboard goes under today's standing */
@media (max-width: 900px) {
    .ranking-columns {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Player page */
.player-back {
    margin-bottom: 16px;
}

.player-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.player-tiles {
    margin-bottom: 0;
}

.player-recent tr.is-pending td {
    color: #777777;
}

.player-recent tr.is-pending td:nth-child(2) {
    font-weight: normal;
    white-space: nowrap;
}

.player-tiles dd small {
    font-size: 11px;
    font-weight: normal;
    color: #999999;
}

/* Today so far: four stat tiles */
.daily-tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 18px;
}

.daily-tiles div {
    padding: 8px 10px;
    border-radius: 6px;
    background: #f4f6f0;
}

.daily-tiles dt {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #888888;
}

.daily-tiles dd {
    margin: 2px 0 0;
    font-size: 18px;
    font-weight: bold;
    color: #444444;
    font-variant-numeric: tabular-nums;
}

/* Guess distribution: one horizontal bar per guess count.
   Bars #00929e, "you" #e0533f (validated for colour-blind separation and
   3:1 contrast on white); the "you" tag makes it readable without colour too. */
.daily-chart-title {
    margin-bottom: 8px;
    font-size: 13px;
    color: #555555;
}

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

.daily-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px; /* surface gap between bars */
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.daily-bar-label {
    flex: 0 0 28px;
    text-align: right;
    color: #666666;
}

.daily-bar-track {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 6px;
    min-width: 0;
    height: 18px;
}

.daily-bar {
    height: 14px;
    border-radius: 0 4px 4px 0;
    background: #00929e;
}

.daily-bar-value {
    flex: 0 0 auto;
    color: #666666;
    white-space: nowrap;
}

.daily-bar-row.is-mine .daily-bar {
    background: #e0533f;
}

.daily-bar-row.is-mine .daily-bar-label,
.daily-bar-row.is-mine .daily-bar-value {
    color: #333333;
    font-weight: bold;
}

.daily-bar-value em {
    font-style: normal;
    margin-left: 2px;
    padding: 0 5px;
    border-radius: 6px;
    background: #fde8e5;
    color: #b8402e;
    font-size: 11px;
}

.daily-next {
    margin: 0;
}

@media (max-width: 481px) {
    /* The percentile needs the full width; the rematch card goes underneath */
    .result-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .daily-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}
