/* ==========================================================================
   6lets/style.css — the 6Lets board, keyboard and dialogs inside the site
   shell. Adapted from 6lets.com's style.css: the same token names drive the
   tiles and keys, but the values come from the shared Game Theme (the class
   js/theme.js puts on <html>) instead of 6Lets' own theme picker.

   The Seasons (no class) is 6Lets' Original look — its grid, keys and
   modals — on the seasonal backdrop, with only the empty tiles' white
   borders swapped for the site's navy so they read on a light wash. Classic
   is the Original look exactly as 6lets.com draws it, black page included.
   Poppins, 6Lets' face, is self-hosted (css/fonts.css).
   ========================================================================== */

/* ---------------------------------------------------------- tokens */
:root {
    --sl-font: 'Poppins', var(--font-body);
    --text-color: var(--ink-deep);

    --key-bg: #9e9e9e;
    --key-color: #ffffff;
    --key-border: 1px solid #ffffff;
    --key-radius: 12px;
    --key-eval-correct: #00a550;
    --key-eval-present: #ffc700;
    --key-eval-absent: #3c3c3c;
    --key-bg-backspace: #ff595e;
    --key-bg-enter: #8b9dc3;
    --key-eval-color: #ffffff;

    --board-empty-border: 2px solid rgba(29, 49, 83, .55);
    --tile-radius: 0px;
    --tile-font-weight: normal;
    --tile-color-empty: var(--ink-deep);
    --tile-bg-empty: rgba(255, 255, 255, .35);
    --tile-color-eval: #ffffff;
    --tile-bg-correct: #00a550;
    --tile-border-correct: 1px solid #ffffff;
    --tile-bg-present: #ffc700;
    --tile-border-present: 1px solid #ffffff;
    --tile-bg-absent: #3c3c3c;
    --tile-border-absent: 1px solid #ffffff;

    --modal-bg: #ffffff;
    --modal-color: #000000;
    --modal-input-bg: #f9f9f9;
    --modal-input-border: #cccccc;
    --labels-bg: #000000;
    --labels-color: #ffffff;
}

/* Glass Light: the flat off-white page; the Seasons tokens already suit it. */

/* Classic — 6lets.com's Original theme, verbatim. */
html.theme-classic {
    --board-empty-border: 1px solid #ffffff;
    --tile-color-empty: #ffffff;
    --tile-bg-empty: transparent;
}

/* Wordle */
html.theme-wordle {
    --sl-font: "Clear Sans", "Helvetica Neue", Arial, sans-serif;
    --key-bg: #d3d6da;
    --key-color: #1a1a1b;
    --key-border: none;
    --key-radius: 4px;
    --key-eval-correct: #6aaa64;
    --key-eval-present: #c9b458;
    --key-eval-absent: #787c7e;
    --key-bg-backspace: #d3d6da;
    --key-bg-enter: #d3d6da;
    --board-empty-border: 2px solid #d3d6da;
    --tile-font-weight: bold;
    --tile-color-empty: #1a1a1b;
    --tile-bg-empty: transparent;
    --tile-bg-correct: #6aaa64;
    --tile-border-correct: 2px solid #6aaa64;
    --tile-bg-present: #c9b458;
    --tile-border-present: 2px solid #c9b458;
    --tile-bg-absent: #787c7e;
    --tile-border-absent: 2px solid #787c7e;
    --modal-bg: #ffffff;
    --modal-color: #1a1a1b;
    --labels-bg: #1a1a1b;
}

/* Botanical Sketchbook */
html.theme-botanical {
    --sl-font: Georgia, "Times New Roman", serif;
    --key-bg: #d9c298;
    --key-color: #3b2f2f;
    --key-border: 1px solid #bda881;
    --key-radius: 16px;
    --key-eval-correct: #8b9c73;
    --key-eval-present: #d4b35e;
    --key-eval-absent: #ebdcb8;
    --key-bg-backspace: #c87979;
    --key-bg-enter: #7b9fa6;
    --key-eval-color: #3b2f2f;
    --board-empty-border: 1px solid #bda881;
    --tile-radius: 2px;
    --tile-font-weight: bold;
    --tile-color-empty: #3b2f2f;
    --tile-bg-empty: rgba(255, 255, 255, .25);
    --tile-color-eval: #3b2f2f;
    --tile-bg-correct: #8b9c73;
    --tile-border-correct: 1px solid #6b7a58;
    --tile-bg-present: #d4b35e;
    --tile-border-present: 1px solid #a68b48;
    --tile-bg-absent: #ebdcb8;
    --tile-border-absent: 1px solid #bda881;
    --modal-bg: #f4ecd8;
    --modal-color: #3b2f2f;
    --modal-input-bg: #fbf6ea;
    --modal-input-border: #bda881;
    --labels-bg: #3b2f2f;
    --labels-color: #f4ecd8;
}

