:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --primary-color: #6366f1; /* Indigo 500 */
    --primary-glow: rgba(99, 102, 241, 0.5);
    --secondary-color: #8b5cf6; /* Violet 500 */
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --dice-bg: #ffffff;
    --dice-dot: #1e293b;
    --font-main: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    height: 100vh; /* Fallback */
    height: 100dvh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    /* background-image moved to ::before to prevent repaint flickers during 3D transforms */
}

@media (max-width: 600px) {
    body {
        overflow: auto;
        align-items: flex-start;
        min-height: 100vh; /* Fallback */
        min-height: 100dvh;
        height: auto;
    }
}

body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: 
        radial-gradient(circle at 15% 50%, var(--player-bg-1, rgba(99, 102, 241, 0.15)), transparent 25%), 
        radial-gradient(circle at 85% 30%, var(--player-bg-2, rgba(139, 92, 246, 0.15)), transparent 25%);
    transition: background-image 1s ease;
    will-change: background-image;
}
.app-container {
    width: 100%;
    height: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 2rem;
}

/* Header */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    z-index: 10;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.highlight {
    color: var(--primary-color);
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 50%;
    transition: background 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(15deg);
}

/* Main Arena */
.dice-arena {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    perspective: 1000px; /* Essential for 3D effect */
}

.dice-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    padding: 2rem;
    width: 100%;
    min-height: 200px;
    flex-shrink: 0;
}

/* 3D Dice Styling */
.scene {
    width: 100px;
    height: 100px;
    perspective: 600px;
}

.cube {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transform: translateZ(-50px);
    transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1); /* Ease out quart-ish */
    will-change: transform;
}

.cube.rolling {
    animation: spin 0.8s linear infinite;
}

.cube__face {
    position: absolute;
    width: 100px;
    height: 100px;
    background: var(--dice-bg);
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: inset 0 0 15px rgba(0,0,0,0.1); /* Inner shadow for depth */
    display: flex;
    justify-content: center;
    align-items: center;
    backface-visibility: hidden; /* Optimization */
}

/* Dot positioning grid inside faces */
.dot-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    width: 60%;
    height: 60%;
    gap: 4px;
}

.dot {
    background-color: var(--dice-dot);
    border-radius: 50%;
    width: 100%;
    height: 100%;
    box-shadow: inset 1px 1px 2px rgba(0,0,0,0.5); /* Indented look */
}

/* Dot Placement Helpers */
.dot-grid .dot:nth-child(1) { grid-area: 1 / 1; }
.dot-grid .dot:nth-child(2) { grid-area: 1 / 2; }
.dot-grid .dot:nth-child(3) { grid-area: 1 / 3; }
.dot-grid .dot:nth-child(4) { grid-area: 2 / 1; }
.dot-grid .dot:nth-child(5) { grid-area: 2 / 2; }
.dot-grid .dot:nth-child(6) { grid-area: 2 / 3; }
.dot-grid .dot:nth-child(7) { grid-area: 3 / 1; }
.dot-grid .dot:nth-child(8) { grid-area: 3 / 2; }
.dot-grid .dot:nth-child(9) { grid-area: 3 / 3; }

/* Rotate faces */
.cube__face--1  { transform: rotateY(  0deg) translateZ(50px); }
.cube__face--2  { transform: rotateY( 90deg) translateZ(50px); }
.cube__face--3  { transform: rotateY(180deg) translateZ(50px); }
.cube__face--4  { transform: rotateY(-90deg) translateZ(50px); }
.cube__face--5  { transform: rotateX( 90deg) translateZ(50px); }
.cube__face--6  { transform: rotateX(-90deg) translateZ(50px); }

/* Result Display */
.result-display {
    margin-top: 2rem;
    text-align: center;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
    flex-shrink: 0;
}

.result-display.visible {
    opacity: 1;
    transform: translateY(0);
}

.result-display .label {
    display: block;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

.result-display .score {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-color);
    display: block;
}

/* Controls */
.controls {
    padding: 2rem 0;
    display: flex;
    justify-content: center;
}

.primary-btn {
    position: relative;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 1.25rem 3rem;
    font-size: 1.25rem;
    font-weight: 600;
    border-radius: 99px;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.1s, box-shadow 0.3s;
    box-shadow: 0 10px 25px -5px var(--primary-glow);
    font-family: var(--font-main);
    letter-spacing: 0.05em;
    width: 100%;
    max-width: 300px;
    min-height: 56px;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px var(--primary-glow);
}

.primary-btn:active {
    transform: translateY(1px);
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transform: skewX(-20deg);
    transition: 0.5s;
}

.primary-btn:hover .btn-shine {
    left: 150%;
    transition: 0.5s;
}

