/* IKEA's Noto IKEA webfonts, served locally from web_static/. */
@font-face {
    font-family: "Noto IKEA";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("/noto-ikea-400.latin.woff2") format("woff2");
}

@font-face {
    font-family: "Noto IKEA";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("/noto-ikea-700.latin.woff2") format("woff2");
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

navbar {
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 80px;
    padding: 0 24px;
    background: #ffffff;
    border-bottom: 1px solid var(--ikea-line);
    z-index: 10;
}

#hamburger-button {
    display: none;
    flex: none;
    margin-right: 4px;
    cursor: pointer;
}

#logo {
    display: inline-flex;
    flex: none;
    align-items: center;
    text-decoration: none;
}

#logo img {
    display: block;
    width: auto;
    height: 40px;
}

#external-links {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: transparent;
    padding: 0;
    line-height: 0;
    cursor: pointer;
    transition: background-color 120ms ease;
}

.icon-button:hover {
    background: var(--ikea-surface);
}

.icon-button > img {
    height: 22px;
    width: 22px;
}

.cool-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 100%;
    padding: 0 2px;
    background: transparent;
    color: var(--ikea-text);
    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    line-height: 1;
    border-bottom: 2px solid transparent;
    transition: color 120ms ease, border-color 120ms ease;
}

/* IKEA's own header uses plain text links; the icons are used in the mobile
   drawer where the rows have more room. */
.cool-button > img {
    display: none;
}

.mode-arrow {
    display: none;
    flex: none;
}

.cool-button:hover {
    color: var(--ikea-blue);
}

#mode-picker {
    display: flex;
    align-items: stretch;
    gap: 28px;
    height: 100%;
    margin-left: 32px;
}

#mode-picker #close-button {
    display: none;
}

#mode-picker .mode-picker-title {
    display: none;
}

#mode-picker a {
    display: flex;
    text-decoration: none;
}

/* Active mode: blue text with the IKEA-style underline at the bottom edge. */
.cool-button.active {
    color: var(--ikea-blue);
    font-weight: 700;
    border-bottom-color: var(--ikea-blue);
}

@media (max-width: 1100px) {
    navbar {
        height: 72px;
        padding: 0 16px;
    }

    #hamburger-button {
        display: inline-flex;
    }

    #logo img {
        height: 34px;
    }

    #mode-picker {
        position: fixed;
        top: 0;
        bottom: 0;
        right: unset;
        left: -100vw;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 100vw;
        height: auto;
        margin: 0;
        padding-top: 76px;
        background: #ffffff;
        transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    }

    #mode-picker.open {
        left: 0;
    }

    #mode-picker a {
        display: block;
    }

    #mode-picker a .cool-button {
        width: 100%;
        height: auto;
        justify-content: flex-start;
        gap: 14px;
        padding: 18px 24px;
        color: var(--ikea-text);
        background: #ffffff;
        border-bottom: 1px solid var(--ikea-line);
        font-size: 17px;
        font-weight: 400;
    }

    #mode-picker a .cool-button > img {
        display: block;
        width: 24px;
        height: 24px;
    }

    .mode-arrow {
        display: block;
        width: 24px;
        height: 24px;
        margin-left: auto;
        color: var(--ikea-blue);
    }

    .mode-arrow path {
        fill: currentColor;
    }

    /* IKEA keeps the drawer labels black; only the icons carry the blue. */
    #mode-picker a .cool-button.active {
        color: var(--ikea-text);
        background: #ffffff;
        border-bottom-color: var(--ikea-line);
        font-weight: 700;
    }

    #mode-picker .mode-picker-title {
        display: block;
        position: absolute;
        top: 20px;
        left: 0;
        right: 0;
        color: var(--ikea-text);
        font-size: 24px;
        font-weight: 700;
        text-align: center;
        pointer-events: none;
    }

    #mode-picker #close-button {
        display: inline-flex;
        position: absolute;
        top: 12px;
        right: 16px;
    }
}

/* Dagens vara */

:root {
    /* IKEA's brand palette: blue, yellow, white and a warm accent. */
    --ikea-blue: #0058a3;
    --ikea-blue-dark: #004f93;
    --ikea-yellow: #ffdb00;
    --ikea-yellow-soft: #fff6cc;
    --ikea-red: #e00751;
    --ikea-red-soft: #fde8ee;
    --ikea-text: #111111;
    --ikea-muted: #484848;
    --ikea-bg: #ffffff;
    --ikea-surface: #f5f5f5;
    --ikea-line: #dfdfdf;
    --ikea-radius: 4px;
}