/* Elegant Dark — the site's theme, in 6Lets' clothes. */
html.theme-elegant-dark {
    --sl-font: var(--font-display);
    --key-bg: rgba(232, 220, 197, .14);
    --key-color: #e8dcc5;
    --key-border: 1px solid rgba(232, 220, 197, .3);
    --key-radius: 6px;
    --key-eval-correct: #7b8e5c;
    --key-eval-present: #b89947;
    --key-eval-absent: rgba(0, 0, 0, .5);
    --key-bg-backspace: #8e5c5c;
    --key-bg-enter: #4a382b;
    --board-empty-border: 1px solid rgba(232, 220, 197, .45);
    --tile-radius: 4px;
    --tile-color-empty: #e8dcc5;
    --tile-bg-empty: rgba(0, 0, 0, .25);
    --tile-color-eval: #f5efe2;
    --tile-bg-correct: #7b8e5c;
    --tile-border-correct: 1px solid #9db07c;
    --tile-bg-present: #b89947;
    --tile-border-present: 1px solid #d9bb6a;
    --tile-bg-absent: rgba(58, 44, 32, .92);
    --tile-border-absent: 1px solid #6b5544;
    --modal-bg: #241b15;
    --modal-color: #e8dcc5;
    --modal-input-bg: rgba(0, 0, 0, .3);
    --modal-input-border: #4a382b;
    --labels-bg: #1a1512;
    --labels-color: #e8dcc5;
}

/* Elegant Light */
html.theme-elegant-light {
    --sl-font: var(--font-display);
    --key-bg: rgba(62, 51, 40, .12);
    --key-color: #3e3328;
    --key-border: 1px solid #d4c5b0;
    --key-radius: 6px;
    --key-eval-correct: #7b8e5c;
    --key-eval-present: #d4b35e;
    --key-eval-absent: rgba(62, 51, 40, .3);
    --key-bg-backspace: #c87979;
    --key-bg-enter: #8a7a69;
    --board-empty-border: 1px solid #d4c5b0;
    --tile-radius: 4px;
    --tile-color-empty: #3e3328;
    --tile-bg-empty: rgba(255, 255, 255, .5);
    --tile-bg-correct: #7b8e5c;
    --tile-border-correct: 1px solid #6b7a4c;
    --tile-bg-present: #d4b35e;
    --tile-border-present: 1px solid #b89947;
    --tile-bg-absent: #8a7a69;
    --tile-border-absent: 1px solid #6e5f4f;
    --modal-bg: #f0e8d9;
    --modal-color: #3e3328;
    --modal-input-bg: rgba(255, 255, 255, .6);
    --modal-input-border: #d4c5b0;
    --labels-bg: #3e3328;
    --labels-color: #f0e8d9;
}

/* Steampunk */
html.theme-steampunk {
    --sl-font: var(--font-display);
    --key-bg: rgba(179, 110, 60, .22);
    --key-color: #d1bfae;
    --key-border: 1px solid #b36e3c;
    --key-radius: 2px;
    --key-eval-correct: #4e7f78;
    --key-eval-present: #b36e3c;
    --key-eval-absent: rgba(0, 0, 0, .45);
    --key-bg-backspace: #7a2e2e;
    --key-bg-enter: #4d3928;
    --board-empty-border: 1px solid #8c7e73;
    --tile-radius: 2px;
    --tile-color-empty: #d1bfae;
    --tile-bg-empty: rgba(0, 0, 0, .3);
    --tile-color-eval: #f3e7d8;
    --tile-bg-correct: #4e7f78;
    --tile-border-correct: 1px solid #7fb3aa;
    --tile-bg-present: #b36e3c;
    --tile-border-present: 1px solid #e6a86c;
    --tile-bg-absent: rgba(45, 35, 30, .92);
    --tile-border-absent: 1px solid #6b4d35;
    --modal-bg: #2b2521;
    --modal-color: #d1bfae;
    --modal-input-bg: rgba(0, 0, 0, .35);
    --modal-input-border: #4d3928;
    --labels-bg: #211c19;
    --labels-color: #d1bfae;
}

