@font-face {
    font-family: stolzl;
    src: url(../media/Stolzl_Regular-s.p.0xad.yp-e94jw.woff2) format("woff2");
    font-display: swap;
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: stolzl;
    src: url(../media/Stolzl_Bold-s.p.0b.bormvytrq4.woff2) format("woff2");
    font-display: swap;
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: stolzl Fallback;
    src: local(Arial);
    ascent-override: 79.29%;
    descent-override: 20.87%;
    line-gap-override: 0%;
    size-adjust: 119.81%;
}

:root {
    --bg: rgb(7, 7, 8);
    --surface: #111111;
    --surface-light: #181818;
    --white: #ffffff;
    --black: #000000;
    --gray: #999999;
    --orange-500: 252 78 3; /* RGB */
    --border: #2a2a2a;
    --font-stolzl: "stolzl", "stolzl Fallback";
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-family: var(--font-stolzl), ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--black);
    font-family: var(--font-stolzl);
    overflow-x: hidden;
}

/* =========================
   HEADER
========================= */

header {
    height: 120px;
    padding: 0 50px;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-link {
    display: inline-flex;
    align-items: center;
}

.logo-link img {
    width: auto;
    display: block;
}

.logo-main {
    max-height: 85px;
}

.logo-partner {
    max-height: 48px;
}

.header-actions {
    display: flex;
    gap: 14px;
    align-items: center;
}

.header-button {
    background: transparent;
    color: white;

    border: none;
    border-radius: 8px;

    padding: 10px 16px;

    cursor: pointer;
    transition: 0.2s ease;
}

.header-button:hover {
    background: white;
    color: black;
}

/* =========================
   MAIN
========================= */

main {
    min-height: calc(100vh - 120px);

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 50px 30px 90px;
}

.app {
    width: 100%;
    max-width: 1250px;

    display: flex;
    flex-direction: column;
    gap: 40px;
}


/* =========================
   WHEEL
========================= */

.wheel-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.wheel-row {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    flex-wrap: nowrap;
}

.qr-card {
    position: fixed;
    bottom: 24px;
    left: 50px;
    width: min(160px, 22vw);
    max-width: 180px;
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgb(255, 255, 255);
    border: none;
    border-radius: 24px;
    z-index: 20;
}

.qr-card img {
    width: 90%;
    height: 90%;
    object-fit: contain;
    display: block;
}

.wheel-wrapper {
    position: relative;
    z-index: 1;

    width: min(80vw, 760px);
    aspect-ratio: 1 / 1;
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
}

canvas {
    position: relative;
    z-index: 0;
    width: 100%;
    height: 100%;

    display: block;

    cursor: pointer;
}

.wheel-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    width: min(24%, 140px);
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background: rgb(0, 0, 0);
    z-index: 5;
    text-decoration: none;
}

.wheel-logo img {
    width: 85%;
    height: auto;
    display: block;
}

.wheel-logo:hover {
    filter: brightness(1.1);
}

/* Pointer */

.pointer {
    position: absolute;

    top: -16px;
    left: 50%;

    transform: translateX(-50%) rotate(180deg);

    width: 0;
    height: 0;

    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-top: 35px solid red;

    z-index: 9999;
    pointer-events: none;
}

.spin-button {
    margin-top: 45px;
    margin-bottom: 40px;

    width: 220px;
    height: 60px;

    border: none;
    border-radius: 10px;

    background: white;
    color: rgb(7, 7, 8);

    font-size: 17px;
    font-weight: 800;

    cursor: pointer;

    transition:
        transform 0.15s ease,
        background 0.2s ease;
}

.spin-button:hover {
    transform: translateY(-2px);
    background: rgb(229, 229, 229);
}

.spin-button:active {
    transform: scale(0.97);
}

.spin-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.spin-counter {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: -18px;
    color: var(--gray);
    font-size: 13px;
}

.spin-counter strong {
    color: var(--white);
    font-size: 18px;
}

/* =========================
   SETTINGS
========================= */

.settings {
    background: var(--surface);

    border: none;
    border-radius: 16px;

    padding: 25px;
}

.settings h2 {
    font-size: 20px;
    margin-bottom: 8px;
    color: white;
}

.settings-description {
    color: var(--gray);
    font-size: 13px;
    margin-bottom: 25px;
}

.entries {
    display: flex;
    flex-direction: column;
    gap: 8px;

    max-height: 430px;
    overflow-y: auto;

    padding-right: 5px;
}

.color-panel {
    margin-top: 20px;
}

.color-panel h3 {
    margin-bottom: 10px;
    font-size: 14px;
    color: #ddd;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.color-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.color-option {
    padding: 12px 10px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: white;
    cursor: pointer;
    font-weight: 700;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

/* Compact HUD styles */
.entry.compact {
    grid-template-columns: 32px 1fr 120px;
    gap: 8px;
    align-items: center;
}

.entry .entry-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.entry .toggle-advanced {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.04);
    color: #ddd;
    cursor: pointer;
}

.entry .advanced {
    display: none;
    gap: 8px;
    margin-top: 8px;
}

.entry.expanded .advanced {
    display: block;
}

.entries-header {
    display: grid;
    grid-template-columns: 36px 1fr 120px 120px 90px 40px;
    gap: 10px;
    padding: 6px 4px;
    color: #bbb;
    font-size: 12px;
    align-items: center;
}