[hidden] {
    display: none !important;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: "Noto IKEA", "Noto Sans", "Segoe UI", system-ui, sans-serif;
    background: var(--ikea-bg);
    color: var(--ikea-text);
}

.game-page {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: flex-start;
    gap: clamp(10px, 1.6vh, 18px);
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 112px 24px 40px;
}

.site-footer {
    max-width: 760px;
    margin: 0 auto;
    padding: 8px 24px 32px;
    color: var(--ikea-muted);
    font-size: 11px;
    line-height: 1.5;
    text-align: center;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
[role="button"]:focus-visible {
    outline: 2px solid var(--ikea-blue);
    outline-offset: 2px;
}

.game-header {
    margin-bottom: 4px;
}

.game-header h1 {
    font-size: clamp(30px, 4.4vh, 42px);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--ikea-text);
    margin-bottom: 8px;
}

.game-header p {
    max-width: 640px;
    font-size: clamp(14px, 1.9vh, 16px);
    line-height: 1.5;
    color: var(--ikea-muted);
}

.game-status {
    font-size: 14px;
    color: var(--ikea-muted);
}

.product-card {
    display: flex;
    align-items: center;
    gap: clamp(16px, 2.4vh, 28px);
    padding: 0 0 clamp(16px, 2.4vh, 24px);
    background: #ffffff;
    border-bottom: 1px solid var(--ikea-line);
}