/* ---------------------------------------------------------- layout */
.game-container {
    max-width: 560px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    padding: var(--game-panel-pad, .5rem 0 1.5rem);
    font-family: var(--sl-font);
    /* The Elegant and Steampunk themes set these (css/themes.css) to draw a
       plate behind the whole game, keyboard included; elsewhere they resolve
       to nothing. */
    background: var(--game-panel-bg, none);
    border: var(--game-panel-border, 0);
    border-radius: 20px;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

/* The game's own header, under the Fun & Games link, laid out like
   StepWords: centred title, controls at either end, no bar of its own. */
.sl-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 3rem;
    margin-bottom: .75rem;
    color: var(--text-color);
}
.sl-title {
    margin: 0;
    font-family: var(--sl-font);
    font-size: clamp(1.2rem, 5vw, 1.6rem);
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 600;
    color: inherit;
}
.sl-header__side {
    position: absolute;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: .35rem;
}
.sl-header__side--left { left: 0; }
.sl-header__side--right { right: .25rem; gap: .75rem; }
.sl-iconbtn {
    width: 2.25rem;
    height: 2.25rem;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    cursor: pointer;
}
.sl-iconbtn:hover { background: rgba(128, 128, 128, .18); }
.sl-streak {
    width: 22px;
    height: 22px;
    border: 2px solid currentColor;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}
.sl-counter {
    font-size: 1.4rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: inherit;
}

#board-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: .25rem;
    min-height: min(30vh, 220px);
}
#board {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    align-items: center;
}
#word-load-error {
    text-align: center;
    padding: 40px 24px;
    color: var(--text-color);
}
#word-load-error p { margin: 0 0 20px; font-size: 1.1rem; line-height: 1.5; }

.row {
    display: flex;
    justify-content: center;
    gap: 4px;
    width: 100%;
    position: relative;
    z-index: 10;
}
.row.slide-in {
    animation: slideDownRow .3s ease-out forwards;
    z-index: 0;
}
@keyframes slideDownRow {
    0%   { transform: translateY(-100%); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.tile {
    width: min(14vw, 72px);
    aspect-ratio: 150 / 126;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: min(8vw, 40px);
    text-transform: uppercase;
    border: var(--board-empty-border);
    background-color: var(--tile-bg-empty);
    color: var(--tile-color-empty);
    border-radius: var(--tile-radius);
    font-weight: var(--tile-font-weight);
}
.tile[data-state="correct"] { background-color: var(--tile-bg-correct); border: var(--tile-border-correct); color: var(--tile-color-eval); }
.tile[data-state="present"] { background-color: var(--tile-bg-present); border: var(--tile-border-present); color: var(--tile-color-eval); }
.tile[data-state="absent"]  { background-color: var(--tile-bg-absent);  border: var(--tile-border-absent);  color: var(--tile-color-eval); }

.tile.pop { animation: pop .1s linear 1; }
@keyframes pop {
    from { transform: scale(.8); opacity: 0; }
    40%  { transform: scale(1.1); opacity: 1; }
}
.tile.flip { animation: flip .5s ease-in; }
@keyframes flip {
    0%   { transform: rotateX(0); }
    50%  { transform: rotateX(-90deg); }
    100% { transform: rotateX(0); }
}
.row.shake { animation: shake .5s; }
@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* ---------------------------------------------------------- keyboard */
#keyboard-container {
    padding: 1.5rem 0 .25rem;
    width: 100%;
}
#keyboard { display: flex; flex-direction: column; gap: 5px; }
.keyboard-row { display: flex; justify-content: center; gap: 5px; }
.key {
    background-color: var(--key-bg);
    color: var(--key-color);
    border: var(--key-border);
    border-radius: var(--key-radius);
    font-family: inherit;
    font-size: min(5.2vw, 1.35rem);
    cursor: pointer;
    text-transform: uppercase;
    flex: 0 1 9%;
    height: min(12vw, 3.4rem);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    transition: filter 120ms;
}
.key:active { filter: brightness(.85); }
.key.large { flex: 0 1 13.5%; font-size: min(3.6vw, 1rem); }
.key.large[data-key="Backspace"] { background-color: var(--key-bg-backspace); }
.key.large[data-key="Enter"]     { background-color: var(--key-bg-enter); }
.key[data-state="correct"] { background-color: var(--key-eval-correct); border-color: transparent; color: var(--key-eval-color); }
.key[data-state="present"] { background-color: var(--key-eval-present); border-color: transparent; color: var(--key-eval-color); }
.key[data-state="absent"]  { background-color: var(--key-eval-absent);  border-color: transparent; color: var(--key-eval-color); }
html.theme-wordle .key[data-state] { color: #ffffff; }

/* ---------------------------------------------------------- toast & modals */
#message-toast {
    position: fixed;
    top: calc(var(--topbar-h) + 1rem);
    left: 50%;
    transform: translateX(-50%);
    background-color: #d32f2f;
    color: #fff;
    padding: 5px 15px;
    border-radius: 5px;
    font-size: 1.3rem;
    font-family: var(--sl-font);
    z-index: 1000;
    pointer-events: none;
    transition: opacity .3s;
}
#message-toast.hidden { opacity: 0; }

#modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 100;
}
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--modal-bg);
    color: var(--modal-color);
    font-family: var(--sl-font);
    padding: 20px;
    border-radius: 8px;
    width: 95%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 101;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: ShareFrameAni .6s ease-out;
}
.modal--wide { max-width: 600px; padding: 20px 15px; }
@keyframes ShareFrameAni {
    0%   { opacity: 0; transform: translate(-50%, -40%); }
    100% { opacity: 1; transform: translate(-50%, -50%); }
}
.modal.hidden, #modal-overlay.hidden, #player-grid-popup.hidden { display: none; }
@media (prefers-reduced-motion: reduce) { .modal { animation: none; } }

