/**
 * Dice2 – Mobile-first layout with left sidebar
 * @author master3395
 */

/* Variables (fallbacks if not loaded) */
:root {
    --dice2-sidebar-width: 260px;
    --dice2-topbar-height: 56px;
    --dice2-primary: #00d4aa;
    --dice2-bg: #0f1419;
    --dice2-card: #1a2332;
    --dice2-text: #e6edf3;
    --dice2-text-muted: #8b949e;
}

.dice2-body {
    margin: 0;
    min-height: 100vh;
    padding-top: calc(var(--dice2-topbar-height, 56px) + 0.5rem);
    background: var(--dice2-bg, #0f1419);
    color: var(--dice2-text, #e6edf3);
}

/* Top bar */
.dice2-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--dice2-topbar-height, 56px);
    background: var(--dice2-card, #1a2332);
    border-bottom: 1px solid rgba(0, 212, 170, 0.2);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    z-index: 100;
    gap: 0.75rem;
}

.dice2-menu-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 8px;
    background: rgba(0, 212, 170, 0.15);
    color: var(--dice2-primary);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dice2-menu-btn:hover {
    background: rgba(0, 212, 170, 0.25);
}

.dice2-topbar-title {
    margin: 0;
    font-size: clamp(1rem, 4vw, 1.25rem);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.dice2-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.dice2-lang-option {
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--dice2-text-muted);
    background: transparent;
    transition: background 0.2s, color 0.2s;
}

.dice2-lang-option:hover {
    color: var(--dice2-primary);
    background: rgba(0, 212, 170, 0.15);
}

.dice2-lang-option.active {
    color: var(--dice2-bg);
    background: var(--dice2-primary);
}

.dice2-lang-sep {
    color: var(--dice2-text-muted);
    opacity: 0.6;
    font-size: 0.85rem;
    user-select: none;
}

/* Sidebar */
.dice2-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(85vw, var(--dice2-sidebar-width, 260px));
    max-width: 280px;
    height: 100vh;
    background: var(--dice2-card, #1a2332);
    border-right: 1px solid rgba(0, 212, 170, 0.2);
    z-index: 200;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.3);
}

.dice2-sidebar.open {
    transform: translateX(0);
}

/* Scrollable region so sidebar content (nav + actions) doesn't overflow viewport */
.dice2-sidebar-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.dice2-sidebar-scroll::-webkit-scrollbar {
    width: 8px;
}

.dice2-sidebar-scroll::-webkit-scrollbar-track {
    background: var(--dice2-bg, #0f1419);
    border-radius: 4px;
}

.dice2-sidebar-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 170, 0.4);
    border-radius: 4px;
}

.dice2-sidebar-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 212, 170, 0.6);
}

.dice2-sidebar-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 212, 170, 0.15);
}

.dice2-sidebar-title {
    font-weight: 700;
    font-size: 1.1rem;
}

.dice2-sidebar-close {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--dice2-text-muted);
    font-size: 1.25rem;
    cursor: pointer;
}

.dice2-sidebar-close:hover {
    color: var(--dice2-text);
    background: rgba(255,255,255,0.08);
}

.dice2-sidebar-nav {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 212, 170, 0.1);
}

.dice2-nav-group-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--dice2-text-muted, #8b949e);
    padding: 0.75rem 1rem 0.35rem 1rem;
    margin-top: 0.5rem;
}

.dice2-nav-group-label:first-child {
    margin-top: 0;
    padding-top: 0;
}

.dice2-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--dice2-text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.2s, color 0.2s;
}

.dice2-nav-link:hover {
    background: rgba(0, 212, 170, 0.1);
    color: var(--dice2-primary);
}

.dice2-nav-link i {
    width: 1.25rem;
    text-align: center;
}

.dice2-nav-link.active {
    background: rgba(0, 212, 170, 0.15);
    color: var(--dice2-primary);
}

.dice2-sidebar-actions {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: auto;
    flex-shrink: 0;
}

.dice2-sound-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(0, 212, 170, 0.3);
    border-radius: 8px;
    background: rgba(0, 212, 170, 0.08);
    color: var(--dice2-text);
    font-size: 0.95rem;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: background 0.2s, border-color 0.2s;
}