.product-image {
    flex: none;
    width: clamp(132px, 22vh, 220px);
    height: clamp(132px, 22vh, 220px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ikea-surface);
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-details {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    text-align: left;
}

.product-category {
    max-width: 100%;
    font-size: 12px;
    color: var(--ikea-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-name {
    font-size: clamp(20px, 2.8vh, 28px);
    font-weight: 700;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.product-description {
    font-size: clamp(14px, 2vh, 16px);
    color: var(--ikea-muted);
}

.product-amount {
    font-size: clamp(13px, 1.8vh, 15px);
    color: var(--ikea-muted);
}

/* A small yellow price tag with the price left blank: the thing to guess. */

.product-tag {
    display: flex;
    flex: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    align-self: center;
    min-width: 60px;
    padding: 8px 12px;
    background: var(--ikea-yellow);
    color: var(--ikea-blue);
    border-radius: 2px;
}

.product-tag span {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}

.product-tag small {
    font-size: 10px;
    font-weight: 700;
    line-height: 1.1;
}

.guess-form {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.guess-label {
    font-size: 14px;
    font-weight: 700;
}

.guess-row {
    display: flex;
    gap: 8px;
}

.guess-field {
    position: relative;
    flex: 1;
}

.guess-field input {
    width: 100%;
    padding: clamp(8px, 1.3vh, 13px) 48px clamp(8px, 1.3vh, 13px) 14px;
    font-family: inherit;
    font-size: clamp(16px, 2.2vh, 19px);
    color: inherit;
    background: #ffffff;
    border: 1px solid #929292;
    border-radius: var(--ikea-radius);
    outline: none;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.guess-field input:focus {
    border-color: var(--ikea-blue);
    box-shadow: 0 0 0 2px var(--ikea-blue);
}

.guess-field input::placeholder {
    color: #767676;
}

.guess-field input:disabled {
    background: #f2f2f2;
    color: var(--ikea-muted);
}

.guess-unit {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--ikea-muted);
}

.guess-submit {
    padding: 0 28px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    background: var(--ikea-blue);
    border: none;
    border-radius: var(--ikea-radius);
    min-height: 48px;
    cursor: pointer;
    transition: background-color 120ms ease;
}

.guess-submit:hover:not(:disabled) {
    background: var(--ikea-blue-dark);
}

.guess-submit:disabled {
    background: #a9c7e5;
    cursor: default;
}

.guess-error {
    font-size: 13px;
    color: var(--ikea-red);
}

.attempts {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.attempt-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #cccccc;
}

.attempt-dot.used {
    background: var(--ikea-blue);
}

.attempt-dot.used.warmth-warm {
    background: var(--ikea-red);
}

.attempt-dot.used.warmth-correct {
    background: var(--ikea-yellow);
}

.feedback {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: clamp(7px, 1.1vh, 12px) 14px;
    background: #ffffff;
    border: 1px solid var(--ikea-line);
    border-radius: var(--ikea-radius);
}

.feedback strong {
    flex: none;
    font-size: clamp(14px, 2vh, 17px);
    white-space: nowrap;
}

.feedback .feedback-text {
    flex: 1;
    min-width: 0;
    font-size: clamp(12px, 1.6vh, 14px);
    color: var(--ikea-muted);
}

.feedback.warmth-warm {
    border-color: #f6c9d8;
}

.feedback.warmth-warm strong {
    color: var(--ikea-red);
}

.feedback.warmth-correct {
    background: var(--ikea-blue);
    border-color: var(--ikea-blue);
    color: #ffffff;
}

.feedback.warmth-correct .feedback-text {
    color: rgba(255, 255, 255, 0.75);
}

/* Direction arrows: red for a warm guess, blue for a cold one */

.guess-arrow {
    flex: none;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
}

.guess-arrow.warm {
    color: var(--ikea-red);
}

.guess-arrow.cold {
    color: var(--ikea-blue);
}

.feedback .guess-arrow {
    font-size: 18px;
}

.guess-history {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    list-style: none;
}

.guess-history:empty {
    display: none;
}

.guess-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    font-size: 13px;
    background: #ffffff;
    border: 1px solid var(--ikea-line);
    border-radius: var(--ikea-radius);
}

.guess-item.warmth-correct {
    border-color: var(--ikea-blue);
}

.guess-number {
    display: grid;
    place-items: center;
    flex: none;
    width: 17px;
    height: 17px;
    font-size: 10px;
    font-weight: 700;
    color: var(--ikea-muted);
    border-radius: 50%;
    background: #eeeeee;
}

.guess-item.warmth-correct .guess-number {
    background: var(--ikea-blue);
    color: #ffffff;
}

.guess-value {
    flex: none;
    font-weight: 700;
    white-space: nowrap;
}

.guess-hint {
    overflow: hidden;
    font-size: 12px;
    color: var(--ikea-muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.answer {
    padding: clamp(8px, 1.4vh, 16px);
    text-align: center;
    background: #ffffff;
    border: 1px solid var(--ikea-line);
    border-radius: 4px;
}

.answer.answer-win {
    border: 2px solid var(--ikea-blue);
}

.answer h3 {
    font-size: clamp(14px, 2vh, 18px);
    font-weight: 700;
    margin-bottom: 2px;
}

.answer.answer-win h3 {
    color: var(--ikea-blue);
}

/* The revealed price is shown on an IKEA-style yellow price tag. */

.answer-price {
    display: inline-block;
    margin-top: 4px;
    padding: 4px 14px;
    font-size: clamp(17px, 2.6vh, 22px);
    font-weight: 800;
    color: var(--ikea-blue);
    background: var(--ikea-yellow);
    border-radius: var(--ikea-radius);
}

.answer-note {
    margin-top: 2px;
    font-size: clamp(11px, 1.5vh, 13px);
    color: var(--ikea-muted);
}

.answer-restart {
    display: inline-block;
    margin-top: clamp(6px, 1vh, 10px);
    padding: 10px 22px;
    font-size: clamp(13px, 1.8vh, 15px);
    font-weight: 700;
    color: #ffffff;
    background: var(--ikea-blue);
    border-radius: var(--ikea-radius);
    text-decoration: none;
    transition: background-color 120ms ease;
}

.answer-restart:hover {
    background: var(--ikea-blue-dark);
}

@media (max-width: 480px) {
    .game-page {
        padding: 96px 16px 32px;
    }

    .site-footer {
        padding: 8px 16px 28px;
    }

    .product-image {
        width: 116px;
        height: 116px;
    }

    .product-tag {
        min-width: 48px;
        padding: 5px 8px;
    }

    .product-tag span {
        font-size: 22px;
    }

    .guess-submit {
        padding: 0 18px;
    }
}

@media (max-width: 380px) {
    .guess-history {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-height: 620px) {
    .game-header p {
        display: none;
    }

    .product-image {
        width: 76px;
        height: 76px;
    }
}

/* Kund mot kund */

.strid-page {
    gap: 12px;
}

.strid-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.strid-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: clamp(14px, 2.2vh, 22px);
    background: #ffffff;
    border: 1px solid var(--ikea-line);
    border-radius: 4px;
}

.strid-card h2 {
    font-size: clamp(17px, 2.4vh, 21px);
    font-weight: 600;
    line-height: 1.2;
}

.strid-card-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.strid-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--ikea-muted);
}

.strid-hint {
    font-size: clamp(12px, 1.7vh, 14px);
    line-height: 1.45;
    color: var(--ikea-muted);
}

.strid-error {
    padding: 10px 14px;
    font-size: 14px;
    color: var(--ikea-red);
    background: var(--ikea-red-soft);
    border: 1px solid #f6c9d8;
    border-radius: var(--ikea-radius);
}

.strid-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.strid-label {
    font-size: 13px;
    font-weight: 700;
}

#strid-join-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.strid-input {
    width: 100%;
    padding: 11px 14px;
    font-family: inherit;
    font-size: 17px;
    color: inherit;
    background: #ffffff;
    border: 1px solid #929292;
    border-radius: var(--ikea-radius);
    outline: none;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.strid-input:focus {
    border-color: var(--ikea-blue);
    box-shadow: 0 0 0 2px var(--ikea-blue);
}

.strid-input::placeholder {
    color: #767676;
}

.strid-primary,
.strid-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    padding: 11px 22px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    border-radius: var(--ikea-radius);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.strid-primary {
    color: #ffffff;
    background: var(--ikea-blue);
    border: none;
}

.strid-primary:hover:not(:disabled) {
    background: var(--ikea-blue-dark);
}

.strid-primary:disabled {
    background: #a9c7e5;
    cursor: default;
}

.strid-secondary {
    color: var(--ikea-blue);
    background: #ffffff;
    border: 1.5px solid var(--ikea-blue);
}

.strid-secondary:hover:not(:disabled) {
    background: #eaf2fb;
}

.strid-secondary:disabled {
    color: var(--ikea-muted);
    border-color: var(--ikea-line);
    cursor: default;
}

.strid-inline-form {
    display: flex;
    gap: 8px;
}

.strid-inline-form .strid-input {
    flex: 1;
    min-width: 0;
}

.strid-inline-form .strid-primary {
    align-self: stretch;
}

.strid-code-input {
    text-transform: uppercase;
    letter-spacing: 0.28em;
    font-weight: 700;
    font-size: 20px;
}

.strid-code-card {
    align-items: center;
    text-align: center;
    gap: 6px;
}

.strid-code-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ikea-muted);
}

.strid-code {
    margin: 0;
    font-size: clamp(38px, 7vh, 52px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.18em;
    text-indent: 0.18em;
    color: var(--ikea-blue);
}

.strid-copy-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.strid-copy-row .strid-secondary {
    align-self: auto;
}

.strid-player-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    list-style: none;
}

.strid-player {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    background: var(--ikea-bg);
    border: 1px solid transparent;
    border-radius: var(--ikea-radius);
}

.strid-player.you {
    background: var(--ikea-yellow-soft);
    border-color: #ffe680;
}

.strid-player-name {
    min-width: 0;
    font-size: 15px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.strid-badges {
    display: flex;
    flex: none;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
}

.strid-badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ikea-muted);
    background: #f0f0f0;
    border-radius: 999px;
}

.strid-badge.host {
    color: var(--ikea-blue);
    background: var(--ikea-yellow);
}

.strid-badge.ready {
    color: #0a7a3d;
    background: #e6f5ec;
}

.strid-badge.you {
    color: var(--ikea-text);
    background: #e6e6e6;
}

.strid-badge.offline {
    color: var(--ikea-muted);
    background: transparent;
    border: 1px solid var(--ikea-line);
}

.strid-badge.closest {
    margin-left: 6px;
    color: #ffffff;
    background: var(--ikea-blue);
}

.strid-badge.winner {
    margin-left: 6px;
    color: #ffffff;
    background: var(--ikea-blue);
}

.strid-waiting {
    text-align: center;
}

.strid-match-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.strid-round-label {
    font-size: clamp(14px, 2vh, 17px);
    font-weight: 600;
}

.strid-timer {
    font-size: clamp(19px, 3vh, 25px);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--ikea-blue);
    white-space: nowrap;
}