/* Settings Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 2rem;
    border-radius: 24px;
    width: 90%;
    max-width: 400px;
    position: relative;
    z-index: 101;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

@media (max-width: 600px) {
    .glass-panel {
        width: 95%;
        max-width: none;
        padding: 1.5rem;
        border-radius: 20px;
        margin: 1rem;
    }
}

.modal.open .glass-panel {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.close-btn {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
}

.setting-group {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.setting-group label {
    font-size: 1rem;
    color: #cbd5e1;
}

/* Custom Range Input */
.range-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100px;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    margin-top: -8px;
    box-shadow: 0 0 10px var(--primary-glow);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

#dice-count-val {
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

/* Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

@keyframes spin {
    0% { transform: rotateX(0) rotateY(0) rotateZ(0); }
    100% { transform: rotateX(360deg) rotateY(720deg) rotateZ(360deg); }
}

@media (max-width: 600px) {
    .app-container {
        padding: 1rem;
        justify-content: flex-start;
        max-width: 100%;
        min-height: 100vh; /* Fallback */
        min-height: 100dvh;
        height: auto;
        overflow-y: auto;
        padding-bottom: calc(12rem + env(safe-area-inset-bottom)); /* Increased padding to prevent content being hidden behind controls on mobile */
        -webkit-overflow-scrolling: touch;
    }
    
    .top-bar {
        margin-bottom: 1rem;
        padding: 0.5rem 0;
    }
    
    .logo {
        font-size: 1.375rem;
    }

    .players-container {
        padding: 1rem 0.5rem 0.75rem 0.5rem;
        margin-bottom: 0.5rem;
    }

    .dice-arena {
        justify-content: flex-start;
        padding-top: 0.5rem;
        flex: 1;
    }

    .dice-container {
        gap: 0.5rem;
        padding: 0.5rem 0;
        min-height: 120px;
    }
    
    .scene {
        width: 50px;
        height: 50px;
    }
    
    .cube__face {
        width: 50px;
        height: 50px;
        border-radius: 8px;
    }
    
    /* Adjust translations for smaller cube (50/2 = 25) */
    .cube__face--1  { transform: rotateY(  0deg) translateZ(25px); }
    .cube__face--2  { transform: rotateY( 90deg) translateZ(25px); }
    .cube__face--3  { transform: rotateY(180deg) translateZ(25px); }
    .cube__face--4  { transform: rotateY(-90deg) translateZ(25px); }
    .cube__face--5  { transform: rotateX( 90deg) translateZ(25px); }
    .cube__face--6  { transform: rotateX(-90deg) translateZ(25px); }
    .cube { transform: translateZ(-25px); }

    .result-display {
        margin-top: 1rem;
    }
    .result-display .score {
        font-size: 2rem;
    }
    
    .controls {
        position: fixed;
        left: 0;
        right: 0;
        bottom: env(safe-area-inset-bottom, 0);
        padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
        background: linear-gradient(180deg, rgba(15, 23, 42, 0), rgba(15, 23, 42, 0.85));
        z-index: 50;
    }
    
    .primary-btn {
        padding: 1.125rem 2rem;
        font-size: 1.125rem;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .current-player-indicator {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
}
/* Additions for Player Management */

.players-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 3rem 0.5rem 1rem 0.5rem; /* More top padding for tooltip */
    overflow-x: auto;
    margin-bottom: 0; /* Reduced margin since padding takes space */
    min-height: 80px;
    scrollbar-width: none; /* Hide scrollbar Firefox */
}
.players-container::-webkit-scrollbar {
    display: none; /* Hide scrollbar Chrome/Safari */
}

.player-card {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
    opacity: 0.7;
    overflow: visible;
}

.player-card.active {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--player-color, var(--primary-color));
    box-shadow: 0 0 15px var(--player-glow, var(--primary-glow));
    transform: scale(1.05);
}

.player-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--player-color);
    box-shadow: 0 0 8px var(--player-color);
}

.player-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.remove-player-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ef4444;
    color: white;
    border: none;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.player-card:hover .remove-player-btn {
    opacity: 1;
}

.current-player-indicator {
    font-size: 1.25rem;
    font-weight: 300;
    color: #94a3b8;
    margin-bottom: 2rem;
    transition: color 0.3s;
}