.dice2-sound-toggle:hover {
    background: rgba(0, 212, 170, 0.15);
    border-color: var(--dice2-primary);
}

.dice2-sound-toggle[aria-pressed="false"] {
    opacity: 0.8;
    border-color: rgba(139, 148, 158, 0.4);
}

.dice2-sound-toggle[aria-pressed="false"] .fa-volume-up {
    display: none;
}

.dice2-sound-toggle .fa-volume-mute {
    display: none;
}

.dice2-sound-toggle[aria-pressed="false"] .fa-volume-mute {
    display: inline-block;
}

.dice2-control-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    border: 1px solid rgba(139, 148, 158, 0.3);
    border-radius: 8px;
    background: transparent;
    color: var(--dice2-text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.dice2-control-btn:hover {
    background: rgba(255,255,255,0.06);
    color: var(--dice2-text);
}

.dice2-discord-area {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 212, 170, 0.1);
    margin-bottom: 0.5rem;
}

.dice2-discord-area .dice2-control-btn {
    width: 100%;
}

.dice2-logout-btn {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.4);
}

.dice2-logout-btn:hover {
    background: rgba(248, 113, 113, 0.2);
    color: #fca5a5;
    border-color: #f87171;
}

.dice2-discord-user {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: var(--dice2-primary);
}

.dice2-discord-hint {
    margin: 0.5rem 0 0 0;
    font-size: 0.75rem;
    color: var(--dice2-text-muted);
}

/* Sidebar language toggle */
.dice2-sidebar-lang {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 212, 170, 0.1);
    margin-bottom: 0.5rem;
}

.dice2-sidebar-lang-label {
    display: block;
    font-size: 0.8rem;
    color: var(--dice2-text-muted);
    margin-bottom: 0.5rem;
}

.dice2-lang-toggle {
    display: flex;
    gap: 0.25rem;
}

.dice2-lang-toggle .dice2-lang-option {
    flex: 1;
    text-align: center;
    padding: 0.5rem 0.5rem;
    font-size: 0.9rem;
}

.dice2-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}

.dice2-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Main content – scale to viewport so it doesn’t overflow (e.g. Cursor AI pane) */
.dice2-main {
    width: 100%;
    max-width: min(900px, 100%);
    min-width: 0;
    margin: 0 auto;
    padding: 1rem;
    padding-top: 1.25rem;
    padding-bottom: 2rem;
    box-sizing: border-box;
    overflow-x: hidden;
}

.dice2-game-controls {
    background: var(--dice2-card, #1a2332);
    border: 1px solid rgba(0, 212, 170, 0.2);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.dice2-add-section h3,
.dice2-history h3,
.dice2-vipps h3 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
}

.dice2-control-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
}