.close-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    color: var(--modal-color);
    z-index: 10;
}
.modal-copy { margin: 0 0 20px; font-size: 1.1rem; color: var(--modal-color); text-align: center; }
.modal-actions { display: flex; gap: 10px; justify-content: center; width: 100%; }
.modal-actions--left { justify-content: flex-start; margin-top: 20px; }

.sl-input {
    width: 100%;
    font-size: 1.1rem;
    font-family: inherit;
    padding: 10px;
    border: 1px solid var(--modal-input-border);
    border-radius: 4px;
    background: var(--modal-input-bg);
    color: var(--modal-color);
    box-sizing: border-box;
    margin-bottom: 20px;
}
.sl-input--word { text-transform: uppercase; margin-bottom: 0; font-size: 1rem; }

.sl-btn {
    font-family: inherit;
    font-size: 1.1rem;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: #fff;
}
.sl-btn:disabled { opacity: .5; cursor: not-allowed; }
.sl-btn--primary { background: darkred; flex-grow: 1; }
.sl-btn--quiet   { background: #ccc; color: #333; }
.sl-btn--correct { background: var(--key-eval-correct); color: var(--key-eval-color); font-weight: bold; }
.sl-btn--danger  { background: darkred; }
.sl-btn--block   { width: 100%; padding: 12px; margin-top: 10px; }
.sl-btn--enter   { background: var(--key-bg-enter); color: var(--key-color); border-radius: 8px; padding: 10px 24px; font-size: 1.4rem; }
.sl-btn--key     { background: var(--key-bg); border: var(--key-border); color: var(--key-color); border-radius: 2px; padding: 10px 24px; font-size: 1.2rem; margin-top: 15px; }
#close-help-btn  { border-radius: 2px; padding: 10px 24px; font-size: 1.2rem; margin-top: 15px; }
#close-help-btn, #play-new-game-btn { color: #fff; }
html.theme-botanical #close-help-btn, html.theme-botanical #play-new-game-btn { color: #3b2f2f; }

/* Word tiles in dialog headings */
#stats-word-container { display: flex; gap: 4px; margin: 25px 0 15px; }
#stats-word-container .tile {
    width: 48px;
    height: 62px;
    aspect-ratio: auto;
    font-size: 2.2rem;
    background-color: var(--tile-bg-correct);
    color: var(--tile-color-eval);
    border: var(--tile-border-correct);
}
.share-actions { display: flex; justify-content: center; gap: 15px; margin-bottom: 25px; }