/* Dynamic Dice Color overrides based on active player */
.cube__face {
    background: var(--active-dice-bg, #ffffff);
    border-color: rgba(0,0,0,0.2);
}

.dot {
    background-color: var(--active-dice-dot, #1e293b);
}

/* Override standard primary button color for current player */
.primary-btn {
    /* We can use gradients based on player color, or keep standard. 
       Let's keep standard indigo for 'Roll' to maintain clean look, 
       or subtle tint. */
    filter: hue-rotate(var(--hue-rotate, 0deg));
}

@media (max-width: 600px) {
    .players-container {
        justify-content: center;
        padding: 1rem 0.5rem 0.5rem 0.5rem;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .player-card {
        min-width: 120px;
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        overflow: visible;
    }
    
    .player-dot {
        width: 10px;
        height: 10px;
    }
    
    .remove-player-btn {
        width: 18px;
        height: 18px;
        font-size: 9px;
        top: -4px;
        right: -4px;
    }
    
    .edit-hint {
        top: -35px;
        font-size: 0.7rem;
        padding: 4px 8px;
        z-index: 100;
    }
}
/* Editable Player Name Styles */
.player-name {
    cursor: text;
    border-bottom: 1px dashed transparent;
    transition: all 0.2s;
    min-width: 30px;
    display: inline-block;
    padding: 2px 4px;
    border-radius: 4px;
}

.player-name:hover {
    border-bottom-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.player-name:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid var(--player-color, var(--primary-color));
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.05);
}
/* History and Action Bar Styles */

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-right: 0.25rem;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
}

.history-player {
    font-weight: 600;
}

.history-score {
    font-weight: 700;
    color: var(--accent-light, #fff);
}

.history-dice {
    opacity: 0.7;
    margin-right: auto;
    margin-left: 1rem;
    font-size: 0.8rem;
    letter-spacing: 2px;
}

.history-empty {
    text-align: center;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
}

.modal-backdrop-history {
    /* Reuse modal backdrop styles or similar */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#history-modal.open .modal-backdrop-history {
    opacity: 1;
    pointer-events: auto;
}

/* Scrollbar refinement */
.history-list::-webkit-scrollbar {
    width: 4px;
}
.history-list::-webkit-scrollbar-track {
    background: transparent;
}
.history-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}
/* Text Button for Clear History */
.text-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.text-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.text-btn:active {
    transform: scale(0.98);
}

/* Dice Type Selector */
.dice-type-selector {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    flex: 1;
}

.preset-btns {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.chip-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 99px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-main);
    font-weight: 500;
}

.chip-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.chip-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-glow);
}

.custom-input-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
}

#custom-dice-sides {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 2rem 0.5rem 1rem;
    border-radius: 8px;
    color: white;
    font-family: var(--font-main);
    transition: border-color 0.2s;
}

#custom-dice-sides:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.1);
}

/* Number on Dice Face */
.dice-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--dice-dot);
    user-select: none;
    transition: font-size 0.2s; /* Smooth transition */
}

.dice-number[data-len="3"] {
    font-size: 1.8rem;
}

.dice-number[data-len="4"] {
    font-size: 1.4rem;
}

/* --- Main Screen Dice Selector --- */

.dice-type-selector.main-selector {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    gap: 0.5rem;
    background: transparent;
    padding: 0.5rem;
    border-radius: 16px;
    backdrop-filter: none;
    border: none;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    box-shadow: none;
}

.dice-type-selector.main-selector .preset-btns {
    gap: 0.5rem;
    justify-content: center;
    width: auto;
}

.dice-type-selector.main-selector .chip-btn {
    padding: 0.5rem 0.1rem;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255, 255, 255, 0.05);
}

.dice-type-selector.main-selector .chip-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.dice-type-selector.main-selector .chip-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 20px var(--primary-glow);
    transform: translateY(-2px);
    color: white;
}

.custom-input-wrapper.mini {
    width: auto;
    display: flex;
    align-items: center;
    position: relative;
}

.custom-input-wrapper.mini::before {
    content: "Custom";
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: var(--text-color);
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    white-space: nowrap;
}

.custom-input-wrapper.mini:hover::before {
    opacity: 0.7;
}

.custom-input-wrapper.mini input {
    width: 48px;
    height: 48px;
    text-align: center;
    padding: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.3);
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.custom-input-wrapper.mini input:focus {
    border-style: solid;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 15px var(--primary-glow);
    outline: none;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .dice-type-selector.main-selector {
        padding: 0.5rem;
        gap: 0.375rem;
        border-radius: 12px;
        max-width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        margin-bottom: 1rem;
    }
    
    .dice-type-selector.main-selector .preset-btns {
        gap: 0.375rem;
        justify-content: center;
        flex-wrap: wrap;
        width: 100%;
    }
    
    .dice-type-selector.main-selector .chip-btn {
        width: 44px;
        height: 44px;
        font-size: 0.8rem;
        flex-shrink: 0;
        padding: 0.375rem;
        border-radius: 10px;
    }
    
    .custom-input-wrapper.mini {
        margin-top: 0.5rem;
    }
    
    .custom-input-wrapper.mini input {
        width: 44px;
        height: 44px;
        font-size: 0.8rem;
    }
    
    .custom-input-wrapper.mini::before {
        font-size: 0.65rem;
        top: -20px;
    }
}

.edit-hint {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    pointer-events: none;
    opacity: 0;
    animation: bounceFade 5s ease-in-out forwards;
    white-space: nowrap;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.2);
}

.edit-hint::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--primary-color);
}

@keyframes bounceFade {
    0% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    5% { opacity: 1; transform: translateX(-50%) translateY(0); }
    15% { transform: translateX(-50%) translateY(-4px); }
    20% { transform: translateX(-50%) translateY(0); }
    80% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}