@media (min-width: 480px) {
    .dice2-control-group {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

.dice2-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dice2-field label {
    font-size: 0.8rem;
    color: var(--dice2-text-muted);
}

.dice2-field select,
.dice2-field input[type="number"],
.dice2-field input[type="text"],
.dice2-field input[type="color"] {
    padding: 0.5rem 0.6rem;
    border: 1px solid rgba(139, 148, 158, 0.4);
    border-radius: 8px;
    background: rgba(0,0,0,0.2);
    color: var(--dice2-text);
    font-size: 0.95rem;
}

/* Color dropdown: show actual color per option (like classic dice) */
#newLoddColorDropdown option[value="#00d4aa"] { background: #00d4aa; color: #0f1419; }
#newLoddColorDropdown option[value="#ff6b6b"] { background: #ff6b6b; color: #fff; }
#newLoddColorDropdown option[value="#fbbf24"] { background: #fbbf24; color: #0f1419; }
#newLoddColorDropdown option[value="#0099cc"] { background: #0099cc; color: #fff; }
#newLoddColorDropdown option[value="#8b5cf6"] { background: #8b5cf6; color: #fff; }
#newLoddColorDropdown option[value="#f97316"] { background: #f97316; color: #0f1419; }
#newLoddColorDropdown option[value="#ff69b4"] { background: #ff69b4; color: #0f1419; }
#newLoddColorDropdown option[value="custom"] { background: var(--dice2-card); color: var(--dice2-text); }

.dice2-color-field .dice2-color-select-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dice2-color-swatch {
    flex-shrink: 0;
    width: 2rem;
    height: 2.25rem;
    border-radius: 8px;
    border: 2px solid rgba(0, 212, 170, 0.4);
    background: #00d4aa;
    display: inline-block;
}

.dice2-color-field select {
    flex: 1;
    min-width: 0;
}

.dice2-add-btn {
    grid-column: 1 / -1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #00d4aa, #0099cc);
    color: #0f1419;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
}

.dice2-add-btn:hover {
    filter: brightness(1.1);
}

.dice2-rows {
    margin-bottom: 1rem;
}

/* Same color swatch as add form (dice2-control-group) */
.dice2-rows .dice2-color-select-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dice2-rows .dice2-color-swatch {
    flex-shrink: 0;
    width: 2rem;
    height: 2.25rem;
    border-radius: 8px;
    border: 2px solid rgba(0, 212, 170, 0.4);
    display: inline-block;
}

.dice2-rows .lottery-row-color-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.dice2-rows .lottery-row-color-picker {
    width: 2rem;
    height: 2rem;
    padding: 0;
    cursor: pointer;
    border: none;
    border-radius: 6px;
}

/* Lottery rows (from lottery-ui.js) */
.dice2-rows .lottery-row {
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(0, 212, 170, 0.15);
}

.dice2-rows .lottery-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.dice2-rows .remove-lottery-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: rgba(255,107,107,0.2);
    color: #ff6b6b;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.dice2-draw-section {
    text-align: center;
    padding: 0.5rem 0;
}

.dice2-spin-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #00d4aa, #0099cc);
    color: #0f1419;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 212, 170, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.dice2-spin-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 170, 0.5);
}

.dice2-spin-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #4b5563;
    color: #9ca3af;
    box-shadow: none;
}

.dice2-spin-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

.dice2-dice-container {
    text-align: center;
    margin: 1.5rem 0;
}

.dice2-dice {
    width: 100px;
    height: 100px;
    margin: 0 auto;
    border-radius: 16px;
    background: linear-gradient(145deg, var(--dice2-card), #243044);
    border: 2px solid rgba(0, 212, 170, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--dice2-primary);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.08);
}

.dice2-dice.spinning {
    animation: dice2-spin 0.15s linear infinite;
}

@keyframes dice2-spin {
    from { transform: rotate(0deg) scale(1); }
    to { transform: rotate(360deg) scale(1); }
}

/* Winner result – large and clear for accessibility / hard of reading */
.dice2-result {
    background: var(--dice2-card);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    margin-bottom: 1.5rem;
    border: 2px solid rgba(0, 212, 170, 0.35);
    text-align: center;
    min-height: 160px;
}

.dice2-result .result-title,
.dice2-result h2 {
    margin: 0 0 1rem 0;
    font-size: clamp(1.25rem, 4vw, 1.75rem);
}

.dice2-result .result-winning-number {
    margin: 0 0 0.75rem 0;
    font-size: clamp(1.25rem, 4vw, 1.6rem);
    color: var(--dice2-text);
}

.dice2-result .result-winning-number strong {
    font-size: clamp(2.25rem, 10vw, 4rem);
    display: inline-block;
    margin-top: 0.25rem;
    color: var(--dice2-primary);
}

.dice2-result p,
.dice2-result .result-ticket {
    margin: 0 0 0.5rem 0;
    color: var(--dice2-text-muted);
    font-size: clamp(1rem, 3vw, 1.35rem);
}

.dice2-result .result-message {
    margin-top: 1rem;
    padding: 1rem;
    font-size: clamp(1.05rem, 2.5vw, 1.3rem);
    font-weight: 600;
}

.dice2-history-list {
    max-height: 280px;
    overflow-y: auto;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 0.5rem;
}