.entries-header .hdr-number,
.entries-header .hdr-weight,
.entries-header .hdr-color,
.entries-header .hdr-display {
    color: #bbb;
}

.entry .toggle-advanced {
    width: 34px;
    height: 34px;
}

.color-quick {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.color-quick button {
    min-width: 64px;
    padding: 8px 10px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    color: white;
    font-weight: 700;
}

.color-option:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.08);
}

.color-option.active {
    background: rgba(255, 255, 255, 0.2);
}

.entry {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 6px 4px;
}

.entry-number {
    width: 36px;
    min-width: 36px;

    color: #ccc;
    font-size: 13px;
    text-align: center;
}

.entry-text {
    flex: 1 1 auto;
    min-width: 120px;
    max-width: 320px;

    background: #080808;
    color: white;

    border: none;
    border-radius: 6px;

    padding: 6px 8px;
    font-size: 11px;

    outline: none;

    transition: 0.12s ease;
}

.entry-text:focus {
    border-color: white;
}

.remote-sync {
    display: grid;
    gap: 12px;
    margin-top: 24px;
}

#remoteUrlInput {
    width: 100%;
    min-width: 0;
    padding: 12px 14px;
    border-radius: 10px;
    border: none;
    background: #080808;
    color: white;
    outline: none;
}

#remoteUrlInput:focus {
    border-color: white;
}

.remote-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.remote-actions button {
    flex: 1;
    min-width: 140px;
    padding: 12px 16px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: white;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.remote-actions button:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.sync-status {
    font-size: 13px;
    color: var(--gray);
    min-height: 20px;
}

.sync-status.error {
    color: #ff6b6b;
}

.entry-weight {
    display: grid;
    gap: 6px;
}

.entry-weight {
    width: 120px;
    min-width: 100px;
}

.weight-percentage {
    color: #bbb;
    font-size: 11px;
    white-space: nowrap;
}

.entry-weight label,
.entry-color label {
    color: #bbb;
    font-size: 11px;
}

.entry-controls {
    display: grid;
    gap: 6px;
}

.entry-controls {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr 120px;
}

.entry-color {
    display: grid;
    gap: 6px;
}

.entry-color {
    width: 120px;
    min-width: 100px;
}

.color-select {
    width: 100%;
    background: #080808;
    color: white;
    border: none;
    border-radius: 7px;
    padding: 10px 12px;
    outline: none;
    transition: 0.2s ease;
}

.color-select:focus {
    border-color: white;
}

.weight-input {
    width: 100%;
    min-width: 80px;

    background: #080808;
    color: white;

    border: none;
    border-radius: 7px;

    padding: 10px 12px;

    outline: none;

    transition: 0.2s ease;
}

.weight-input:focus {
    border-color: white;
}

/* Display mode select styling to match other controls */
select.display-mode {
    background: #080808;
    color: white;
    border: none;
    border-radius: 7px;
    padding: 8px 10px;
    font-size: 11px;
    outline: none;
    transition: 0.12s ease;
    min-width: 100px;
}

select.display-mode:focus {
    border-color: white;
}

.entry input {
    width: 100%;

    background: #080808;
    color: white;

    border: none;
    border-radius: 7px;

    padding: 10px 12px;

    outline: none;

    transition: 0.2s ease;
}

.entry input:focus {
    border-color: white;
}

.settings-actions {
    display: flex;
    gap: 10px;

    margin-top: 20px;
}

.settings-actions button {
    flex: 1;

    padding: 11px;

    border-radius: 8px;

    border: 1px solid var(--border);

    background: transparent;
    color: white;

    cursor: pointer;

    transition: 0.2s ease;
}

.settings-actions button:hover {
    background: white;
    color: black;
}

/* =========================
   RESULT
========================= */

.result-overlay {
    position: fixed;

    inset: 0;

    background: rgba(0,0,0,0.8);

    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;
    visibility: hidden;

    transition: 0.3s ease;

    z-index: 100;
}

.result-overlay.active {
    opacity: 1;
    visibility: visible;
}

.result-box {
    width: min(90%, 500px);

    background: white;
    color: black;

    border-radius: 18px;

    padding: 50px 40px;

    text-align: center;

    transform: scale(0.8);

    transition: 0.3s ease;
}

.result-overlay.active .result-box {
    transform: scale(1);
}

.result-box small {
    display: block;

    text-transform: uppercase;
    letter-spacing: 2px;

    color: #777;

    margin-bottom: 15px;
}

.result-box h1 {
    font-size: clamp(30px, 5vw, 55px);
    margin-bottom: 30px;
}

.close-result {
    padding: 12px 25px;

    background: black;
    color: white;

    border: none;
    border-radius: 8px;

    cursor: pointer;

    font-weight: 700;
}

/* =========================
   MOBILE
========================= */

@media (max-width: 900px) {

    .app {
        grid-template-columns: 1fr;
    }

    .wheel-wrapper {
        width: min(90vw, 600px);
    }

    .settings {
        max-width: 600px;
        width: 100%;
        margin: auto;
    }
}

@media (max-width: 600px) {

    header {
        padding: 0 20px;
    }

    main {
        padding: 30px 15px;
    }

    .spin-button {
        width: 100%;
        max-width: 300px;
    }
}
