/* tools.css - split from app.css; load order fixed in index.html */
/* === GROUP SHUFFLER === */
/* --group-accent is set per card in the razor */
.shuffler {
    width: 84%;
    max-width: 1180px;
    margin: 8px auto 48px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

/* step 1 (input) next to step 2 (options); input gets the extra room */
.shuffler-top {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 18px;
}

.sh-card {
    background: var(--surface-grad);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    box-shadow: var(--surface-shadow);
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sh-card-head { display: flex; align-items: center; gap: 12px; }

.sh-step {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    align-self: flex-start;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-text, #fff);
    background: color-mix(in srgb, var(--accent) 22%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}

.sh-card-title {
    margin: 0;
    flex: 1 1 auto;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-primary, #fff);
}

.sh-count {
    flex: 0 0 auto;
    padding: 3px 11px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted, #8b8794);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--surface-border);
}

.sh-input-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.sh-mini-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--surface-border);
    color: var(--text-muted, #8b8794);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.sh-mini-btn:hover {
    color: var(--text-primary, #fff);
    border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

/* ===== options fields ===== */
.sh-field { display: flex; flex-direction: column; gap: 8px; }
.sh-label { font-size: 0.82rem; font-weight: 600; color: var(--text-muted, #8b8794); }

/* segmented mode toggle */
.sh-mode {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 4px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--surface-border);
}

.sh-mode-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted, #8b8794);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.sh-mode-btn.active { background: color-mix(in srgb, var(--accent) 85%, #000); color: #fff; }

/* stepper */
.sh-stepper {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    border: 1px solid var(--surface-border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.sh-step-btn {
    width: 40px;
    height: 40px;
    border: 0;
    background: transparent;
    color: var(--text-primary, #fff);
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.sh-step-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.07); }
.sh-step-btn:disabled { opacity: 0.4; cursor: default; }

.sh-step-val {
    min-width: 48px;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary, #fff);
}

/* balance dropdown */
.sh-balance {
    align-self: flex-start;
    padding: 9px 12px;
    border-radius: 10px;
    background: var(--surface-solid);
    color: var(--text-primary, #fff);
    border: 1px solid var(--surface-border);
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
}

/* keep-order toggle */
.sh-toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 4px 0; }
.sh-toggle input { position: absolute; opacity: 0; pointer-events: none; }

.sh-toggle-track {
    flex: 0 0 auto;
    position: relative;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid var(--surface-border);
    transition: background 0.18s ease;
}

.sh-toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.18s ease;
}

.sh-toggle input:checked + .sh-toggle-track { background: color-mix(in srgb, var(--accent) 80%, #000); }
.sh-toggle input:checked + .sh-toggle-track .sh-toggle-thumb { transform: translateX(18px); }

.sh-toggle-text { display: flex; flex-direction: column; }
.sh-toggle-text strong { font-size: 0.9rem; font-weight: 600; color: var(--text-primary, #fff); }
.sh-toggle-text small { font-size: 0.78rem; color: var(--text-muted, #8b8794); }

/* big shuffle button */
.sh-shuffle {
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 13px 20px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-soft, var(--accent)), var(--accent));
    color: #fff;
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 26%, transparent);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sh-shuffle:hover { transform: translateY(-1px); }

/* ===== lined textarea (LinedTextarea.razor) =====
   the gutter and textarea share a fixed line-height (a length, not em) so a
   smaller gutter font still lines up row-for-row with the text. */
.lined {
    --lined-lh: 1.5rem;
    display: flex;
    align-items: stretch;
    border: 1px solid var(--surface-border);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.lined:focus-within { border-color: color-mix(in srgb, var(--accent) 50%, var(--surface-border)); }

.lined-gutter {
    flex: 0 0 auto;
    overflow: hidden;          /* scroll is mirrored from the textarea via JS */
    user-select: none;
    padding: 10px 8px;
    text-align: right;
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 0.78rem;
    line-height: var(--lined-lh);
    color: color-mix(in srgb, var(--text-muted, #8b8794) 70%, transparent);
    background: rgba(255, 255, 255, 0.03);
    border-right: 1px solid var(--surface-border);
}

.lined-gutter span { display: block; }

.lined-area {
    flex: 1 1 auto;
    min-width: 0;
    resize: vertical;
    min-height: calc(var(--lined-rows, 10) * var(--lined-lh) + 20px);
    padding: 10px 12px;
    border: 0;
    background: transparent;
    color: var(--text-primary, #fff);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: var(--lined-lh);
    white-space: pre;
    overflow: auto;
}

.lined-area:focus { outline: none; }
.lined-area::placeholder { color: var(--text-muted, #8b8794); }

@media (max-width: 760px) {
    .shuffler { width: 100%; }
    .shuffler-top { grid-template-columns: 1fr; }
}

.shuffler-error {
    color: #ff8c8c;
    background: rgba(255, 90, 90, 0.08);
    border: 1px solid rgba(255, 90, 90, 0.35);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.88rem;
}

.shuffler-result {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.shuffler-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: #cccccc;
    font-size: 0.92rem;
}

.shuffler-summary strong {
    color: var(--accent-text);
}

.shuffler-summary-actions {
    display: flex;
    gap: 8px;
}

.shuffler-action {
    background: rgba(255, 255, 255, 0.04);
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 5px 12px;
    min-width: 92px;
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.shuffler-action:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
    border-color: var(--accent);
}

.group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.group-card {
    background: linear-gradient(145deg, rgba(26, 26, 26, 0.9), rgba(17, 17, 17, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 18px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    animation: group-card-enter 0.42s cubic-bezier(0.2, 0.7, 0.3, 1.2) backwards;
    animation-delay: calc(var(--i, 0) * 70ms);
}

.group-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

.group-card-droptarget {
    border-color: var(--group-accent);
    box-shadow: 0 0 0 2px var(--group-accent), 0 4px 12px rgba(0, 0, 0, 0.45);
}

@keyframes group-card-enter {
    from { opacity: 0; transform: translateY(10px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.group-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

.group-title-input {
    flex: 1 1 auto;
    min-width: 0;
    background: transparent;
    border: none;
    color: #fff;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    padding: 2px 4px;
    border-radius: 4px;
}

.group-title-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.06);
}

.group-size {
    color: #888;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

.group-copy-btn {
    background: none;
    border: 1px solid transparent;
    color: #aaa;
    padding: 3px 10px;
    min-width: 62px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.group-copy-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.group-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.group-item {
    color: #e0e0e0;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border-left: 3px solid var(--group-accent, #4a90e2);
    transition: background 0.2s ease, transform 0.15s ease;
    word-wrap: break-word;
    cursor: grab;
}

.group-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.group-item:active {
    cursor: grabbing;
}

.group-item-empty {
    color: #555;
    font-style: italic;
    padding: 8px 12px;
    text-align: center;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}




/* === STRING RANDOMIZER GRID === */

.page-title {
    font-size: 2.1rem !important;
    font-weight: 700 !important;
    letter-spacing: 4px !important;
    text-transform: uppercase;
    color: #fff;
    margin: 14px 0 38px !important;
    padding: 6px 28px 16px !important;
    position: relative;
    text-align: center;
    display: inline-block;
    align-self: center;
}

.page-title::before,
.page-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #4a90e2 50%, transparent 100%);
    border-radius: 2px;
}

.page-title::after {
    left: 50%;
    transform: translateX(-50%);
    width: 110px;
}

.page-title::before {
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    bottom: -6px;
    opacity: 0.5;
}

/* when .page-title sits inside a filter/setup card (Games, Movies, Songs, RPS)
   it leads straight into a subtitle, so drop the standalone 38px bottom gap */
.games-filter-head .page-title,
.movies-filter-head .page-title,
.songs-filter-head .page-title,
.rps-setup .page-title {
    margin: 0 0 14px !important;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 1200px;
    margin: 8px auto 40px;
    padding: 0 4px;
    box-sizing: border-box;
}

.tool-card {
    background: var(--surface-grad);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    padding: 20px;
    box-sizing: border-box;   /* keep padding inside the width so it never overflows its parent */
    box-shadow: var(--surface-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.tool-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--surface-shadow-hover);
    border-color: var(--surface-border-hover);
}

.tool-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
    margin-bottom: 0 !important;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.3px;
}

.tool-card-title i {
    color: #4a90e2;
    font-size: 1.1rem;
}

.tool-card-hint {
    color: #888 !important;
    font-size: 0.82rem !important;
    margin: 0 !important;
    margin-top: 2px !important;
    line-height: 1.4;
    min-height: 2.3em;
}

.tool-card-hint code {
    color: #d6a;
    background: rgba(255, 255, 255, 0.04);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.78rem;
}

.tool-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    justify-content: flex-start;
}

.tool-input,
.tool-input-small {
    background-color: rgba(255, 255, 255, 0.03);
    color: #ddd;
    border: 1px solid #333;
    padding: 8px 10px;
    font-size: 0.95rem;
    font-family: inherit;
    border-radius: 4px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.tool-input {
    width: 100%;
    resize: vertical;
}

.tool-textarea {
    min-height: 120px;
}

.tool-input-small {
    width: auto;
    min-width: 70px;
    padding: 4px 8px;
}

.tool-input:focus,
.tool-input-small:focus {
    outline: none;
    border-color: #555;
    box-shadow: 0 0 0 2px rgba(85, 85, 85, 0.2);
}

.tool-input-small::-webkit-inner-spin-button,
.tool-input-small::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

select.tool-input-small option {
    background: #1a1a1a;
    color: #ddd;
}

.option-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.option-row-wrap label {
    flex: 0 0 auto;
}

.option-row label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #bbb;
    font-size: 0.88rem;
    cursor: pointer;
    user-select: none;
}

/* fixed-width label so inputs line up */
.opt-key {
    flex: 0 0 auto;
    min-width: 56px;
}

.option-row input[type="checkbox"] {
    accent-color: #4a90e2;
    cursor: pointer;
}

.tool-btn {
    background-color: #151313;
    color: #ddd;
    border: 1px solid #333;
    padding: 8px 18px;
    margin-top: 1rem;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
    width: 100%;
}

.tool-btn:hover:not(:disabled) {
    background-color: #2a2a2a;
    color: #fff;
}

.tool-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.tool-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tool-result {
    background: rgba(74, 144, 226, 0.08);
    border: 1px solid rgba(74, 144, 226, 0.25);
    border-radius: 6px;
    padding: 10px 12px;
    color: #cde2ff;
    word-break: break-all;
    overflow: hidden;
    font-size: 0.95rem;
    min-height: 22px;
    margin-top: auto;
}

.tool-result-mono {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.92rem;
}

.tool-result-empty {
    color: #555;
    font-style: italic;
}

/* Coin */
.coin-stage {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 130px;
    perspective: 600px;
}

.coin {
    position: relative;
    width: 90px;
    height: 90px;
    transform-style: preserve-3d;
    transition: transform 1.1s cubic-bezier(0.3, 0.6, 0.3, 1);
}

.coin-face {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    font-weight: bold;
    color: #1a1a1a;
    box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.3),
                inset 0 4px 8px rgba(255, 255, 255, 0.25),
                0 4px 14px rgba(0, 0, 0, 0.5);
    font-family: var(--app-font);
}

.coin-face.heads {
    background: linear-gradient(145deg, #ffd54f 0%, #c4942b 100%);
}

.coin-face.tails {
    background: linear-gradient(145deg, #d6d6d6 0%, #888 100%);
    transform: rotateY(180deg);
}

/* Emoji */
.emoji-display {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 120px;
    font-size: 4rem;
    line-height: 1;
}

.emoji-placeholder {
    color: #333;
    font-size: 3rem;
}

/* Responsive */
@media (max-width: 600px) {
    .tool-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .tool-card {
        padding: 16px;
    }

    .tool-card-title {
        font-size: 1rem;
    }
}


/* === NUMBER RANDOMIZER === */
/* reuses .tool-* styles; only dice + lottery visuals are page-specific */

/* Dice */
.dice-tray {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    min-height: 76px;
    padding: 6px 0;
}

.die {
    width: 56px;
    height: 56px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    padding: 7px;
    box-sizing: border-box;
    border-radius: 12px;
    background: linear-gradient(150deg, #f4f4f6 0%, #c9c9d0 100%);
    box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.25),
                inset 0 3px 6px rgba(255, 255, 255, 0.55),
                0 4px 10px rgba(0, 0, 0, 0.45);
}

.pip-cell {
    display: flex;
    align-items: center;
    justify-content: center;
}

.pip {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #1b1b1f;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.55);
}

.die-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    font-weight: 700;
    font-family: var(--app-font);
    color: #888;
    background: linear-gradient(150deg, #2a2a30 0%, #1a1a1f 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.die.rolling {
    animation: dice-tumble 0.42s ease-in-out infinite;
}

@keyframes dice-tumble {
    0%   { transform: rotate(0deg) translateY(0) scale(1); }
    25%  { transform: rotate(-20deg) translateY(-9px) scale(1.08); }
    50%  { transform: rotate(15deg) translateY(3px) scale(0.95); }
    75%  { transform: rotate(-9deg) translateY(-5px) scale(1.05); }
    100% { transform: rotate(0deg) translateY(0) scale(1); }
}

/* Lottery balls */
.lotto-balls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    min-height: 76px;
    padding: 6px 0;
}

.lotto-ball {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    background: radial-gradient(circle at 34% 30%, var(--accent-soft), var(--accent) 75%);
    box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.35), 0 3px 8px rgba(0, 0, 0, 0.45);
    animation: lotto-pop 0.45s cubic-bezier(0.2, 0.7, 0.3, 1.3) backwards;
}

@keyframes lotto-pop {
    0%   { transform: scale(0) rotate(-35deg); opacity: 0; }
    60%  { transform: scale(1.18) rotate(8deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Number chips (multiple numbers) */
.num-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.num-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #ddd;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* dark native date picker */
.tool-card input[type="date"] {
    color-scheme: dark;
}


/* === SPINNING WHEEL === */
/* the wheel is canvas-drawn (wheel.js); this is just page layout */
.wheel-layout {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 28px;
    width: 100%;
    max-width: 880px;
    margin: 8px auto 48px;
}

.wheel-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.wheel-canvas {
    display: block;
    width: min(462px, 80vw);
    height: min(462px, 80vw);
}

/* image mode: canvas is an editor (pick / pan / zoom), not a spin button */
.wheel-canvas.is-image-mode {
    cursor: crosshair;
    touch-action: none;
}

/* optional question shown above the wheel */
.wheel-question {
    max-width: min(462px, 86vw);
    text-align: center;
    font-size: 1.18rem;
    font-weight: 600;
    color: #fff;
    word-break: break-word;
}

.wheel-question::before,
.wheel-question::after {
    content: "";
    display: inline-block;
    width: 22px;
    height: 1px;
    margin: 0 10px;
    vertical-align: middle;
    background: var(--accent);
    opacity: 0.7;
}

.wheel-result-question {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent-text);
    text-align: center;
    word-break: break-word;
    margin-bottom: 2px;
}

/* the Messi clause: the question yields to the GOAT */
.wheel-result-goat {
    color: #f0c05a;
    text-shadow: 0 0 14px rgba(240, 192, 90, 0.45);
}

.wheel-question.wheel-result-goat::before,
.wheel-question.wheel-result-goat::after {
    background: #f0c05a;
}

.wheel-spin-btn {
    width: auto;
    min-width: 190px;
    margin-top: 0;
}

.wheel-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 200px;
    padding: 12px 30px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--accent);
    box-shadow: 0 0 26px -8px var(--accent);
    animation: wheel-result-pop 0.42s cubic-bezier(0.2, 0.7, 0.3, 1.45) backwards;
}

.wheel-result-label {
    font-size: 0.68rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--accent-text);
}

.wheel-result-value {
    font-size: 1.45rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    word-break: break-word;
}

@keyframes wheel-result-pop {
    from { opacity: 0; transform: scale(0.7) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.wheel-result-list {
    padding: 14px 22px;
}

.wheel-winners {
    margin: 6px 0 0;
    padding-left: 22px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.wheel-winners li {
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    word-break: break-word;
}

.wheel-panel {
    width: min(360px, 92vw);
    gap: 14px;
}

.wheel-question-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.wheel-question-row .tool-input {
    flex: 1;
    min-width: 0;
}

.wheel-labels {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.wheel-label-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.wheel-label-input {
    min-width: 0;
    flex: 1;
}

.wheel-weight-input {
    width: 52px;
    flex: 0 0 auto;
    text-align: center;
    padding-left: 6px;
    padding-right: 6px;
}

/* per-row badge: this slice has an image; click removes it */
.wheel-img-clear {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    padding: 4px 5px;
    border: 1px solid rgba(138, 107, 255, 0.45);
    border-radius: 8px;
    background: rgba(138, 107, 255, 0.12);
    color: var(--accent-text);
    font-size: 0.8rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.wheel-img-clear:hover:not(:disabled) {
    background: rgba(239, 111, 108, 0.18);
    border-color: rgba(239, 111, 108, 0.6);
    color: #ef6f6c;
}

.wheel-img-clear:disabled {
    opacity: 0.5;
    cursor: default;
}

.wheel-presets,
.wheel-saved {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 12px;
}

.wheel-section-label {
    font-size: 0.74rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #888;
}

.wheel-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.wheel-preset-chip {
    padding: 4px 12px;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.82rem;
    color: #ccc;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.wheel-preset-chip:hover:not(:disabled) {
    color: #fff;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

.wheel-preset-chip:disabled {
    opacity: 0.5;
    cursor: default;
}

.wheel-save-row {
    display: flex;
    gap: 6px;
}

.wheel-save-row .tool-input {
    flex: 1;
    min-width: 0;
}

.wheel-saved-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.wheel-saved-load {
    max-width: 160px;
    padding: 4px 4px 4px 12px;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.82rem;
    color: #ddd;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.15s ease;
}

.wheel-saved-load:hover:not(:disabled) {
    color: var(--accent-text);
}

.wheel-saved-del {
    display: flex;
    align-items: center;
    padding: 4px 8px 4px 4px;
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    transition: color 0.15s ease;
}

.wheel-saved-del:hover {
    color: #ef6f6c;
}

.wheel-history {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 12px;
}

.wheel-history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.74rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #888;
}

.wheel-clear-btn {
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: 0.76rem;
    color: #888;
    cursor: pointer;
    transition: color 0.15s ease;
}

.wheel-clear-btn:hover {
    color: var(--accent-text);
}

.wheel-history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.wheel-history-chip {
    max-width: 100%;
    padding: 3px 11px;
    border-radius: 999px;
    font-size: 0.82rem;
    color: #bbb;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wheel-history-chip:first-child {
    color: #fff;
    border-color: var(--accent);
}