/* Winner history items: show color swatch (same structure as lottery-game.js) */
.dice2-history-list .history-item {
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(0, 212, 170, 0.2);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
}

.dice2-history-list .history-item:hover {
    border-color: var(--dice2-primary);
    background: rgba(0, 212, 170, 0.08);
}

.dice2-history-list .history-item-speak {
    cursor: pointer;
}

.dice2-history-list .history-color {
    width: 1.5rem;
    height: 1.5rem;
    min-width: 1.5rem;
    border-radius: 50%;
    margin-right: 0.75rem;
    border: 2px solid rgba(255,255,255,0.2);
}

.dice2-history-list .history-details {
    flex: 1;
    min-width: 0;
    font-size: 0.9rem;
}

.dice2-history-list .history-number {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--dice2-primary);
}

.dice2-no-history {
    text-align: center;
    color: var(--dice2-text-muted);
    padding: 1.5rem !important;
    margin: 0 !important;
}

.dice2-vipps {
    margin-top: 1.5rem;
}

.dice2-vipps-img-wrap {
    text-align: center;
}

.dice2-vipps-edit-wrap {
    margin: 0.75rem 0 0 0;
}

.dice2-vipps-edit-link {
    color: var(--dice2-primary);
    text-decoration: none;
    font-size: 0.95rem;
}

.dice2-vipps-edit-link:hover {
    text-decoration: underline;
}

.dice2-vipps-img {
    max-width: 200px;
    height: auto;
    border-radius: 8px;
    cursor: pointer;
}