.strid-timer.urgent {
    animation: strid-pulse 700ms ease-in-out infinite alternate;
}

@keyframes strid-pulse {
    from {
        opacity: 1;
    }
    to {
        opacity: 0.45;
    }
}

.strid-standings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    gap: 6px;
}

.strid-standing {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 7px 6px;
    background: #ffffff;
    border: 1px solid var(--ikea-line);
    border-radius: var(--ikea-radius);
    text-align: center;
}

.strid-standing.you {
    background: var(--ikea-yellow-soft);
    border-color: #ffe680;
}

.strid-standing-place {
    font-size: 10px;
    font-weight: 700;
    color: var(--ikea-muted);
}

.strid-standing-name {
    max-width: 100%;
    font-size: 12px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.strid-standing-score {
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--ikea-blue);
}

.strid-round-result {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: clamp(12px, 1.8vh, 18px);
    background: #ffffff;
    border: 1px solid var(--ikea-line);
    border-radius: 4px;
}

.strid-round-result h2 {
    font-size: clamp(16px, 2.3vh, 20px);
    font-weight: 600;
}

.strid-round-result .answer-price {
    font-size: clamp(20px, 3vh, 26px);
}

.strid-closest {
    font-size: 13px;
    font-weight: 600;
    color: var(--ikea-blue);
}

