/* tools.css - split from app.css; load order fixed in index.html */
/* === GROUP SHUFFLER === */
/* --group-accent is set per card in the razor */
.shuffler-layout {
    width: 100%;
    max-width: 1100px;
    margin: 8px auto 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.shuffler-panel {
    /* fill the content area (already margined) capped at 560px; 95vw used to ignore
       those margins and bleed to the screen edges on phones */
    width: 100%;
    max-width: 560px;
    gap: 14px;
}

.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;
}

.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(420px, 78vw);
    height: min(420px, 78vw);
}

.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-panel {
    width: min(360px, 92vw);
    gap: 14px;
}

.wheel-labels {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.wheel-label-input {
    min-width: 0;
}

.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);
}