/* QR Modal – same look as old qr-modal (dice-layout) */
.dice2-body .qr-modal {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.dice2-body .qr-modal.show {
    opacity: 1;
    visibility: visible;
}

@keyframes qr-modal-slideIn {
    from {
        transform: scale(0.8) translateY(-50px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.dice2-body .qr-modal-content {
    background: var(--dice2-card, #1a2332);
    border: 1px solid rgba(0, 212, 170, 0.3);
    border-radius: 20px;
    padding: 0;
    max-width: 99vw;
    max-height: 99vh;
    width: 95vw;
    height: 95vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: qr-modal-slideIn 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.dice2-body .qr-modal-content::-webkit-scrollbar {
    width: 12px;
}

.dice2-body .qr-modal-content::-webkit-scrollbar-track {
    background: var(--dice2-bg, #0f1419);
    border-radius: 6px;
}

.dice2-body .qr-modal-content::-webkit-scrollbar-thumb {
    background: var(--dice2-primary, #00d4aa);
    border-radius: 6px;
    border: 2px solid var(--dice2-bg, #0f1419);
}

.dice2-body .qr-modal-content::-webkit-scrollbar-thumb:hover {
    background: #00e5b8;
}

.dice2-body .qr-modal-header {
    background: linear-gradient(135deg, #00d4aa 0%, #0099cc 100%);
    color: #fff;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    border-radius: 20px 20px 0 0;
}

.dice2-body .qr-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.dice2-body .qr-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.dice2-body .qr-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.dice2-body .qr-modal-body {
    padding: 2rem;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.dice2-body .qr-content-layout {
    display: flex;
    gap: 2rem;
    min-height: 400px;
    flex-wrap: wrap;
}

.dice2-body .qr-controls-sidebar {
    flex: 0 0 280px;
    background: var(--dice2-bg, #0f1419);
    border-radius: 15px;
    padding: 1.5rem;
    border: 1px solid rgba(0, 212, 170, 0.2);
    height: fit-content;
    position: sticky;
    top: 0;
}

.dice2-body .qr-controls-sidebar .size-control-label {
    color: var(--dice2-text, #e6edf3);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
}

.dice2-body .qr-controls-sidebar .size-control-label span {
    color: var(--dice2-primary, #00d4aa);
    font-weight: 700;
    margin-left: 0.5rem;
}

.dice2-body .qr-controls-sidebar .qr-size-slider {
    width: 100%;
    max-width: 100%;
    margin: 1rem 0;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}

/* Track: full width so thumb can reach the right edge */
.dice2-body .qr-controls-sidebar .qr-size-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    background: var(--dice2-card, #1a2332);
    border-radius: 4px;
    border: 1px solid rgba(0, 212, 170, 0.2);
}

.dice2-body .qr-controls-sidebar .qr-size-slider::-moz-range-track {
    width: 100%;
    height: 8px;
    background: var(--dice2-card, #1a2332);
    border-radius: 4px;
    border: 1px solid rgba(0, 212, 170, 0.2);
}

/* Thumb: at max value it reaches the end of the track */
.dice2-body .qr-controls-sidebar .qr-size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00d4aa 0%, #0099cc 100%);
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0, 212, 170, 0.4);
    margin-top: -6px;
}

.dice2-body .qr-controls-sidebar .qr-size-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00d4aa 0%, #0099cc 100%);
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0, 212, 170, 0.4);
}

.dice2-body .qr-controls-sidebar .qr-size-slider::-webkit-slider-thumb:hover,
.dice2-body .qr-controls-sidebar .qr-size-slider::-moz-range-thumb:hover {
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.6);
}

.dice2-body .qr-controls-sidebar .size-control-buttons {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dice2-body .qr-controls-sidebar .size-btn {
    width: 100%;
    padding: 0.5rem 1rem;
    background: var(--dice2-card, #1a2332);
    border: 1px solid rgba(0, 212, 170, 0.3);
    color: var(--dice2-text-muted, #8b949e);
    font-size: 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.dice2-body .qr-controls-sidebar .size-btn:hover {
    background: linear-gradient(135deg, #00d4aa 0%, #0099cc 100%);
    color: #fff;
    border-color: var(--dice2-primary, #00d4aa);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
}

.dice2-body .qr-controls-sidebar .size-btn.active {
    background: linear-gradient(135deg, #00d4aa 0%, #0099cc 100%);
    color: #fff;
    border-color: var(--dice2-primary, #00d4aa);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.4);
}

.dice2-body .qr-code-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 200px;
}

.dice2-body .qr-code-container {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0, 212, 170, 0.2);
    display: inline-block;
    max-width: 100%;
    transition: width 0.3s ease, height 0.3s ease, min-width 0.3s ease, min-height 0.3s ease;
}

.dice2-body #qrCodeContainer .qr-code-large {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 15px;
    display: block;
    margin: 0 auto;
}
.dice2-body .qr-code-large {
    max-width: min(90vw, 400px);
    width: auto;
    height: auto;
    border-radius: 15px;
    transition: transform 0.3s ease;
    display: block;
    margin: 0 auto;
}

.dice2-body .qr-code-large:hover {
    transform: scale(1.02);
}

.dice2-body .qr-instructions {
    margin: 0.75rem 0 0 0;
    font-size: 0.9rem;
    color: var(--dice2-text-muted, #8b949e);
}

/* Footer inside dice2: ensure spacing and theme alignment */
.dice2-body .footer {
    margin-top: 3rem;
}

.dice2-body .footer::before {
    background: linear-gradient(90deg, var(--dice2-primary), #0099cc);
}

/* QR modal: stack sidebar on narrow screens */
@media (max-width: 700px) {
    .dice2-body .qr-content-layout {
        flex-direction: column;
        align-items: stretch;
    }
    .dice2-body .qr-controls-sidebar {
        position: static;
        flex: 0 0 auto;
    }
    .dice2-body .qr-controls-sidebar .size-control-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .dice2-body .qr-controls-sidebar .size-btn {
        flex: 1 1 auto;
        min-width: 100px;
    }
}

/* Desktop: sidebar always visible */
@media (min-width: 900px) {
    .dice2-sidebar {
        transform: translateX(0);
        box-shadow: none;
    }
    .dice2-sidebar-close,
    .dice2-overlay {
        display: none !important;
    }
    .dice2-menu-btn {
        display: none;
    }
    .dice2-body {
        padding-left: var(--dice2-sidebar-width, 260px);
        padding-top: calc(var(--dice2-topbar-height, 56px) + 0.5rem);
    }
    .dice2-topbar {
        left: var(--dice2-sidebar-width, 260px);
        padding-left: 1.5rem;
    }
}