.strid-results {
    display: flex;
    flex-direction: column;
    gap: 3px;
    list-style: none;
}

.strid-result {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    font-size: 13px;
    border-radius: var(--ikea-radius);
}

.strid-result.closest {
    background: var(--ikea-yellow-soft);
}

.strid-result.you {
    box-shadow: inset 0 0 0 1px #ffe680;
}

.strid-result-name {
    min-width: 0;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.strid-result-guess {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.strid-result-distance {
    font-size: 12px;
    color: var(--ikea-muted);
    white-space: nowrap;
}

.strid-result-points {
    min-width: 58px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--ikea-blue);
    text-align: right;
    white-space: nowrap;
}

.strid-winner-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: clamp(20px, 3.4vh, 32px) 18px;
    text-align: center;
    background: #ffffff;
    border: 2px solid var(--ikea-blue);
    border-radius: 4px;
}

.strid-winner-badge {
    padding: 4px 12px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ikea-blue);
    background: var(--ikea-yellow);
    border-radius: 999px;
}

.strid-winner-card h2 {
    font-size: clamp(22px, 3.6vh, 32px);
    font-weight: 700;
    line-height: 1.1;
}

.strid-winner-names {
    font-size: clamp(20px, 3.2vh, 28px);
    font-weight: 700;
    color: var(--ikea-blue);
    overflow-wrap: anywhere;
}

.strid-final-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    list-style: none;
}

.strid-final-row {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--ikea-surface);
    border: 1px solid transparent;
    border-radius: var(--ikea-radius);
}

.strid-final-row.you {
    background: var(--ikea-yellow-soft);
    border-color: #ffe680;
}

.strid-final-place {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    font-size: 12px;
    font-weight: 700;
    color: var(--ikea-blue);
    background: var(--ikea-yellow);
    border-radius: 50%;
}

.strid-final-name {
    min-width: 0;
    font-size: 15px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.strid-final-score {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.strid-panel > .answer-restart {
    align-self: center;
}

button.answer-restart {
    font-family: inherit;
    border: none;
    cursor: pointer;
}

button.answer-restart:disabled {
    background: #a9c7e5;
    cursor: default;
}

.strid-again-note {
    text-align: center;
}

.strid-message-card {
    align-items: flex-start;
}

@media (max-width: 480px) {
    .strid-code {
        font-size: 40px;
    }

    .strid-copy-row .strid-secondary {
        width: 100%;
    }

    .strid-result {
        grid-template-columns: minmax(0, 1fr) auto;
        row-gap: 2px;
    }

    .strid-result-name {
        grid-column: 1;
    }

    .strid-result-points {
        grid-column: 2;
        grid-row: 1;
    }

    .strid-result-guess {
        grid-column: 1;
    }

    .strid-result-distance {
        grid-column: 2;
        text-align: right;
    }
}

/* Recap after the match */

.strid-recap-wrap {
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.strid-recap-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.strid-recap-table th,
.strid-recap-table td {
    padding: 8px 4px;
    border-bottom: 1px solid var(--ikea-line);
    text-align: right;
    white-space: nowrap;
}

.strid-recap-table th {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ikea-muted);
    background: var(--ikea-bg);
}

.strid-recap-table th:nth-child(1),
.strid-recap-table th:nth-child(2),
.strid-recap-table td:nth-child(1),
.strid-recap-table td:nth-child(2) {
    text-align: left;
}

.strid-recap-table th:nth-child(n+4) {
    max-width: 76px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.strid-recap-table tbody tr:last-child td {
    border-bottom: none;
}

.strid-recap-table th.you {
    color: var(--ikea-blue);
    background: var(--ikea-yellow);
}

.strid-recap-round {
    width: 34px;
    font-weight: 700;
    color: var(--ikea-muted);
}

.strid-recap-product,
.strid-recap-table td.strid-recap-product {
    min-width: 90px;
    font-weight: 600;
    white-space: normal;
    overflow-wrap: anywhere;
}

.strid-recap-meta {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: var(--ikea-muted);
    white-space: normal;
}

.strid-recap-price {
    color: var(--ikea-muted);
}

.strid-recap-guess {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.strid-recap-guess.you {
    background: var(--ikea-yellow-soft);
}

.strid-recap-guess.missing {
    color: #b3b3b3;
}

.strid-recap-guess.exact {
    font-weight: 700;
    color: #0a7a3d;
    background: #e6f5ec;
}

.strid-recap-guess.closest {
    font-weight: 700;
    color: var(--ikea-blue);
    background: var(--ikea-yellow-soft);
}

@media (max-width: 480px) {
    .strid-recap-table th,
    .strid-recap-table td {
        padding: 7px 6px;
    }
}

/* Mobile header: keep the logo readable next to the menu button. */

@media (max-width: 480px) {
    #logo img {
        height: 30px;
    }

    .icon-button {
        width: 40px;
        height: 40px;
    }

    .icon-button > img {
        width: 20px;
        height: 20px;
    }

    #external-links {
        gap: 0;
    }
}

/* Statistik */

.stats-page {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: clamp(18px, 2.6vh, 28px);
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 112px 24px 48px;
}

.stats-header {
    max-width: 760px;
}

.stats-header h1 {
    font-size: clamp(34px, 4.8vh, 48px);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -0.03em;
}

.stats-intro {
    max-width: 700px;
    margin-top: 12px;
    font-size: clamp(14px, 1.9vh, 17px);
    line-height: 1.55;
    color: var(--ikea-muted);
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.stat-tile {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 18px 18px 16px;
    background: var(--ikea-surface);
    border-radius: var(--ikea-radius);
}

.stat-tile-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ikea-muted);
}

.stat-tile-value {
    font-size: clamp(22px, 2.7vw, 34px);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--ikea-blue);
    overflow-wrap: anywhere;
}