.bouncy-word-container { display: flex; gap: 2px; margin: 10px 0 25px; }
.bouncy-word-container .tile {
    width: 25px;
    height: 25px;
    aspect-ratio: auto;
    line-height: 25px;
    font-size: 1.2rem;
    border: none;
    background-color: var(--key-eval-correct);
    color: var(--key-eval-color);
}
.bouncy-word-container .tile.is-space { background: transparent; border: none; }
.bouncy { animation: bouncy 7s infinite linear; position: relative; }
@keyframes bouncy {
    0%   { top: 0; }
    40%  { top: 0; }
    43%  { top: -.9em; }
    46%  { top: 0; }
    48%  { top: -.4em; }
    50%  { top: 0; }
    100% { top: 0; }
}

/* Stats graph */
.stats-graph { width: 100%; position: relative; }
.bar-container { height: 70px; display: grid; grid-template-columns: repeat(11, 1fr); align-items: flex-end; }
.bar-wrapper { display: flex; justify-content: center; align-items: flex-end; width: 100%; height: 100%; cursor: pointer; }
.bar { width: 100%; background: var(--key-eval-correct); transition: height .3s ease; }
.guess-labels {
    display: grid;
    grid-template-columns: repeat(11, 1fr);
    text-align: center;
    background: var(--labels-bg);
    color: var(--labels-color);
    padding: 3px 0;
    font-size: 18px;
}
.guess-labels span { cursor: pointer; }
.line { height: 2px; background: var(--key-eval-correct); width: 100%; }
.stats-text { font-size: 1rem; margin-bottom: 15px; text-align: center; }
.stats-text--big { font-size: 1.2rem; margin-bottom: 25px; line-height: 1.5; }
.next-game-text { font-size: 1.2rem; margin-top: 20px; }
.recent-games { font-size: 1.1rem; margin-bottom: 25px; text-align: center; line-height: 1.6; max-height: 150px; overflow-y: auto; padding: 0 10px; }

.help-list { text-align: left; width: 100%; max-width: 300px; margin: 0 0 30px; font-size: 1.2rem; line-height: 1.4; padding-left: 25px; }
.help-list li { margin-bottom: 5px; }
.help-swatch { padding: 0 .2em; border-radius: 2px; background: #111; }
.help-swatch--correct { color: var(--key-eval-correct); }
.help-swatch--present { color: var(--key-eval-present); }
.help-swatch--absent  { color: #ccc; }

.sync-warning {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 15px;
    padding: 10px 12px;
    border-radius: 4px;
    border-left: 3px solid var(--key-eval-present, #ffc700);
    background: rgba(128, 128, 128, .15);
    font-size: .85rem;
    line-height: 1.4;
    text-align: left;
}

#stats-leaderboard-container { width: 100%; margin-top: 20px; }
.stats-leaderboard__title { font-size: 1.1rem; font-weight: bold; margin-bottom: 10px; }
.stats-leaderboard { font-size: .9rem; text-align: left; max-height: 150px; overflow-y: auto; }
.leaderboard-note { text-align: center; }
.leaderboard-row { display: flex; justify-content: space-between; padding: 6px 8px; border-bottom: 1px solid rgba(128, 128, 128, .3); }
.leaderboard-row:last-child { border-bottom: none; }
.leaderboard-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.leaderboard-stats { text-align: right; white-space: nowrap; }
.leaderboard-row.is-clickable { cursor: pointer; }

/* Player grid popup */
#player-grid-popup {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, .5);
    display: flex;
    align-items: center;
    justify-content: center;
}
#player-grid-card {
    position: relative;
    background: var(--modal-bg);
    color: var(--modal-color);
    font-family: var(--sl-font);
    padding: 20px;
    border-radius: 8px;
    width: 85%;
    max-width: 300px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .4);
}
#player-grid-name { font-size: 1.2rem; font-weight: bold; margin: 0 10px 4px; overflow-wrap: anywhere; }
#player-grid-stats { font-size: .9rem; opacity: .8; margin-bottom: 12px; }
#player-grid-rows { font-size: 1.5rem; line-height: 1.15; letter-spacing: 2px; white-space: pre; max-height: 40vh; overflow-y: auto; }
#player-grid-rows.no-grid { font-size: .95rem; line-height: 1.4; letter-spacing: normal; white-space: normal; opacity: .8; }