.stat-tile-note {
    font-size: 12px;
    line-height: 1.35;
    color: var(--ikea-muted);
}

.stat-tile-highlight {
    background: var(--ikea-yellow);
}

.stat-tile-highlight .stat-tile-label,
.stat-tile-highlight .stat-tile-note,
.stat-tile-highlight .stat-tile-value {
    color: var(--ikea-blue);
}

.stats-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: clamp(20px, 3vw, 32px);
    background: #ffffff;
    border: 1px solid var(--ikea-line);
    border-radius: var(--ikea-radius);
}

.stats-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.stats-card-head h2 {
    font-size: clamp(20px, 2.4vw, 26px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.stats-card-head p {
    max-width: 640px;
    margin-top: 6px;
    font-size: clamp(13px, 1.6vw, 15px);
    line-height: 1.5;
    color: var(--ikea-muted);
}

.stats-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--ikea-muted);
}

.legend-swatch {
    flex: none;
    width: 12px;
    height: 12px;
    background: var(--ikea-yellow);
    border-radius: 2px;
}

.stats-empty {
    padding: 28px;
    background: var(--ikea-surface);
    border-left: 4px solid var(--ikea-yellow);
    border-radius: var(--ikea-radius);
}

.stats-empty h2 {
    margin-bottom: 6px;
    font-size: 22px;
    font-weight: 700;
}

.stats-empty p {
    font-size: 14px;
    line-height: 1.5;
    color: var(--ikea-muted);
}

/* Histogram */

.price-histogram {
    display: flex;
    align-items: stretch;
    gap: clamp(3px, 0.7vw, 8px);
    height: clamp(240px, 30vw, 320px);
    padding-top: 24px;
    border-bottom: 1px solid var(--ikea-text);
}