/* ---------------------------------------------------------- dashboard */
.runway { text-align: center; margin: -10px 0 15px; font-size: .95rem; opacity: .85; }
.cal-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; width: 100%; }
.cal-nav button { background: none; border: none; color: var(--modal-color); cursor: pointer; font-size: 1.4rem; padding: 0 15px; }
.cal-nav h2 { margin: 0; font-size: 1.2rem; color: var(--modal-color); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-bottom: 20px; width: 100%; }
.day-name { text-align: center; font-weight: bold; padding: 5px; background: var(--key-bg); color: var(--key-color); border-radius: 4px; font-size: .85rem; }
.day { padding: 8px 0; border: 1px solid rgba(128, 128, 128, .4); text-align: center; cursor: pointer; color: var(--modal-color); border-radius: 4px; transition: background-color .2s; }
.day:hover { background: rgba(128, 128, 128, .2); }
.day.is-today { border-color: currentColor; }
.day.selected { background: var(--key-eval-correct); color: var(--key-eval-color); border-color: var(--key-eval-correct); }
.day.empty { background: transparent; border: none; cursor: default; }

.editor { width: 100%; }
.editor h3 { margin: 0 0 15px; color: var(--modal-color); }
.flip-card { background-color: transparent; perspective: 1000px; margin-bottom: 15px; height: 180px; }
.flip-card-inner { position: relative; width: 100%; height: 100%; text-align: center; transition: transform .6s; transform-style: preserve-3d; }
.flip-card[data-state="0"] .flip-card-inner { transform: rotateY(0deg); }
.flip-card[data-state="1"] .flip-card-inner { transform: rotateY(-180deg); }
.flip-card[data-state="2"] .flip-card-inner { transform: rotateY(-360deg); }
.flip-card-front, .flip-card-back, .flip-card-third {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 8px;
    box-sizing: border-box;
    background: var(--key-bg);
    color: var(--key-color);
}
.flip-card-front { z-index: 2; text-align: left; padding: 15px; transition: opacity 0s .3s; }
.flip-card-back { transform: rotateY(180deg); padding: 10px; display: flex; flex-direction: column; justify-content: center; }
.flip-card-third { transform: rotateY(0deg); z-index: 3; opacity: 0; transition: opacity 0s .3s; text-align: left; padding: 15px; pointer-events: none; }
.flip-card[data-state="0"] .flip-card-front { opacity: 1; pointer-events: auto; }
.flip-card[data-state="0"] .flip-card-back  { opacity: 0; pointer-events: none; }
.flip-card[data-state="0"] .flip-card-third { opacity: 0; pointer-events: none; }
.flip-card[data-state="1"] .flip-card-front { opacity: 0; pointer-events: none; }
.flip-card[data-state="1"] .flip-card-back  { opacity: 1; pointer-events: auto; }
.flip-card[data-state="1"] .flip-card-third { opacity: 0; pointer-events: none; }
.flip-card[data-state="2"] .flip-card-front { opacity: 0; pointer-events: none; }
.flip-card[data-state="2"] .flip-card-back  { opacity: 0; pointer-events: none; }
.flip-card[data-state="2"] .flip-card-third { opacity: 1; pointer-events: auto; }
.flip-card__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
.flip-card__head label { font-weight: bold; }
.flip-card__head span { font-size: .9em; opacity: .8; }
.flip-card .bar-container { height: 40px; }
.flip-card__stats { font-size: 1.1rem; font-weight: bold; margin: 5px 0 0; }
.flip-card-third h4 { margin: 0 0 10px; }
.flip-card__board { overflow-y: auto; height: 110px; font-size: .9rem; text-align: left; }
.flip-card__board .leaderboard-note { margin-top: 20px; }
.flip-arrow { position: absolute; bottom: 5px; right: 5px; cursor: pointer; opacity: .5; padding: 5px; color: inherit; z-index: 10; }
.flip-arrow:hover { opacity: 1; }
.flip-card-third .flip-arrow { bottom: auto; top: 5px; }