.histogram-column {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.histogram-track {
    position: relative;
    display: flex;
    flex: 1;
    align-items: flex-end;
    justify-content: center;
    min-height: 0;
}

.histogram-bar {
    width: 100%;
    height: var(--bar);
    background: var(--ikea-blue);
    border-radius: 2px 2px 0 0;
    transition: background-color 120ms ease;
}

.histogram-bar.has-products {
    min-height: 3px;
}

.histogram-bar.is-median {
    background: var(--ikea-yellow);
}

.histogram-column:hover .histogram-bar {
    background: var(--ikea-blue-dark);
}

.histogram-column:hover .histogram-bar.is-median {
    background: #f2cf00;
}

.histogram-count {
    position: absolute;
    right: 0;
    bottom: calc(var(--bar) + 6px);
    left: 0;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    color: var(--ikea-text);
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.histogram-label {
    padding-top: 8px;
    font-size: 10px;
    line-height: 1.2;
    color: var(--ikea-muted);
    text-align: center;
    white-space: nowrap;
}

/* The table is the same data as the chart, for anyone who prefers numbers. */

.stats-data {
    padding-top: 12px;
    border-top: 1px solid var(--ikea-line);
}

.stats-data summary {
    color: var(--ikea-blue);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.stats-data summary:hover {
    text-decoration: underline;
}

.stats-table {
    width: 100%;
    margin-top: 12px;
    border-collapse: collapse;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.stats-table th,
.stats-table td {
    padding: 8px 4px;
    border-bottom: 1px solid var(--ikea-line);
    text-align: right;
    white-space: nowrap;
}

.stats-table th {
    color: var(--ikea-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stats-table th:first-child,
.stats-table td:first-child {
    text-align: left;
}

.stats-table tbody tr:last-child td {
    border-bottom: none;
}

/* Category price chart */

.category-chart {
    display: flex;
    flex-direction: column;
}

.category-scale {
    display: grid;
    grid-template-columns: minmax(160px, 240px) minmax(0, 1fr) 82px;
    align-items: end;
    gap: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--ikea-line);
}

.category-scale-info,
.category-scale-median {
    color: var(--ikea-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.category-scale-median {
    text-align: right;
}

.category-scale-ticks {
    position: relative;
    height: 14px;
    color: var(--ikea-muted);
    font-size: 10px;
    font-variant-numeric: tabular-nums;
}

.category-scale-ticks span {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    white-space: nowrap;
}

.category-scale-ticks span:first-child {
    transform: none;
    text-align: left;
}

.category-scale-ticks span:last-child {
    transform: translateX(-100%);
    text-align: right;
}

.category-list {
    display: flex;
    flex-direction: column;
    list-style: none;
}

.category-row {
    display: grid;
    grid-template-columns: minmax(160px, 240px) minmax(0, 1fr) 82px;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--ikea-line);
}

.category-row:last-child {
    border-bottom: none;
}

.category-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.category-name {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.category-meta {
    color: var(--ikea-muted);
    font-size: 11px;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
}

.category-track {
    height: 14px;
    background: var(--ikea-surface);
    border-radius: 2px;
    overflow: hidden;
}

.category-bar {
    display: block;
    height: 100%;
    background: var(--ikea-blue);
    border-radius: 2px;
    transition: width 300ms ease;
}

.category-bar.has-products {
    min-width: 4px;
}

.category-median {
    justify-self: end;
    padding: 5px 10px;
    color: var(--ikea-blue);
    background: var(--ikea-yellow);
    border-radius: 2px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.stats-source {
    max-width: 760px;
    color: var(--ikea-muted);
    font-size: 12px;
    line-height: 1.55;
}

.stats-updated {
    flex: none;
    color: var(--ikea-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.stats-error {
    padding: 12px 14px;
    color: var(--ikea-red);
    background: var(--ikea-red-soft);
    border: 1px solid #f6c9d8;
    border-radius: var(--ikea-radius);
    font-size: 14px;
    line-height: 1.45;
}

.stats-empty h3 {
    margin-bottom: 4px;
    font-size: 18px;
    font-weight: 700;
}

.guess-tile-under .stat-tile-value {
    color: var(--ikea-blue);
}

.guess-tile-over .stat-tile-value {
    color: var(--ikea-red);
}

.guess-tile-exact .stat-tile-value {
    color: var(--ikea-muted);
}

/* Guesses: a diverging chart around zero */

.guess-chart {
    display: flex;
    flex-direction: column;
}

.guess-scale {
    display: grid;
    grid-template-columns: minmax(160px, 240px) minmax(0, 1fr) 82px;
    align-items: end;
    gap: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--ikea-line);
}

.guess-scale-info,
.guess-scale-value {
    color: var(--ikea-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.guess-scale-value {
    text-align: right;
}

.guess-scale-ticks {
    position: relative;
    height: 14px;
    color: var(--ikea-muted);
    font-size: 10px;
    font-variant-numeric: tabular-nums;
}

.guess-scale-ticks span {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    white-space: nowrap;
}

.guess-scale-ticks span:first-child {
    transform: none;
    text-align: left;
}

.guess-scale-ticks span:last-child {
    transform: translateX(-100%);
    text-align: right;
}

.guess-list {
    display: flex;
    flex-direction: column;
    list-style: none;
}

.guess-row {
    display: grid;
    grid-template-columns: minmax(160px, 240px) minmax(0, 1fr) 82px;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--ikea-line);
}

.guess-row:last-child {
    border-bottom: none;
}

.guess-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.guess-name {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.guess-meta {
    color: var(--ikea-muted);
    font-size: 11px;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
}

.guess-row.low-sample .guess-meta {
    color: #767676;
}

.guess-track {
    position: relative;
    height: 18px;
    background: var(--ikea-surface);
    border-radius: 2px;
    overflow: hidden;
}

/* The zero line is the reference the under/over bars diverge from. */
.guess-track::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    z-index: 1;
    width: 1px;
    background: #b9b9b9;
}

.guess-bar {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 2;
    border-radius: 2px;
}

.guess-bar.under {
    background: var(--ikea-blue);
}

.guess-bar.over {
    background: var(--ikea-red);
}

.guess-bar.is-exact {
    left: 50%;
    width: 4px;
    margin-left: -2px;
    background: var(--ikea-yellow);
}

.guess-bar.is-capped {
    border-right: 2px dashed rgba(255, 255, 255, 0.75);
}

.guess-bar.under.is-capped {
    border-right: none;
    border-left: 2px dashed rgba(255, 255, 255, 0.75);
}

.guess-value {
    justify-self: end;
    padding: 5px 10px;
    border-radius: 2px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.guess-value.under {
    color: var(--ikea-blue);
    background: #eaf2fb;
}

.guess-value.over {
    color: var(--ikea-red);
    background: var(--ikea-red-soft);
}

.guess-value.exact {
    color: var(--ikea-blue);
    background: var(--ikea-yellow);
}

.guess-legend {
    flex-wrap: wrap;
    column-gap: 8px;
}

.legend-under {
    background: var(--ikea-blue);
}

.legend-over {
    background: var(--ikea-red);
}

.legend-line {
    flex: none;
    width: 2px;
    height: 14px;
    background: #b9b9b9;
}

.stats-table-wrap {
    overflow-x: auto;
    margin-top: 12px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.stats-table-wrap .stats-table {
    margin-top: 0;
}

@media (max-width: 860px) {
    .stats-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* A vertical histogram cannot keep its interval labels readable on a
       phone, so the same columns become rows with a horizontal track. */
    .price-histogram {
        flex-direction: column;
        gap: 5px;
        height: auto;
        padding-top: 0;
        border-bottom: none;
    }

    .histogram-column {
        display: grid;
        grid-template-columns: 78px minmax(0, 1fr) 48px;
        grid-template-areas: "label track count";
        align-items: center;
        gap: 10px;
        height: 22px;
    }

    .histogram-track {
        display: block;
        grid-area: track;
        height: 16px;
        background: var(--ikea-surface);
        border-radius: 2px;
        overflow: hidden;
    }

    .histogram-bar {
        width: var(--bar);
        height: 100%;
        border-radius: 2px;
    }

    .histogram-bar.has-products {
        min-width: 3px;
        min-height: 0;
    }

    .histogram-count {
        position: static;
        grid-area: count;
        font-size: 11px;
        text-align: right;
    }

    .histogram-label {
        grid-area: label;
        padding-top: 0;
        font-size: 11px;
        text-align: left;
        white-space: normal;
    }

    .category-scale {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "ticks";
        padding-bottom: 4px;
        border-bottom: none;
    }

    .category-scale-info,
    .category-scale-median {
        display: none;
    }

    .category-scale-ticks {
        grid-area: ticks;
    }

    .category-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "info median"
            "track track";
        row-gap: 10px;
    }

    .category-info {
        grid-area: info;
    }

    .category-track {
        grid-area: track;
    }

    .category-median {
        grid-area: median;
    }

    .guess-scale {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "ticks";
        padding-bottom: 4px;
        border-bottom: none;
    }

    .guess-scale-info,
    .guess-scale-value {
        display: none;
    }

    .guess-scale-ticks {
        grid-area: ticks;
    }

    .guess-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "info value"
            "track track";
        row-gap: 10px;
    }

    .guess-info {
        grid-area: info;
    }

    .guess-track {
        grid-area: track;
    }

    .guess-value {
        grid-area: value;
    }
}

@media (max-width: 560px) {
    .stats-page {
        gap: 18px;
        padding: 96px 16px 36px;
    }

    .stats-card {
        padding: 18px 16px;
        gap: 16px;
    }

    .stats-card-head {
        flex-direction: column;
        gap: 10px;
    }

    .stat-tile {
        padding: 14px 14px 12px;
    }

    .stat-tile-value {
        font-size: 22px;
    }

    .histogram-column {
        grid-template-columns: 72px minmax(0, 1fr) 42px;
        gap: 8px;
    }

    .category-name {
        font-size: 14px;
    }

    .category-median {
        padding: 4px 8px;
        font-size: 12px;
    }

    .guess-name {
        font-size: 14px;
    }

    .guess-value {
        padding: 4px 8px;
        font-size: 12px;
    }

    .guess-scale-ticks {
        font-size: 9px;
    }
}
