* {
    box-sizing: border-box;
}

:root {
    /* These map to theme variables with fallbacks for standalone use */
    --bg: var(--theme-bg-alt, #1a0033);
    --panel: var(--theme-panel, #0d001a);
    --accent: var(--theme-accent, #00ffff);
    --accent2: var(--theme-accent2, #ff00ff);
    --accent3: var(--theme-accent3, #ffff00);
    --danger: var(--theme-danger, #ff0055);
    --warning: var(--theme-warning, #ff9900);
    --text: var(--theme-text, #00ffaa);
    --text-bright: var(--theme-text-bright, #ffffff);
    --muted: var(--theme-text-muted, #8855ff);
    --border: var(--theme-border, #00ffff);
    --card: var(--theme-card, #1a0033);
    --glow: var(--theme-glow, rgba(0, 255, 255, 0.5));
    
    /* Additional theme variables */
    --border-width: var(--theme-border-width, 4px);
    --border-radius: var(--theme-border-radius, 0px);
    --font-primary: var(--theme-font-primary, 'Press Start 2P', monospace);
    --shadow-color: var(--theme-shadow-color, #006666);
}

@keyframes scanlines {
    0% { background-position: 0 0; }
    100% { background-position: 0 8px; }
}

@keyframes flicker {
    0% { opacity: 0.97; }
    5% { opacity: 0.99; }
    10% { opacity: 0.98; }
    15% { opacity: 1; }
    20% { opacity: 0.97; }
    100% { opacity: 1; }
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 5px var(--glow), 0 0 10px var(--glow), inset 0 0 5px var(--glow); }
    50% { box-shadow: 0 0 10px var(--glow), 0 0 20px var(--glow), inset 0 0 10px var(--glow); }
}

@keyframes rainbow-border {
    0% { border-color: #00ffff; }
    25% { border-color: #ff00ff; }
    50% { border-color: #ffff00; }
    75% { border-color: #00ff00; }
    100% { border-color: #00ffff; }
}

body {
    margin: 0;
    font-family: var(--font-primary);
    background: var(--theme-bg, #0a0015);
    color: var(--text);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    /* Visual effects moved to theme file */
}

/* Theme-specific pseudo-elements are in theme files */
/* body::before and body::after defined in themes/8bit.css etc. */

button, input {
    font-family: inherit;
}

.page {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 16px;
    gap: 16px;
    min-height: 100vh;
    position: relative;
    background: 
        radial-gradient(circle at 20% 50%, rgba(var(--theme-accent2-rgb, 255, 0, 255), 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(var(--theme-accent-rgb, 0, 255, 255), 0.1) 0%, transparent 50%),
        var(--theme-bg-gradient, linear-gradient(180deg, #0a0015 0%, #1a0033 50%, #0a0015 100%));
}

.main {
    width: 100%;
    max-width: 1200px;
    padding: 20px 16px;
    margin-right: 384px;
    display: flex;
    flex-direction: column;
    gap: 36px;
    flex: 1;
    position: relative;
    transition: all 0.5s ease;
    margin-bottom: 150px;
}

.logo-block {
    text-align: center;
    margin: 0 auto 60px;
    transition: margin 0.5s ease;
}

.retro-logo {
    font-family: var(--font-primary);
    font-size: 4rem;
    margin: 0;
    padding: 20px;
    color: var(--text-bright);
    text-shadow: 
        3px 3px 0 var(--accent),
        6px 6px 0 rgba(255, 0, 255, 0.3);
    letter-spacing: 4px;
    text-transform: uppercase;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: inline-block;
    transform-origin: center center;
}

.search-block {
    position: relative;
    text-align: center;
    margin: 0 auto;
    max-width: 800px;
    width: 100%;
    transition: all 0.5s ease;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-status-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    pointer-events: none;
}

.search-status-icon.loading {
    color: var(--accent);
    animation: spin 1s linear infinite;
}

.search-status-icon.no-results {
    color: var(--danger);
}

@keyframes spin {
    from { transform: translateY(-50%) rotate(0deg); }
    to { transform: translateY(-50%) rotate(360deg); }
}

#member-search {
    width: 100%;
    padding: 14px 24px;
    padding-right: 55px;
    font-size: 1rem;
    border-radius: 0;
    border: 4px solid var(--border);
    background: var(--panel);
    color: var(--text-bright);
    box-shadow: 
        0 0 20px var(--glow),
        inset 0 0 20px rgba(0, 255, 255, 0.1),
        0 4px 0 #006666,
        0 8px 0 #003333;
    text-shadow: 0 0 5px var(--accent);
    transition: all 0.1s ease;
}

#member-search:focus {
    outline: none;
    border-color: var(--accent);
    animation: glowPulse 1.5s infinite;
    transform: scale(1.02);
}

.suggestions {
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
    background: var(--panel);
    border: 3px solid var(--accent);
    border-radius: 0;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 0;
    opacity: 0;
    z-index: 5;
    box-shadow: 
        0 0 20px var(--glow),
        inset 0 0 20px rgba(0, 255, 255, 0.1),
        0 6px 0 #006666;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--panel);
}

.suggestions::-webkit-scrollbar {
    width: 8px;
}

.suggestions::-webkit-scrollbar-track {
    background: var(--panel);
}

.suggestions::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 0;
}

.suggestions::-webkit-scrollbar-thumb:hover {
    background: var(--accent2);
}

.suggestions.active {
    max-height: calc(5 * 56px);
    opacity: 1;
}

.suggestion-item {
    padding: 16px 24px;
    border-bottom: 2px solid var(--border);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.1s ease;
    position: relative;
    min-height: 56px;
    display: flex;
    align-items: center;
    letter-spacing: 0.5px;
    line-height: 1.6;
}

.suggestion-item::before {
    content: '▸';
    position: absolute;
    left: 8px;
    opacity: 0;
    transition: opacity 0.1s ease;
    font-size: 0.9rem;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item.active,
.suggestion-item:hover,
.suggestion-item:focus {
    background: var(--accent);
    color: var(--panel);
    text-shadow: none;
    padding-left: 32px;
    outline: none;
}

.suggestion-item.active::before,
.suggestion-item:hover::before,
.suggestion-item:focus::before {
    opacity: 1;
}

.grid-block {
    margin-top: 40px;
    transition: opacity 0.5s ease, max-height 0.5s ease, margin 0.5s ease;
    overflow: hidden;
}

.grid-block.hidden {
    opacity: 0;
    max-height: 0;
    margin-top: 0;
    pointer-events: none;
}

.grid-title {
    font-size: 0.8rem;
    margin-bottom: 16px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent);
    text-shadow: 0 0 10px var(--glow), 2px 2px 0 var(--accent2);
    position: relative;
    padding-left: 20px;
}

.grid-title::before {
    content: '◆';
    position: absolute;
    left: 0;
    animation: glowPulse 2s infinite;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    transition: all 0.5s ease;
}

.member-card {
    background: var(--panel);
    border: 4px solid transparent;
    border-radius: 0;
    padding: 24px 16px;
    position: relative;
    min-height: 160px;
    cursor: pointer;
    box-shadow: 
        0 0 10px rgba(0, 255, 255, 0.1),
        inset 0 0 10px rgba(0, 255, 255, 0.05),
        0 4px 0 #004444,
        0 6px 0 #002222;
    transition: all 0.1s ease;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.member-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--accent), var(--accent2), var(--accent3), var(--accent));
    background-size: 400% 400%;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.2s ease;
}

.member-card:focus {
    outline: none;
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 0 30px var(--glow),
        inset 0 0 20px rgba(0, 255, 255, 0.2),
        0 8px 0 #006666,
        0 12px 0 #003333;
    border-color: var(--accent2);
}

.member-card:focus::before {
    opacity: 0.3;
    animation: rainbow-border 2s linear infinite;
}

.member-card.hover-active {
    outline: none;
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 0 30px var(--glow),
        inset 0 0 20px rgba(0, 255, 255, 0.2),
        0 8px 0 #006666,
        0 12px 0 #003333;
    border-color: var(--accent2);
}

.member-card.hover-active::before {
    opacity: 0.3;
    animation: rainbow-border 2s linear infinite;
}

.member-card .wa-icon {
    position: absolute;
    top: 12px;
    left: 12px;
    opacity: 0;
    color: var(--danger);
    font-size: 1.5rem;
    transition: opacity 0.1s ease, transform 0.1s ease;
    filter: drop-shadow(0 0 5px var(--danger));
    cursor: pointer;
    z-index: 10;
    /* Larger click area to make it easier to click */
    padding: 8px;
    margin: -8px;
    border-radius: 50%;
}

/* Prevent card transform when clicking the X icon */
.member-card:active:has(.wa-icon:active),
.member-card.icon-clicking,
.member-card.icon-clicking:active {
    transform: none !important;
}

/* X icon press effect */
.member-card .wa-icon:active {
    transform: scale(0.9);
}

.member-card:focus .wa-icon,
.member-card.hover-active .wa-icon {
    opacity: 1;
    animation: glowPulse 1s infinite;
}

.member-name {
    font-size: 0.75rem;
    margin-bottom: 12px;
    color: var(--text-bright);
    text-shadow: 0 0 5px var(--accent);
    letter-spacing: 1px;
}

.item-list {
    color: var(--muted);
    font-size: 0.6rem;
    line-height: 1.6;
    text-shadow: 0 0 3px rgba(136, 85, 255, 0.5);
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 0.6rem;
}

.wa-btn {
    padding: 12px 16px;
    border-radius: 0;
    border: 3px solid var(--border);
    background: var(--panel);
    color: var(--text-bright);
    cursor: pointer;
    font-weight: 700;
    text-shadow: 0 0 5px var(--accent);
    box-shadow: 
        0 0 10px var(--glow),
        inset 0 0 10px rgba(0, 255, 255, 0.1),
        0 4px 0 #006666;
    transition: all 0.1s ease;
    position: relative;
}

.wa-btn:focus {
    outline: none;
    border-color: var(--accent);
}

.wa-btn:active {
    transform: translateY(2px);
    box-shadow: 
        0 0 10px var(--glow),
        inset 0 0 10px rgba(0, 255, 255, 0.1),
        0 2px 0 #006666;
}

.wa-btn.danger {
    border-color: var(--danger);
    color: var(--danger);
    text-shadow: 0 0 5px var(--danger);
    box-shadow: 
        0 0 10px rgba(255, 0, 85, 0.5),
        inset 0 0 10px rgba(255, 0, 85, 0.1),
        0 4px 0 #660022;
}

.wa-btn.danger:hover {
    background: var(--danger);
    color: var(--panel);
    text-shadow: none;
    box-shadow: 
        0 0 20px rgba(255, 0, 85, 0.8),
        inset 0 0 20px rgba(255, 255, 255, 0.2),
        0 4px 0 #660022;
}

.wa-btn.danger:active {
    box-shadow: 
        0 0 10px rgba(255, 0, 85, 0.5),
        inset 0 0 10px rgba(255, 255, 255, 0.2),
        0 2px 0 #660022;
}

.square {
    width: 80px;
    height: 80px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    border-radius: 0;
}

.widget-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 384px;
    background: 
        linear-gradient(180deg, rgba(255, 0, 255, 0.05) 0%, transparent 50%, rgba(0, 255, 255, 0.05) 100%),
        var(--panel);
    border-left: 4px solid var(--border);
    display: flex;
    flex-direction: column;
    box-shadow: inset 0 0 50px rgba(0, 255, 255, 0.1);
}

/* Fixed clock at top */
.widget-panel > .clock-widget {
    position: sticky;
    top: 0;
    z-index: 10;
    margin: 20px 16px 0 16px;
    background: var(--panel);
    box-shadow: 
        0 0 15px var(--glow),
        inset 0 0 15px rgba(0, 255, 255, 0.1),
        0 4px 0 #006666,
        0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Scrollable middle section */
.widget-panel-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: relative;
}

/* Scroll indicators */
.widget-panel-scroll::before,
.widget-panel-scroll::after {
    content: '';
    position: sticky;
    left: 0;
    right: 0;
    height: 30px;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.widget-panel-scroll::before {
    top: 0;
    background: linear-gradient(to bottom, var(--panel) 0%, transparent 100%);
    margin-bottom: -30px;
}

.widget-panel-scroll::after {
    bottom: 0;
    background: linear-gradient(to top, var(--panel) 0%, transparent 100%);
    margin-top: -30px;
}

.widget-panel-scroll.can-scroll-up::before {
    opacity: 1;
}

.widget-panel-scroll.can-scroll-down::after {
    opacity: 1;
}

/* Scrollbar styling */
.widget-panel-scroll::-webkit-scrollbar {
    width: 8px;
}

.widget-panel-scroll::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-left: 2px solid var(--border);
}

.widget-panel-scroll::-webkit-scrollbar-thumb {
    background: var(--accent);
    box-shadow: 0 0 5px var(--accent);
}

.widget-panel-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--text-bright);
}

/* Fixed system buttons at bottom */
.widget-panel > .actions-widget {
    position: sticky;
    bottom: 0;
    z-index: 10;
    margin: 0 16px 20px 16px;
    background: var(--panel);
    box-shadow: 
        0 0 15px var(--glow),
        inset 0 0 15px rgba(0, 255, 255, 0.1),
        0 4px 0 #006666,
        0 -4px 20px rgba(0, 0, 0, 0.5);
}

.widget {
    background: var(--panel);
    border: 3px solid var(--border);
    border-radius: 0;
    padding: 16px;
    box-shadow: 
        0 0 15px var(--glow),
        inset 0 0 15px rgba(0, 255, 255, 0.1),
        0 4px 0 #006666;
    position: relative;
}

.widget::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: var(--accent);
    box-shadow: 0 0 5px var(--accent);
}

.widget-title {
    font-size: 0.6rem;
    color: var(--accent);
    margin-bottom: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 0 5px var(--glow);
}

.clock {
    font-size: 2.4rem;
    letter-spacing: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-shadow: 
        0 0 20px var(--accent),
        0 0 40px var(--accent),
        2px 2px 0 var(--accent2);
    color: var(--text-bright);
}

.clock-colon {
    animation: blink 1s steps(2, jump-none) infinite;
    color: var(--accent);
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0.2; }
}

.birthdays-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.birthday-pill {
    background: var(--panel);
    padding: 12px 14px;
    border: 2px solid var(--accent3);
    border-radius: 0;
    color: var(--text-bright);
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 0.65rem;
    letter-spacing: 0.5px;
    line-height: 1.5;
    box-shadow: 
        0 0 10px rgba(255, 255, 0, 0.3),
        inset 0 0 10px rgba(255, 255, 0, 0.1);
    text-shadow: 0 0 5px var(--accent3);
    transition: all 0.1s ease;
}

.birthday-pill:hover {
    transform: translateX(4px);
    box-shadow: 
        0 0 20px rgba(255, 255, 0, 0.5),
        inset 0 0 15px rgba(255, 255, 0, 0.2);
}

/* ========== SPOTIFY WIDGET ========== */
.spotify-widget {
    position: relative;
    background: linear-gradient(135deg, #0d001a 0%, #1a0033 100%);
    border: 3px solid #1db954;
    padding: 12px;
    animation: glowPulse 3s ease-in-out infinite;
}

.spotify-detach-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(29, 185, 84, 0.2);
    border: 2px solid #1db954;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1db954;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.spotify-detach-btn:hover {
    background: #1db954;
    color: #000;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(29, 185, 84, 0.8);
}

.spotify-detached-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    backdrop-filter: blur(5px);
}

.spotify-detached-content {
    text-align: center;
    color: var(--text-bright);
    padding: 10px;
    max-width: 280px;
}

.spotify-detached-content i {
    font-size: 2rem;
    color: #1db954;
    margin-bottom: 10px;
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(29, 185, 84, 0.6);
    }
    50% {
        text-shadow: 0 0 25px rgba(29, 185, 84, 1);
    }
}

.spotify-detached-content p {
    font-size: 0.65rem;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.spotify-reattach-btn {
    background: rgba(29, 185, 84, 0.2);
    border: 2px solid #1db954;
    color: #1db954;
    padding: 8px 16px;
    font-size: 0.6rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
    font-family: var(--font-primary);
}

.spotify-reattach-btn:hover {
    background: #1db954;
    color: #000;
    box-shadow: 0 0 20px rgba(29, 185, 84, 0.8);
    transform: scale(1.05);
}

.spotify-widget .widget-title {
    color: #1db954;
    margin-bottom: 12px;
    font-size: 10px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.spotify-widget .widget-title i {
    margin-right: 6px;
    animation: glowPulse 2s ease-in-out infinite;
}

.spotify-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.spotify-track-info {
    text-align: center;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    position: relative;
}

.spotify-track-name {
    font-size: 9px;
    color: var(--text-bright);
    line-height: 1.4;
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    position: relative;
    z-index: 2;
}

.spotify-artist-name {
    font-size: 7px;
    color: var(--muted);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    position: relative;
    z-index: 2;
}

/* Spotify Visualizer - Background Overlay */
.spotify-visualizer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.3;
    filter: drop-shadow(0 0 5px #1db954);
    z-index: 1;
    pointer-events: none;
}

/* Progress Bar */
.spotify-progress {
    height: 6px;
    background: var(--panel);
    border: 2px solid #1db954;
    border-radius: 0;
    overflow: visible;
    position: relative;
    cursor: pointer;
}

.spotify-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #1db954 0%, #1ed760 100%);
    width: 0%;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px #1db954;
    pointer-events: none;
}

.spotify-progress-tooltip {
    position: absolute;
    bottom: 16px;
    transform: translateX(-50%);
    background: var(--panel);
    color: #1db954;
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    border: 1px solid #1db954;
}

.spotify-progress:hover .spotify-progress-tooltip {
    opacity: 1;
}

/* Controls */
.spotify-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.spotify-btn {
    background: linear-gradient(135deg, var(--panel) 0%, #1a0033 100%);
    border: 2px solid #1db954;
    color: #1db954;
    padding: 8px 12px;
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: 10px;
    transition: all 0.2s ease;
    position: relative;
    text-shadow: 0 0 5px #1db954;
}

.spotify-btn:hover {
    background: #1db954;
    color: var(--bg);
    transform: translateY(-2px);
    box-shadow: 
        0 0 20px rgba(29, 185, 84, 0.8),
        inset 0 0 10px rgba(255, 255, 255, 0.2);
    text-shadow: none;
}

.spotify-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 0 10px rgba(29, 185, 84, 0.6),
        inset 0 0 5px rgba(0, 0, 0, 0.3);
}

.spotify-btn-main {
    padding: 10px 16px;
    font-size: 12px;
    border-width: 3px;
}

.spotify-btn-main:hover {
    animation: glowPulse 1s ease-in-out infinite;
}

/* Error State */
.spotify-error {
    font-size: 7px;
    color: var(--danger);
    text-align: center;
    padding: 6px;
    background: rgba(255, 0, 85, 0.1);
    border: 1px solid var(--danger);
    line-height: 1.4;
}

/* Queue Section */
.spotify-queue {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid #1db954;
}

.spotify-queue-title {
    font-size: 7px;
    color: #1db954;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.spotify-queue-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.spotify-queue-item {
    font-size: 6px;
    color: var(--muted);
    line-height: 1.4;
    padding: 4px;
    background: rgba(29, 185, 84, 0.05);
    border-left: 2px solid #1db954;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spotify-queue-item-name {
    color: var(--text);
}

.spotify-queue-item-artist {
    color: var(--muted);
    font-size: 5px;
}

/* Playlist Button */
.spotify-playlist-btn {
    width: 100%;
    margin-top: 10px;
    background: linear-gradient(135deg, #1db954 0%, #1ed760 100%);
    border: 2px solid #1db954;
    color: var(--bg);
    padding: 8px;
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: 7px;
    transition: all 0.2s ease;
    font-weight: bold;
}

.spotify-playlist-btn:hover {
    background: linear-gradient(135deg, #1ed760 0%, #1db954 100%);
    transform: translateY(-2px);
    box-shadow: 
        0 0 20px rgba(29, 185, 84, 0.8),
        inset 0 0 10px rgba(255, 255, 255, 0.2);
}

.spotify-playlist-btn:active {
    transform: translateY(0);
}

/* Playlist Modal */
.playlist-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9000;
    display: none;
}

.playlist-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.playlist-modal .modal-overlay {
    background: rgba(0, 0, 0, 0.85);
}

.playlist-modal-content {
    background: var(--bg);
    border: 3px solid #1db954;
    padding: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 0 30px rgba(29, 185, 84, 0.5);
    position: relative;
    z-index: 9001;
}

.playlist-modal-title {
    font-size: 12px;
    color: #1db954;
    margin-bottom: 20px;
    text-align: center;
}

.playlist-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.playlist-item {
    background: linear-gradient(135deg, var(--panel) 0%, #1a0033 100%);
    border: 2px solid #1db954;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.playlist-item:hover {
    background: #1db954;
    color: var(--bg);
    transform: translateX(4px);
    box-shadow: 0 0 20px rgba(29, 185, 84, 0.6);
}

.playlist-item-name {
    font-size: 8px;
    font-weight: bold;
    flex: 1;
}

.playlist-item-tracks {
    font-size: 6px;
    color: var(--muted);
}

.playlist-item:hover .playlist-item-tracks {
    color: var(--bg);
}

.playlist-modal-footer {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.playlist-cancel-btn {
    background: var(--panel);
    border: 2px solid var(--danger);
    color: var(--danger);
    padding: 8px 16px;
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: 8px;
    transition: all 0.2s ease;
}

.playlist-cancel-btn:hover {
    background: var(--danger);
    color: var(--text-bright);
}

/* ========== PLAYLIST LOADING OVERLAY ========== */
#playlist-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#playlist-loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.playlist-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.playlist-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--panel);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: playlist-spin 1s linear infinite;
}

@keyframes playlist-spin {
    to {
        transform: rotate(360deg);
    }
}

.playlist-loading-text {
    color: var(--text-bright);
    font-family: var(--font-primary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========== LYRICS MODAL (EASTER EGG) ========== */
.lyrics-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9500;
    display: none;
    background: rgba(0, 0, 0, 0.95);
}

.lyrics-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lyrics-modal-content {
    background: var(--bg);
    border: 3px solid #1db954;
    padding: 30px;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    box-shadow: 
        0 0 30px rgba(29, 185, 84, 0.6),
        inset 0 0 30px rgba(29, 185, 84, 0.1);
    position: relative;
    display: flex;
    flex-direction: column;
}

.lyrics-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: 2px solid var(--danger);
    color: var(--danger);
    padding: 8px 12px;
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: 10px;
    transition: all 0.2s ease;
    z-index: 10;
}

.lyrics-close-btn:hover {
    background: var(--danger);
    color: var(--text-bright);
    transform: scale(1.1);
}

.lyrics-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #1db954;
}

.lyrics-track-name {
    font-size: 14px;
    color: var(--text-bright);
    margin-bottom: 10px;
    line-height: 1.5;
    text-shadow: 0 0 10px rgba(29, 185, 84, 0.5);
}

.lyrics-artist-name {
    font-size: 10px;
    color: #1db954;
    letter-spacing: 2px;
}

.lyrics-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(29, 185, 84, 0.3);
}

.lyrics-loading {
    text-align: center;
    padding: 40px;
    font-size: 12px;
    color: #1db954;
}

.lyrics-content {
    font-size: 11px;
    line-height: 2;
    color: var(--text);
    font-family: var(--font-primary);
}

.lyrics-line {
    padding: 8px 12px;
    margin: 4px 0;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.lyrics-line.active {
    color: var(--text-bright);
    background: rgba(29, 185, 84, 0.2);
    border-left-color: #1db954;
    transform: translateX(8px);
    text-shadow: 0 0 8px rgba(29, 185, 84, 0.8);
    animation: glowPulse 1s ease-in-out infinite;
}

.lyrics-line.past {
    opacity: 0.4;
}

.lyrics-line.future {
    opacity: 0.6;
}

.lyrics-error {
    text-align: center;
    padding: 40px;
    font-size: 10px;
    color: var(--danger);
}

/* Loading Animation */
@keyframes spotify-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.spotify-widget.loading .spotify-track-name,
.spotify-widget.loading .spotify-artist-name {
    animation: spotify-pulse 1.5s ease-in-out infinite;
}

.grow {
    flex: 1;
}

.actions-widget {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.widget-panel button:focus {
    outline: 2px solid var(--accent);
}

@media (max-width: 980px) {
    .widget-panel {
        position: static;
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
    }
    
    .widget-panel > .clock-widget,
    .widget-panel > .actions-widget {
        position: static;
        margin: 20px 16px;
    }
    
    .widget-panel-scroll {
        flex: 1 1 100%;
        max-height: none;
        overflow-y: visible;
    }
    
    .widget-panel-scroll::before,
    .widget-panel-scroll::after {
        display: none;
    }
    
    .main {
        margin-right: 0;
        padding: 20px 8px;
    }
    .grow {
        flex-basis: 100%;
    }
    .page {
        align-items: flex-start;
    }
}

.card-grid.fading {
    opacity: 0.5;
    transform: translateY(6px);
}

.avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--panel);
    border: 3px solid var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
    color: var(--accent);
    box-shadow: 
        0 0 15px var(--glow),
        inset 0 0 15px rgba(0, 255, 255, 0.2);
    font-size: 1.4rem;
    position: relative;
    overflow: hidden;
}

.avatar.avatar-boy {
    border-color: var(--accent2);
    color: var(--accent2);
    background: linear-gradient(135deg, #001a1a 0%, #003333 100%);
}

.avatar.avatar-girl {
    border-color: var(--accent3);
    color: var(--accent3);
    background: linear-gradient(135deg, #1a001a 0%, #330033 100%);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border: 1px solid var(--accent2);
    box-shadow: 0 0 10px var(--accent2);
    border-radius: 50%;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Master Code Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20002;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    from { 
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes modalShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

@keyframes modalSuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.modal-content {
    position: relative;
    background: var(--panel);
    border: 4px solid var(--accent);
    padding: 0;
    max-width: 600px;
    width: 90%;
    box-shadow: 
        0 0 30px var(--glow),
        inset 0 0 30px rgba(0, 255, 255, 0.1),
        0 8px 0 #006666,
        0 12px 0 #003333;
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-content.shake {
    animation: modalShake 0.5s ease;
}

.modal-content.success {
    animation: modalSuccess 0.3s ease;
}

.modal-header {
    padding: 24px 30px;
    border-bottom: 3px solid var(--border);
    background: linear-gradient(180deg, rgba(0, 255, 255, 0.1) 0%, transparent 100%);
}

.modal-title {
    margin: 0;
    font-size: 1rem;
    color: var(--text-bright);
    text-shadow: 0 0 3px rgba(0, 255, 255, 0.3);
    letter-spacing: 2px;
    text-transform: uppercase;
    line-height: 1.6;
}

.modal-body {
    padding: 40px 30px;
}

.modal-input {
    width: 100%;
    padding: 18px 24px;
    font-family: var(--font-primary);
    font-size: 1.3rem;
    border: 3px solid var(--border);
    background: var(--card);
    color: var(--text-bright);
    text-align: center;
    letter-spacing: 8px;
    box-shadow: 
        0 0 15px var(--glow),
        inset 0 0 15px rgba(0, 255, 255, 0.1),
        0 4px 0 #006666;
    transition: all 0.2s ease;
}

.modal-input:focus {
    outline: none;
    border-color: var(--accent);
    animation: glowPulse 1.5s infinite;
}

.modal-error {
    margin-top: 20px;
    padding: 14px;
    font-size: 0.7rem;
    color: var(--danger);
    text-shadow: 0 0 2px rgba(255, 0, 85, 0.4);
    text-align: center;
    min-height: 45px;
    letter-spacing: 1px;
    line-height: 1.5;
}

.modal-footer {
    padding: 24px 30px;
    border-top: 3px solid var(--border);
    display: flex;
    justify-content: center;
    gap: 15px;
}

.modal-btn {
    padding: 16px 32px;
    font-size: 0.75rem;
    min-width: 160px;
}

.modal-btn:hover {
    background: var(--accent);
    color: var(--panel);
    border-color: var(--accent);
}

.modal-btn-cancel {
    background: var(--panel);
    border-color: var(--danger);
    color: var(--danger);
    text-shadow: 0 0 5px var(--danger);
    box-shadow: 
        0 0 10px rgba(255, 0, 85, 0.5),
        inset 0 0 10px rgba(255, 0, 85, 0.1),
        0 4px 0 #660022;
}

.modal-btn-cancel:hover {
    background: var(--danger);
    color: var(--text-bright);
    border-color: var(--danger);
    text-shadow: none;
    box-shadow: 
        0 0 20px rgba(255, 0, 85, 0.8),
        inset 0 0 20px rgba(255, 255, 255, 0.2),
        0 4px 0 #660022;
}

.modal-btn-cancel:active {
    box-shadow: 
        0 0 10px rgba(255, 0, 85, 0.5),
        inset 0 0 10px rgba(255, 255, 255, 0.2),
        0 2px 0 #660022;
}

#master-code-modal .modal-content {
    max-width: 520px;
    border-color: var(--border);
    background: rgba(10, 26, 26, 0.98);
    box-shadow:
        0 0 22px rgba(0, 255, 255, 0.35),
        inset 0 0 24px rgba(0, 0, 0, 0.45),
        0 8px 0 #006666,
        0 12px 0 #003333;
}

#master-code-modal .modal-header {
    padding: 22px 26px 16px;
    background: rgba(0, 0, 0, 0.2);
}

#master-code-modal .modal-title {
    font-size: 0.78rem;
    letter-spacing: 0;
    text-align: center;
}

#master-code-modal .modal-body {
    padding: 26px 26px 18px;
}

.auth-primary-block {
    padding: 16px;
    border: 3px solid var(--border);
    background: rgba(0, 0, 0, 0.26);
    box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.35);
}

.auth-input-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--accent2);
    font-family: var(--font-primary);
    font-size: 0.48rem;
    line-height: 1.5;
}

#master-code-modal .modal-input {
    padding: 18px 20px;
    border-color: var(--border);
    background: var(--bg);
    font-size: 1.05rem;
    letter-spacing: 0.25em;
    box-shadow:
        inset 0 0 12px rgba(0, 0, 0, 0.5),
        0 3px 0 #006666;
}

#master-code-modal .modal-input:focus {
    border-color: var(--accent);
    box-shadow:
        0 0 15px var(--glow),
        inset 0 0 12px rgba(0, 0, 0, 0.5),
        0 3px 0 #006666;
}

.modal-auth-actions {
    margin-top: 18px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.auth-divider {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-family: 'Nunito', sans-serif;
    font-size: 0.74rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    height: 2px;
    flex: 1;
    background: rgba(0, 255, 255, 0.18);
}

.auth-option-btn {
    min-height: 58px;
    min-width: 0;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border-color: var(--accent);
    background: rgba(0, 255, 255, 0.1);
    color: var(--text-bright);
    font-size: 0.52rem;
    line-height: 1.4;
    box-shadow:
        inset 0 0 10px rgba(0, 255, 255, 0.08),
        0 3px 0 #006666;
}

.auth-option-btn i {
    font-size: 1rem;
    color: var(--accent2);
}

.auth-option-btn.secondary {
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
}

.auth-option-btn:hover {
    background: var(--accent);
    color: var(--panel);
}

.auth-option-btn:hover i {
    color: var(--panel);
}

#master-code-modal .modal-error {
    min-height: 32px;
    margin-top: 14px;
    padding: 8px 10px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.84rem;
    letter-spacing: 0;
}

#master-code-modal .modal-footer {
    padding: 18px 26px 24px;
    gap: 12px;
}

#master-code-modal .modal-btn {
    min-width: 0;
    flex: 1;
    padding: 13px 18px;
    font-size: 0.56rem;
}

/* Alert Modal */
.alert-modal-content {
    max-width: 500px;
}

/* Confirm Modal */
.confirm-modal-content {
    max-width: 500px;
}

.confirm-modal-content #confirm-icon {
    color: var(--danger);
}

.modal-btn-danger {
    background: var(--danger) !important;
    border-color: var(--danger) !important;
    color: white !important;
}

.modal-btn-danger:hover {
    background: color-mix(in srgb, var(--danger) 80%, white 20%) !important;
}

.alert-icon {
    font-size: 2.5rem;
    color: var(--warning);
    margin-right: 15px;
    animation: pulseWarning 2s infinite;
}

@keyframes pulseWarning {
    0%, 100% {
        text-shadow: 0 0 10px rgba(255, 153, 0, 0.6);
    }
    50% {
        text-shadow: 0 0 25px rgba(255, 153, 0, 0.9);
    }
}

.alert-message {
    font-size: 0.8rem;
    color: var(--text-bright);
    line-height: 1.6;
    text-align: center;
    margin: 0;
}

/* Reminder Details Modal */
.reminder-details-modal-content {
    max-width: 600px;
}

.reminder-details-table-wrapper {
    max-height: 400px;
    overflow-y: auto;
}

.reminder-details-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.reminder-details-table thead {
    position: sticky;
    top: 0;
    background: var(--panel);
    z-index: 1;
}

.reminder-details-table th {
    padding: 12px 15px;
    text-align: left;
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
    font-family: var(--font-primary);
    font-size: 0.6rem;
    text-transform: uppercase;
}

.reminder-details-table td {
    padding: 12px 15px;
    color: var(--text-bright);
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
}

.reminder-details-table tbody tr {
    transition: background 0.2s ease;
}

.reminder-details-table tbody tr:hover {
    background: rgba(0, 255, 255, 0.1);
}

.reminder-details-table tbody tr:last-child td {
    border-bottom: none;
}

/* Button hover effects */
.wa-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 0 15px var(--glow),
        inset 0 0 15px rgba(0, 255, 255, 0.2),
        0 6px 0 #006666;
}

.wa-btn.warning {
    border-color: var(--warning);
    color: var(--warning);
    text-shadow: 0 0 5px var(--warning);
    box-shadow: 
        0 0 10px rgba(255, 153, 0, 0.5),
        inset 0 0 10px rgba(255, 153, 0, 0.1),
        0 4px 0 #663300;
}

.wa-btn.warning:hover {
    background: var(--warning);
    color: var(--panel);
    text-shadow: none;
    box-shadow: 
        0 0 20px rgba(255, 153, 0, 0.8),
        inset 0 0 20px rgba(255, 255, 255, 0.2),
        0 4px 0 #663300;
}

.wa-btn.warning:active {
    box-shadow: 
        0 0 10px rgba(255, 153, 0, 0.5),
        inset 0 0 10px rgba(255, 255, 255, 0.2),
        0 2px 0 #663300;
}

#admin-btn:hover {
    background: var(--accent2);
    color: var(--panel);
    border-color: var(--accent2);
    text-shadow: none;
    box-shadow: 
        0 0 20px rgba(255, 0, 255, 0.8),
        inset 0 0 20px rgba(255, 255, 255, 0.2),
        0 4px 0 #660066;
}

body.locked {
    pointer-events: none;
}

body.locked .modal,
body.locked .member-detail-modal,
body.locked .webcam-modal,
body.locked .master-code-modal {
    pointer-events: all;
}


/* ========== SPOTIFY SETTINGS MODAL ========== */
.spotify-settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.spotify-settings-modal.active {
    display: flex;
}

.spotify-settings-content {
    background: var(--panel);
    border: 3px solid var(--accent3);
    border-radius: 2px;
    padding: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 
        0 0 30px rgba(29, 185, 84, 0.5),
        inset 0 0 20px rgba(0, 0, 0, 0.3);
    animation: glitchIn 0.3s ease-out;
    position: relative;
    z-index: 10;
}

.spotify-settings-title {
    font-family: var(--font-primary);
    font-size: 14px;
    color: var(--accent3);
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(29, 185, 84, 0.5);
}

.spotify-settings-title i {
    margin-right: 10px;
}

.spotify-settings-section {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--accent);
    border-radius: 2px;
}

.spotify-settings-subtitle {
    font-family: var(--font-primary);
    font-size: 10px;
    color: var(--accent);
    margin-bottom: 15px;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.3);
}

.spotify-settings-status {
    font-family: var(--font-primary);
    font-size: 9px;
    color: var(--text-bright);
    padding: 10px;
    margin-bottom: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    text-align: center;
}

.spotify-settings-status.connected {
    color: var(--accent3);
    border-color: var(--accent3);
}

.spotify-settings-status.disconnected {
    color: var(--danger);
    border-color: var(--danger);
}

.spotify-settings-connection {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.spotify-settings-btn {
    font-family: var(--font-primary);
    font-size: 9px;
    padding: 10px 15px;
    background: var(--accent3);
    color: var(--panel);
    border: 2px solid var(--accent3);
    cursor: pointer;
    transition: all 0.2s ease;
    text-shadow: none;
}

.spotify-settings-btn:hover {
    background: transparent;
    color: var(--accent3);
    box-shadow: 0 0 10px rgba(29, 185, 84, 0.5);
}

.spotify-settings-btn.danger {
    background: var(--danger);
    border-color: var(--danger);
}

.spotify-settings-btn.danger:hover {
    background: transparent;
    color: var(--danger);
    box-shadow: 0 0 10px rgba(255, 0, 85, 0.5);
}

.spotify-settings-option {
    margin-bottom: 15px;
}

.spotify-settings-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-primary);
    font-size: 9px;
    color: var(--text-bright);
    cursor: pointer;
}

.spotify-settings-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    appearance: none;
    border: 2px solid var(--accent);
    background: rgba(0, 0, 0, 0.3);
    position: relative;
}

.spotify-settings-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--accent3);
    font-size: 14px;
    font-weight: bold;
}

.spotify-settings-help {
    font-family: 'Nunito', sans-serif;
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 8px;
    line-height: 1.4;
    padding-left: 30px;
}

.spotify-settings-footer {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

/* Member Detail Modal */
.member-detail-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    align-items: center;
    justify-content: center;
}

.member-detail-modal.active {
    display: flex;
}

.member-detail-content {
    background: linear-gradient(135deg, #001a1a 0%, #002626 100%);
    border: 3px solid var(--accent);
    border-radius: 8px;
    padding: 0;
    max-width: 950px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 1;
    box-shadow: 
        0 0 60px rgba(0, 255, 255, 0.3),
        inset 0 0 40px rgba(0, 255, 255, 0.03);
}

.member-detail-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid var(--danger);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--danger);
    font-size: 1.4rem;
    cursor: pointer;
    filter: drop-shadow(0 0 5px var(--danger));
    transition: all 0.2s ease;
    z-index: 100;
}

.member-detail-close:hover {
    transform: scale(1.15) rotate(90deg);
    background: var(--danger);
    color: #000;
    filter: drop-shadow(0 0 15px var(--danger));
}

.member-detail-header {
    display: flex;
    gap: 28px;
    padding: 32px 32px 28px;
    background: linear-gradient(to bottom, rgba(0, 255, 255, 0.05) 0%, transparent 100%);
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
    margin-bottom: 0;
    margin-right: 0;
    position: relative;
}

.member-detail-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.member-detail-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 4px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: var(--accent);
    background: linear-gradient(135deg, rgba(0, 26, 26, 0.8) 0%, rgba(0, 51, 51, 0.6) 100%);
    box-shadow: 
        0 0 30px rgba(0, 255, 255, 0.4),
        inset 0 0 30px rgba(0, 255, 255, 0.1);
    overflow: hidden;
    position: relative;
}

.member-detail-avatar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

.member-detail-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-detail-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.member-detail-name {
    font-size: 1.1rem;
    margin-bottom: 0;
    color: var(--text-bright);
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    letter-spacing: 0.5px;
}

.member-detail-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.member-detail-meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-bright);
    font-size: 0.65rem;
    background: rgba(0, 255, 255, 0.05);
    padding: 10px 12px;
    border-radius: 4px;
    border-left: 3px solid var(--accent2);
    transition: all 0.2s ease;
    position: relative;
    min-height: 48px;
}

.member-detail-meta-item:hover {
    background: rgba(0, 255, 255, 0.1);
    border-left-color: var(--accent);
}

.member-detail-meta-item i {
    color: var(--accent2);
    min-width: 18px;
    font-size: 0.85rem;
}

.meta-action-icon {
    background: transparent;
    border: 2px solid #ff8c00;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff8c00;
    cursor: pointer;
    transition: all 0.2s ease;
    animation: pulseOrange 2s infinite;
}

@keyframes pulseOrange {
    0%, 100% {
        box-shadow: 0 0 8px rgba(255, 140, 0, 0.6);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 140, 0, 0.9);
    }
}

.meta-action-icon:hover {
    transform: scale(1.2);
    background: #ff8c00;
    color: #000;
    animation: none;
    box-shadow: 0 0 25px rgba(255, 140, 0, 1);
}

.meta-action-icon i {
    color: inherit;
    font-size: 0.7rem;
    min-width: auto;
}

#reminder-info-icon {
    border-color: var(--accent2);
    color: var(--accent2);
    animation: none;
    box-shadow: none;
}

#reminder-info-icon:hover {
    background: var(--accent2);
    color: #000;
    box-shadow: 0 0 25px rgba(0, 255, 255, 1);
}

.meta-icons-group {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

#extend-validity-icon,
#clear-reminders-icon {
    margin-left: auto;
}

.meta-info-icon {
    margin-left: 8px;
    background: transparent;
    border: 2px solid var(--accent2);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent2);
    cursor: pointer;
    transition: all 0.2s ease;
}

.meta-info-icon:hover {
    transform: scale(1.15);
    background: var(--accent2);
    color: #000;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.6);
}

.meta-info-icon i {
    color: inherit;
    font-size: 0.65rem;
    min-width: auto;
}

.member-detail-age {
    color: var(--accent3);
}

.member-detail-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 220px;
}

.wa-btn-action {
    padding: 14px 18px;
    border: 2px solid var(--accent2);
    background: linear-gradient(135deg, rgba(255, 105, 180, 0.1) 0%, rgba(255, 105, 180, 0.05) 100%);
    color: var(--text-bright);
    cursor: pointer;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    border-radius: 4px;
    box-shadow: 0 0 15px rgba(255, 105, 180, 0.2);
    font-weight: bold;
    letter-spacing: 0.3px;
}

.wa-btn-action:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(255, 105, 180, 0.2) 0%, rgba(255, 105, 180, 0.1) 100%);
    box-shadow: 0 0 25px rgba(255, 105, 180, 0.4);
    border-color: var(--accent3);
}

.wa-btn-action i {
    font-size: 0.9rem;
}

.wa-btn-small {
    padding: 10px 14px;
    border: 2px solid var(--accent);
    background: rgba(0, 0, 0, 0.4);
    color: var(--text-bright);
    cursor: pointer;
    font-size: 0.55rem;
    transition: all 0.2s ease;
    border-radius: 4px;
    font-weight: bold;
}

.wa-btn-small:hover {
    background: var(--accent);
    color: #000;
    transform: translateY(-1px);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.member-detail-body {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 28px 32px 32px;
}

.member-detail-section-title {
    font-size: 0.85rem;
    color: var(--text-bright);
    margin-bottom: 16px;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-bottom: 2px solid rgba(0, 255, 255, 0.3);
    padding-bottom: 10px;
}

.member-loans-count {
    color: var(--accent3);
    font-size: 0.7rem;
    font-weight: normal;
    text-transform: none;
}

.member-detail-search-wrapper {
    position: relative;
}

.member-detail-search-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid rgba(0, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.4);
    color: var(--text-bright);
    font-size: 0.75rem;
    outline: none;
    cursor: text;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.member-detail-search-input:focus {
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.member-item-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(0, 20, 20, 0.95);
    border: 2px solid var(--accent);
    border-radius: 0 0 6px 6px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.member-item-suggestions.active {
    display: block;
}

.member-item-suggestion {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.65rem;
}

.member-item-suggestion:last-child {
    border-bottom: none;
}

.member-item-suggestion:hover,
.member-item-suggestion.active {
    background: rgba(0, 255, 255, 0.15);
    padding-left: 20px;
}

/* ========== COMBO SUGGESTION STYLING ========== */
.member-item-suggestion.combo-suggestion {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 12px 16px;
    background: rgba(88, 101, 242, 0.08);
    border-left: 3px solid var(--accent, #5865f2);
}

.member-item-suggestion.combo-suggestion:hover,
.member-item-suggestion.combo-suggestion.active {
    background: rgba(88, 101, 242, 0.2);
    padding-left: 20px;
}

.combo-suggestion-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.combo-icon {
    color: var(--accent, #5865f2);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.combo-name {
    flex: 1;
    font-weight: 600;
    font-size: 1rem;
}

.combo-count {
    font-size: 0.75rem;
    color: var(--text-muted, #949ba4);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
}

.combo-items-preview {
    font-size: 0.8rem;
    color: var(--text-muted, #949ba4);
    padding-left: 26px;
    line-height: 1.4;
    opacity: 0.7;
}

.member-loan-error {
    margin-top: 12px;
    padding: 12px;
    background: rgba(255, 0, 0, 0.2);
    border: 2px solid var(--danger);
    color: var(--danger);
    font-size: 0.6rem;
    text-shadow: 0 0 5px var(--danger);
}

.member-loans-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.member-loans-loading {
    text-align: center;
    padding: 24px;
    color: var(--muted);
    font-size: 0.6rem;
}

.member-loan-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border: 2px solid rgba(0, 255, 255, 0.2);
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.03) 0%, rgba(0, 0, 0, 0.3) 100%);
    transition: all 0.2s ease;
    outline: none;
    cursor: pointer;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

.member-loan-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent2);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.member-loan-item:hover::before,
.member-loan-item:focus::before {
    opacity: 1;
}

.member-loan-item:hover,
.member-loan-item:focus {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.08) 0%, rgba(0, 0, 0, 0.5) 100%);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
    transform: translateX(4px);
}

.member-loan-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.member-loan-icon {
    color: var(--accent2);
    font-size: 1.1rem;
}

.member-loan-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.member-loan-name {
    color: var(--text-bright);
    font-size: 0.7rem;
    font-weight: bold;
}

.member-loan-category {
    color: var(--muted);
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.member-loan-remove {
    background: transparent;
    border: none;
    color: var(--danger);
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 6px;
    border-radius: 50%;
}

.member-loan-remove:hover {
    transform: scale(1.3) rotate(90deg);
    filter: drop-shadow(0 0 8px var(--danger));
    background: rgba(255, 0, 0, 0.1);
}

/* Webcam Modal */
.webcam-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10002;
    align-items: center;
    justify-content: center;
}

.webcam-modal .modal-overlay {
    z-index: 1;
}

.webcam-modal.active {
    display: flex;
}

.webcam-content {
    position: relative;
    background: var(--panel);
    border: 4px solid var(--accent);
    padding: 24px;
    max-width: 640px;
    box-shadow: 0 0 40px var(--glow);
    z-index: 2;
}

.webcam-title {
    font-size: 0.9rem;
    margin-bottom: 20px;
    text-align: center;
    color: var(--text-bright);
    text-shadow: 0 0 10px var(--accent);
}

.webcam-video {
    display: block;
    width: 100%;
    max-width: 640px;
    height: auto;
    transform: scaleX(-1); /* Mirror by default for front camera */
    transition: transform 0.3s ease;
}

.webcam-video.rear-camera {
    transform: scaleX(1); /* No mirror for rear camera */
}

.webcam-canvas {
    display: block;
    width: 100%;
    max-width: 640px;
    height: auto;
}

.webcam-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Camera flip button */
.webcam-flip-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 20;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid var(--accent);
    color: var(--accent);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.2rem;
}

.webcam-flip-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 15px var(--glow);
    transform: scale(1.1);
}

.webcam-flip-btn:active {
    transform: scale(0.95);
}

.webcam-flip-btn i {
    color: var(--accent);
}

/* Webcam crop guide overlay */
.webcam-crop-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    border: 2px dashed var(--accent);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.webcam-preview {
    position: relative;
    margin-bottom: 20px;
    border: 3px solid var(--border);
    overflow: hidden;
}

.webcam-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--panel);
    border: 3px solid var(--danger);
    padding: 20px;
    text-align: center;
    color: var(--danger);
    max-width: 80%;
    box-shadow: 0 0 20px rgba(255, 0, 85, 0.5);
    z-index: 11;
}

/* Master Code Modal */
.master-code-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10010;
    align-items: center;
    justify-content: center;
}

.master-code-modal .modal-overlay {
    z-index: 1;
}

.master-code-modal.active {
    display: flex;
}

.master-code-content {
    position: relative;
    background: var(--panel);
    border: 4px solid var(--accent2);
    padding: 24px;
    min-width: 400px;
    box-shadow: 0 0 40px var(--glow);
    z-index: 2;
}

.master-code-title {
    font-size: 0.9rem;
    margin-bottom: 12px;
    text-align: center;
    color: var(--text-bright);
    text-shadow: 0 0 10px var(--accent2);
}

.master-code-message {
    margin-bottom: 16px;
    text-align: center;
    color: var(--text);
    font-size: 0.85rem;
}

.master-code-input {
    width: 100%;
    padding: 12px;
    background: var(--bg);
    border: 2px solid var(--border);
    color: var(--text-bright);
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    text-align: center;
    margin-bottom: 16px;
    transition: all 0.2s;
}

.master-code-input:focus {
    outline: none;
    border-color: var(--accent2);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.master-code-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Button variants */
.wa-btn-danger {
    background: var(--danger);
    border-color: var(--danger);
}

.wa-btn-danger:hover:not(:disabled) {
    background: #cc0056;
    box-shadow: 0 0 15px rgba(255, 0, 85, 0.6);
}

.wa-btn-success {
    background: var(--success);
    border-color: var(--success);
}

.wa-btn-success:hover:not(:disabled) {
    background: #00cc44;
    box-shadow: 0 0 15px rgba(0, 255, 85, 0.6);
}

/* ========================================
   MOBILE OPTIMIZATION
   ======================================== */

/* Tablet and Mobile - General Layout */
@media (max-width: 768px) {
    /* Prevent zoom on input focus */
    input, select, textarea {
        font-size: 16px !important;
    }
    
    /* Hide desktop-only widgets */
    .clock-widget,
    .spotify-widget,
    #lock-btn,
    #admin-btn {
        display: none !important;
    }
    
    /* Make widget panel horizontal/inline */
    .widget-panel {
        position: static;
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 12px;
        gap: 12px;
        border-left: none;
        border-bottom: 4px solid var(--border);
    }
    
    .widget-panel > .clock-widget,
    .widget-panel > .actions-widget {
        position: static;
        margin: 0;
    }
    
    .widget-panel-scroll {
        flex: 1 1 100%;
        max-height: none;
        overflow-y: visible;
        padding: 0;
    }
    
    .widget-panel-scroll::before,
    .widget-panel-scroll::after {
        display: none;
    }
    
    /* Birthdays - make horizontal on mobile */
    .birthdays-widget {
        flex: 1 1 100%;
        margin: 0;
    }
    
    .birthdays-list {
        flex-direction: row;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 4px;
    }
    
    .birthday-pill {
        flex-shrink: 0;
        min-width: 150px;
        font-size: 0.7rem;
    }
    
    /* Return all button - full width, prominent */
    .actions-widget {
        flex: 1 1 100%;
        margin: 0;
        padding: 12px;
        display: flex;
        justify-content: center;
    }
    
    .actions-widget #return-all-btn {
        width: 100%;
        max-width: 300px;
        height: 56px;
        font-size: 0.9rem;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }
    
    .actions-widget #return-all-btn::after {
        content: 'Vrátiť všetko';
        letter-spacing: 1px;
    }
    
    /* Main content area */
    .main {
        margin-right: 0;
        padding: 12px;
    }
    
    .page {
        flex-direction: column;
    }
    
    /* Logo - smaller on mobile to prevent overflow */
    .logo-block {
        margin-bottom: 30px;
    }
    
    .retro-logo {
        font-size: 1.5rem !important;
        padding: 10px !important;
        text-shadow: 
            2px 2px 0 var(--accent),
            3px 3px 0 rgba(255, 0, 255, 0.2) !important;
        letter-spacing: 2px !important;
        word-break: break-word;
    }
    
    /* Search section */
    .search-block {
        padding: 16px;
    }
    
    #member-search {
        font-size: 16px;
        padding: 14px 16px;
        height: 52px;
    }
    
    .search-suggestions {
        max-height: 60vh;
    }
    
    .suggestion-item {
        padding: 14px 16px;
        font-size: 0.75rem;
    }
    
    /* Grid section */
    .grid-block {
        padding: 16px;
    }
    
    .grid-title {
        font-size: 0.7rem;
        margin-bottom: 12px;
    }
    
    /* Member cards - single column, larger */
    .card-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .member-card {
        padding: 16px;
        font-size: 0.75rem;
    }
    
    .member-card-header {
        gap: 12px;
    }
    
    .avatar {
        width: 60px;
        height: 60px;
    }
    
    .member-card-name {
        font-size: 0.85rem;
    }
    
    .member-card-id {
        font-size: 0.65rem;
    }
    
    .member-card-loans {
        gap: 8px;
    }
    
    .loan-pill {
        font-size: 0.65rem;
        padding: 8px 12px;
    }
    
    /* Member Detail Modal - Full screen on mobile */
    .member-detail-modal .modal-content {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        border: none;
        border-radius: 0;
        margin: 0;
    }
    
    .member-detail-modal .modal-body {
        max-height: calc(100vh - 120px);
        padding: 16px;
    }
    
    .member-detail-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 16px;
    }
    
    .member-detail-avatar {
        width: 100px;
        height: 100px;
    }
    
    .member-detail-info {
        align-items: center;
    }
    
    .member-detail-name {
        font-size: 1rem;
    }
    
    .member-detail-meta {
        font-size: 0.65rem;
        flex-direction: column;
        gap: 4px;
    }
    
    /* Make meta boxes single column and narrower */
    .member-detail-meta {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .member-detail-meta-item {
        font-size: 0.65rem;
        padding: 10px;
        min-height: auto;
    }
    
    /* Actions in modal - stack vertically */
    .member-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .member-actions .action-btn {
        width: 100%;
        justify-content: center;
        padding: 12px;
        font-size: 0.7rem;
    }
    
    /* Loan management in modal */
    .add-loan-form {
        flex-direction: column;
        gap: 10px;
    }
    
    .add-loan-form input {
        width: 100%;
        font-size: 16px;
        padding: 12px;
    }
    
    .add-loan-form button {
        width: 100%;
        padding: 12px;
        font-size: 0.75rem;
    }
    
    .loans-list {
        gap: 10px;
    }
    
    .loan-item {
        font-size: 0.7rem;
        padding: 12px;
    }
    
    .loan-item-btn {
        padding: 8px 12px;
        font-size: 0.65rem;
    }
    
    /* Webcam Modal - Full screen */
    .webcam-modal .webcam-content {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        border: none;
        border-radius: 0;
        padding: 16px;
        display: flex;
        flex-direction: column;
    }
    
    .webcam-title {
        font-size: 0.8rem;
        margin-bottom: 16px;
        flex-shrink: 0;
    }
    
    .webcam-preview {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        min-height: 0;
        margin-bottom: 16px;
    }
    
    #webcam-video,
    #webcam-canvas {
        max-width: 100%;
        max-height: 100%;
        width: auto;
        height: auto;
        object-fit: contain;
    }
    
    #webcam-crop-guide {
        position: absolute;
        border: 3px solid var(--accent);
        box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
        pointer-events: none;
    }
    
    #webcam-error {
        flex-shrink: 0;
        margin-bottom: 12px;
        position: static;
        transform: none;
        max-width: 100%;
        font-size: 0.7rem;
        line-height: 1.6;
        white-space: pre-line;
    }
    
    .webcam-actions {
        flex-direction: column;
        gap: 10px;
        flex-shrink: 0;
    }
    
    .webcam-actions button {
        width: 100%;
        padding: 14px;
        font-size: 0.75rem;
    }
    
    /* Flip button - better positioning on mobile */
    .webcam-flip-btn {
        top: 12px;
        right: 12px;
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }
    
    /* Master Code Modal */
    .master-code-content {
        width: 90vw;
        max-width: 90vw;
        min-width: 0;
        padding: 20px;
    }
    
    .master-code-title {
        font-size: 0.8rem;
    }
    
    .master-code-input {
        font-size: 18px;
        padding: 14px;
    }
    
    .master-code-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .master-code-actions button {
        width: 100%;
        padding: 12px;
    }
    
    /* Playlist Modal */
    #playlist-modal .modal-content {
        width: 95vw;
        max-width: 95vw;
        max-height: 90vh;
    }
    
    .playlist-list {
        max-height: 60vh;
    }
    
    .playlist-item {
        padding: 14px;
        font-size: 0.7rem;
    }
}

/* Small phones - even more optimized */
@media (max-width: 480px) {
    body {
        font-size: 13px;
    }
    
    .widget-title {
        font-size: 0.55rem;
    }
    
    .member-card {
        padding: 12px;
    }
    
    .avatar {
        width: 50px;
        height: 50px;
    }
    
    .member-card-name {
        font-size: 0.75rem;
    }
    
    .loan-pill {
        font-size: 0.6rem;
        padding: 6px 10px;
    }
    
    .member-detail-avatar {
        width: 80px;
        height: 80px;
    }
    
    .action-btn i {
        font-size: 0.8rem;
    }
}

/* Landscape mode on mobile - optimize vertical space */
@media (max-width: 768px) and (orientation: landscape) {
    .member-detail-modal .modal-body {
        max-height: calc(100vh - 80px);
    }
    
    .member-detail-header {
        flex-direction: row;
        justify-content: flex-start;
    }
    
    .member-detail-avatar {
        width: 70px;
        height: 70px;
    }
    
    #webcam-video {
        max-height: 60vh;
    }
}

/* Touch device enhancements */
@media (hover: none) and (pointer: coarse) {
    /* Better touch targets */
    button, .member-card, .suggestion-item, .loan-item {
        min-height: 44px;
    }
    
    /* Remove hover effects, add active states */
    .member-card:hover {
        transform: none;
        box-shadow: 0 0 15px var(--glow), inset 0 0 15px rgba(0, 255, 255, 0.1), 0 4px 0 #006666;
    }
    
    .member-card:active {
        transform: scale(0.98);
        box-shadow: 0 0 20px var(--accent), inset 0 0 20px rgba(0, 255, 255, 0.2);
    }
    
    button:hover {
        transform: none;
    }
    
    button:active {
        transform: scale(0.95);
    }
    
    .suggestion-item:hover {
        background: var(--panel);
    }
    
    .suggestion-item:active {
        background: rgba(0, 255, 255, 0.2);
    }
}

/* ========== ADMIN MODAL ========== */
.admin-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.admin-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-modal-content {
    position: relative;
    background: 
        linear-gradient(180deg, rgba(255, 0, 255, 0.03) 0%, transparent 50%, rgba(0, 255, 255, 0.03) 100%),
        var(--panel);
    border: 4px solid var(--border);
    box-shadow: 
        0 0 30px var(--glow),
        inset 0 0 60px rgba(0, 0, 0, 0.5),
        0 8px 0 #006666;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    z-index: 10001;
    overflow: hidden;
}

.admin-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--panel);
    border: 3px solid var(--border);
    color: var(--text);
    width: 44px;
    height: 44px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.1s;
    z-index: 10;
    box-shadow: 0 0 10px var(--glow), 0 3px 0 #006666;
}

.admin-modal-close:hover {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}

.admin-modal-close:active {
    transform: translateY(2px);
    box-shadow: 0 0 10px var(--glow), 0 1px 0 #006666;
}

.admin-modal-title {
    font-family: var(--font-primary);
    font-size: 0.9rem;
    color: var(--accent);
    text-align: center;
    padding: 20px;
    margin: 0;
    border-bottom: 3px solid var(--border);
    background: rgba(0, 0, 0, 0.3);
}

.admin-modal-title i {
    margin-right: 12px;
    color: var(--accent2);
}

/* Admin Tabs - 8-bit style */
.admin-tabs {
    display: flex;
    border-bottom: 3px solid var(--border);
    padding: 0;
    gap: 0;
    background: rgba(0, 0, 0, 0.4);
    overflow-x: auto;
    flex-shrink: 0; /* Prevent tabs from shrinking */
}

.admin-tab {
    flex: 1;
    min-width: 100px;
    min-height: 70px; /* Minimum height for tabs */
    background: transparent;
    border: none;
    border-right: 2px solid var(--border);
    border-bottom: 4px solid transparent;
    color: var(--muted);
    padding: 14px 12px;
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: 0.5rem;
    transition: all 0.1s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-shrink: 0; /* Prevent individual tabs from shrinking */
}

.admin-tab:last-child {
    border-right: none;
}

.admin-tab i {
    font-size: 1.2rem;
}

.admin-tab:hover {
    background: rgba(0, 255, 255, 0.1);
    color: var(--text);
}

.admin-tab.active {
    background: rgba(0, 255, 255, 0.15);
    border-bottom-color: var(--accent);
    color: var(--accent);
}

/* Admin Tab Content */
.admin-tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.admin-tab-content.active {
    display: block;
}

/* Admin Sections - 8-bit box style */
.admin-section {
    background: rgba(0, 0, 0, 0.3);
    border: 3px solid var(--border);
    padding: 18px 20px;
    margin-bottom: 20px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.admin-section:last-child {
    margin-bottom: 0;
}

.admin-section-title {
    font-family: var(--font-primary);
    font-size: 0.6rem;
    color: var(--accent2);
    margin: 0 0 18px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.6;
}

.admin-section-title i {
    color: var(--accent);
    font-size: 1rem;
}

/* Security tab */
.security-hero {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    align-items: center;
    padding: 18px 20px;
    margin-bottom: 20px;
    border: 3px solid var(--border);
    background: rgba(0, 0, 0, 0.3);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.security-hero-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: 3px solid var(--border);
    background: var(--bg);
    color: var(--accent);
    font-size: 1.2rem;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5), 0 3px 0 #006666;
}

.security-hero h3,
.security-card h4,
.passkey-invite-copy h5 {
    margin: 0;
    font-family: var(--font-primary);
    color: var(--text-bright);
    line-height: 1.4;
}

.security-hero h3 {
    font-size: 0.6rem;
    color: var(--accent2);
}

.security-hero p,
.security-card p,
.passkey-invite-copy p,
.security-toggle small {
    margin: 8px 0 0;
    font-family: 'Nunito', sans-serif;
    color: var(--muted);
    line-height: 1.5;
}

.security-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.security-card {
    border: 3px solid var(--border);
    background: rgba(0, 0, 0, 0.3);
    padding: 18px 20px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.security-card-wide {
    grid-column: 1 / -1;
}

.security-card-header {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

.security-card-header.compact {
    align-items: center;
}

.security-card-header > i {
    width: auto;
    height: auto;
    display: inline-block;
    border: none;
    color: var(--accent);
    background: transparent;
    font-size: 1rem;
    flex: 0 0 auto;
}

.security-card h4 {
    font-size: 0.6rem;
    color: var(--accent2);
}

.security-toggle,
.security-toggle-row {
    display: flex;
    gap: 14px;
}

.security-toggle {
    align-items: flex-start;
    padding: 8px 0;
    margin-top: 12px;
    border: none;
    background: transparent;
    cursor: pointer;
}

.security-toggle strong {
    display: block;
    font-family: var(--font-primary);
    color: var(--text);
    font-size: 0.5rem;
    line-height: 1.6;
}

.security-toggle small {
    display: block;
    font-size: 0.72rem;
}

.security-toggle-row .security-toggle {
    flex: 1;
}

.security-note {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 16px;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-left: 4px solid var(--accent);
    background: rgba(255, 204, 0, 0.1);
    color: var(--text);
    font-family: 'Nunito', sans-serif;
    font-size: 0.78rem;
}

.passkey-invite-panel {
    margin-top: 18px;
    padding: 18px;
    border: 3px solid var(--border);
    background: rgba(0, 0, 0, 0.22);
    box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.25);
}

.passkey-invite-copy h5 {
    font-size: 0.55rem;
}

.passkey-invite-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    align-items: end;
    margin-top: 16px;
}

.passkey-invite-form label span {
    display: block;
    margin-bottom: 7px;
    color: var(--text);
    font-family: var(--font-primary);
    font-size: 0.5rem;
    line-height: 1.4;
}

.passkey-generate-btn {
    min-height: 51px;
    white-space: nowrap;
}

.passkey-code-result {
    display: none;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
    padding: 14px 16px;
    border: 3px solid var(--border);
    background: rgba(0, 255, 170, 0.12);
    color: var(--text-bright);
    font-family: var(--font-primary);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.35);
}

.passkey-code-result:not(:empty) {
    display: flex;
}

.passkey-code-result strong {
    letter-spacing: 0.12em;
    font-size: 1.1rem;
    color: var(--accent2);
}

.passkey-code-result small,
.passkey-code-result span {
    font-family: 'Nunito', sans-serif;
    color: var(--muted);
}

.security-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.security-list-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 2px solid rgba(0, 255, 255, 0.2);
    border-bottom-color: rgba(0, 255, 255, 0.35);
    background: rgba(0, 0, 0, 0.18);
}

.security-list-row strong {
    display: block;
    color: var(--text-bright);
    font-family: var(--font-primary);
    font-size: 0.46rem;
    line-height: 1.4;
}

.security-list-row small,
.security-empty {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-family: 'Nunito', sans-serif;
    font-size: 0.74rem;
}

.security-empty {
    margin: 0;
    padding: 18px;
    text-align: center;
    border: 2px solid rgba(0, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.18);
}

.security-pill {
    padding: 6px 9px;
    border: 2px solid currentColor;
    font-family: var(--font-primary);
    font-size: 0.38rem;
    line-height: 1;
}

.security-pill.active {
    color: var(--text);
    background: rgba(0, 255, 170, 0.12);
}

.security-pill.used {
    color: var(--accent);
    background: rgba(0, 255, 255, 0.1);
}

.security-pill.expired {
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
}

.security-icon-btn {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 2px solid var(--border);
    background: rgba(0, 0, 0, 0.35);
    color: var(--text);
    cursor: pointer;
}

.security-icon-btn:hover:not(:disabled) {
    border-color: var(--danger);
    color: var(--danger);
}

.security-icon-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Admin Form Elements - 8-bit style */
.admin-form-group {
    margin-bottom: 18px;
}

.admin-form-group:last-child {
    margin-bottom: 0;
}

.admin-form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 18px;
}

.admin-form-row .admin-form-group {
    margin-bottom: 0;
}

.admin-form-row .flex-0 {
    flex: 0 0 auto;
}

.admin-form-row .flex-1 {
    flex: 1;
}

.admin-form-row .flex-2 {
    flex: 2;
}

.admin-label {
    display: block;
    font-family: var(--font-primary);
    font-size: 0.5rem;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.4;
}

/* 8-bit Input Style */
.admin-input, .admin-select {
    width: 100%;
    background: var(--bg);
    border: 3px solid var(--border);
    padding: 12px 14px;
    color: var(--text-bright);
    font-family: var(--font-primary);
    font-size: 0.55rem;
    transition: all 0.1s;
    box-sizing: border-box;
    box-shadow: 
        inset 0 0 10px rgba(0, 0, 0, 0.5),
        0 3px 0 #006666;
}

.admin-input:focus, .admin-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 
        0 0 15px var(--glow),
        inset 0 0 10px rgba(0, 0, 0, 0.5),
        0 3px 0 #006666;
}

.admin-input::placeholder {
    color: var(--muted);
    opacity: 0.6;
}

.admin-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2300ffff' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.admin-select option {
    background: var(--panel);
    color: var(--text);
    padding: 10px;
}

.admin-input-small {
    width: 200px;
    background: var(--bg);
    border: 3px solid var(--border);
    padding: 8px 12px;
    color: var(--text-bright);
    font-family: var(--font-primary);
    font-size: 0.5rem;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.admin-input-small:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--glow), inset 0 0 10px rgba(0, 0, 0, 0.5);
}

/* 8-bit Checkbox */
.admin-checkbox-label {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: 0.5rem;
    color: var(--text);
    line-height: 1.6;
    padding: 8px 0;
}

.admin-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    min-width: 24px;
    background: var(--bg);
    border: 3px solid var(--border);
    cursor: pointer;
    position: relative;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.5), 0 2px 0 #006666;
    transition: all 0.1s;
}

.admin-checkbox:checked {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--glow), 0 2px 0 #006666;
}

.admin-checkbox:checked::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 7px;
    width: 6px;
    height: 12px;
    border: solid var(--bg);
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

.admin-checkbox:hover {
    border-color: var(--accent);
}

.admin-help-text {
    font-family: 'Nunito', sans-serif;
    font-size: 0.7rem;
    color: var(--muted);
    margin-top: 8px;
    padding-left: 38px;
    line-height: 1.5;
}

.admin-search-inline {
    margin-left: auto;
}

/* Admin Actions */
.admin-actions {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Admin Messages - 8-bit style */
.admin-error {
    background: rgba(255, 0, 85, 0.15);
    border: 3px solid var(--danger);
    padding: 12px 16px;
    color: var(--danger);
    font-family: var(--font-primary);
    font-size: 0.5rem;
    margin-top: 12px;
    line-height: 1.6;
}

.admin-success {
    background: rgba(0, 255, 170, 0.15);
    border: 3px solid var(--text);
    padding: 12px 16px;
    color: var(--text);
    font-family: var(--font-primary);
    font-size: 0.5rem;
    margin-top: 12px;
    line-height: 1.6;
}

.admin-loading {
    text-align: center;
    padding: 25px;
    color: var(--muted);
    font-family: var(--font-primary);
    font-size: 0.5rem;
}

.admin-hint {
    text-align: center;
    padding: 25px;
    color: var(--muted);
    font-family: var(--font-primary);
    font-size: 0.5rem;
    line-height: 1.8;
}

/* Admin Items List */
.admin-items-list {
    max-height: 300px;
    overflow-y: auto;
}

.admin-item-row {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 2px solid rgba(0, 255, 255, 0.2);
    gap: 15px;
    transition: background 0.1s;
}

.admin-item-row:hover {
    background: rgba(0, 255, 255, 0.05);
}

.admin-item-row:last-child {
    border-bottom: none;
}

.admin-item-name {
    flex: 2;
    font-family: var(--font-primary);
    font-size: 0.5rem;
    color: var(--text-bright);
    line-height: 1.4;
}

.admin-item-category {
    flex: 1;
    font-family: var(--font-primary);
    font-size: 0.4rem;
    color: var(--accent);
    background: rgba(0, 255, 255, 0.15);
    border: 2px solid var(--accent);
    padding: 6px 10px;
    text-align: center;
}

.admin-item-status {
    font-family: var(--font-primary);
    font-size: 0.4rem;
    padding: 6px 10px;
    border: 2px solid;
}

.admin-item-status.active {
    background: rgba(0, 255, 170, 0.15);
    border-color: var(--text);
    color: var(--text);
}

.admin-item-status.inactive {
    background: rgba(255, 0, 85, 0.15);
    border-color: var(--danger);
    color: var(--danger);
}

.admin-item-actions {
    display: flex;
    gap: 6px;
}

.admin-item-btn {
    background: var(--panel);
    border: 3px solid var(--border);
    color: var(--text);
    width: 34px;
    height: 34px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.1s;
    box-shadow: 0 2px 0 #006666;
}

.admin-item-btn:hover {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}

.admin-item-btn:active {
    transform: translateY(2px);
    box-shadow: none;
}

.admin-item-btn.danger:hover {
    background: var(--danger);
    border-color: var(--danger);
}

/* ========== ADMIN COMBOS - Discord Style ========== */
.admin-section-desc {
    font-family: var(--font-primary);
    font-size: 0.875rem;
    color: var(--text-muted, #949ba4);
    margin-bottom: 20px;
    line-height: 1.5;
    font-weight: 400;
}

.admin-combos-list {
    margin-top: 16px;
    border-radius: 8px;
    background: var(--card, #2b2d31);
    overflow: hidden;
}

.admin-combos-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted, #949ba4);
}

.admin-combos-empty i {
    display: block;
    font-size: 2.5rem;
    margin-bottom: 16px;
    opacity: 0.4;
}

.admin-combos-empty span {
    font-size: 0.9rem;
    line-height: 1.6;
}

.admin-combo-row {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
    transition: background 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-combo-row:last-child {
    border-bottom: none;
}

.admin-combo-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.admin-combo-row.oversized {
    opacity: 0.7;
    border-left: 3px solid var(--danger, #ed4245);
}

.admin-combo-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--accent, #5865f2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
}

.admin-combo-name {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-bright, #fff);
}

.admin-combo-count {
    font-size: 0.875rem;
    color: var(--text-muted, #949ba4);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
}

.admin-combo-count i {
    font-size: 0.75rem;
}

.combo-warning-badge {
    color: var(--danger, #ed4245);
    margin-left: 8px;
}

.admin-combo-actions {
    display: flex;
    gap: 8px;
}

.admin-combo-actions button {
    padding: 8px 16px;
    font-size: 0.8rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.15s ease;
}

.admin-combo-actions .wa-btn-small {
    background: var(--accent, #5865f2);
    color: white;
}

.admin-combo-actions .wa-btn-small:hover {
    background: #4752c4;
    transform: translateY(-1px);
}

.admin-combo-actions .wa-btn-small.danger {
    background: transparent;
    color: var(--text-muted, #949ba4);
}

.admin-combo-actions .wa-btn-small.danger:hover {
    background: var(--danger, #ed4245);
    color: white;
}

/* Combo Edit Modal - Discord Style */
.combo-edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20002;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.combo-edit-modal.active {
    opacity: 1;
    visibility: visible;
}

.combo-edit-content {
    background: var(--panel, #313338);
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: discord-modal-in 0.2s ease-out;
}

@keyframes discord-modal-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.combo-edit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.combo-edit-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-bright, #fff);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.combo-edit-header h3 i {
    color: var(--accent, #5865f2);
    font-size: 1.1rem;
}

.combo-edit-close {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: transparent;
    border: none;
    color: var(--text-muted, #949ba4);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.combo-edit-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-bright, #fff);
}

.combo-edit-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.combo-edit-name-section {
    background: var(--card, #2b2d31);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.combo-edit-name-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.combo-edit-name-row .admin-form-group {
    flex: 1;
    margin-bottom: 0;
}

.combo-edit-name-row .admin-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted, #949ba4);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.combo-edit-name-row .admin-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 1rem;
    background: var(--panel, #1e1f22);
    border: none;
    border-radius: 4px;
    color: var(--text-bright, #fff);
    transition: box-shadow 0.15s ease;
}

.combo-edit-name-row .admin-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent, #5865f2);
}

.combo-save-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    background: var(--accent, #5865f2);
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.combo-save-btn:hover {
    background: #4752c4;
}

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

.combo-save-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.combo-save-btn.saved {
    background: var(--success, #57f287);
}

.combo-warning {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(237, 66, 69, 0.1);
    border-left: 4px solid var(--danger, #ed4245);
    border-radius: 4px;
    color: var(--danger, #ed4245);
    font-size: 0.875rem;
    margin-bottom: 20px;
    line-height: 1.4;
}

.combo-warning i {
    font-size: 1rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.combo-edit-section {
    margin-bottom: 20px;
}

.combo-edit-section:last-child {
    margin-bottom: 0;
}

.combo-edit-section h4 {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted, #949ba4);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.combo-edit-section h4 i {
    font-size: 0.875rem;
    color: var(--accent, #5865f2);
}

.combo-items-list {
    background: var(--card, #2b2d31);
    border-radius: 8px;
    max-height: 180px;
    overflow-y: auto;
}

.combo-items-empty {
    padding: 32px 20px;
    text-align: center;
    color: var(--text-muted, #949ba4);
    font-size: 0.875rem;
}

.combo-items-empty i {
    display: block;
    font-size: 2rem;
    margin-bottom: 12px;
    opacity: 0.4;
}

.combo-item-row {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    gap: 12px;
    transition: background 0.1s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.combo-item-row:last-child {
    border-bottom: none;
}

.combo-item-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.combo-item-name {
    flex: 1;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-bright, #fff);
}

.combo-item-category {
    font-size: 0.75rem;
    color: var(--text-muted, #949ba4);
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 8px;
    border-radius: 10px;
}

.combo-item-remove {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    background: transparent;
    border: none;
    color: var(--text-muted, #949ba4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    transition: all 0.15s ease;
}

.combo-item-remove:hover {
    background: var(--danger, #ed4245);
    color: white;
}

.combo-search-wrapper {
    position: relative;
    margin-bottom: 200px; /* Space for dropdown to appear below */
}

.combo-search-wrapper .admin-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 1rem;
    background: var(--panel, #1e1f22);
    border: none;
    border-radius: 4px;
    color: var(--text-bright, #fff);
    transition: box-shadow 0.15s ease;
}

.combo-search-wrapper .admin-input::placeholder {
    color: var(--text-muted, #949ba4);
}

.combo-search-wrapper .admin-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent, #5865f2);
}

.combo-search-wrapper .suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    margin: 0;
    padding: 4px;
    background: var(--panel, #1e1f22);
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 10;
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
}

.combo-search-wrapper .suggestions .suggestion-item {
    padding: 10px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9375rem;
    color: var(--text, #dbdee1);
    transition: background 0.1s ease;
    border: none;
    min-height: auto;
}

.combo-search-wrapper .suggestions .suggestion-item::before {
    display: none;
}

.combo-search-wrapper .suggestions .suggestion-item:hover,
.combo-search-wrapper .suggestions .suggestion-item.active {
    background: var(--accent, #5865f2);
    color: white;
    padding-left: 12px;
}

/* Admin Members List */
.admin-members-list {
    max-height: 300px;
    overflow-y: auto;
}

.admin-member-row {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 2px solid rgba(0, 255, 255, 0.2);
    gap: 15px;
    transition: background 0.1s;
}

.admin-member-row:hover {
    background: rgba(0, 255, 255, 0.05);
}

.admin-member-row:last-child {
    border-bottom: none;
}

.admin-member-avatar {
    width: 40px;
    height: 40px;
    background: var(--bg);
    border: 3px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 1rem;
    overflow: hidden;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.admin-member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-member-info {
    flex: 1;
}

.admin-member-name {
    font-family: var(--font-primary);
    font-size: 0.5rem;
    color: var(--text-bright);
    line-height: 1.4;
}

.admin-member-detail {
    font-family: 'Nunito', sans-serif;
    font-size: 0.7rem;
    color: var(--muted);
    margin-top: 4px;
}

.admin-member-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-member-badge {
    font-family: var(--font-primary);
    font-size: 0.35rem;
    padding: 5px 8px;
    border: 2px solid var(--accent);
    background: rgba(0, 255, 255, 0.1);
    color: var(--accent);
}

.admin-member-badge.warning {
    background: rgba(255, 153, 0, 0.15);
    border-color: var(--warning);
    color: var(--warning);
}

.admin-member-badge.danger {
    background: rgba(255, 0, 85, 0.15);
    border-color: var(--danger);
    color: var(--danger);
}

/* Admin Stats - 8-bit cards */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.admin-stat-card {
    background: rgba(0, 0, 0, 0.4);
    border: 3px solid var(--border);
    padding: 20px 15px;
    text-align: center;
    transition: all 0.1s;
    box-shadow: 0 4px 0 #006666;
}

.admin-stat-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 0 20px var(--glow), 0 6px 0 #006666;
}

.admin-stat-icon {
    font-size: 1.8rem;
    color: var(--accent);
    margin-bottom: 12px;
}

.admin-stat-value {
    font-family: var(--font-primary);
    font-size: 1.3rem;
    color: var(--text-bright);
    margin-bottom: 8px;
}

.admin-stat-label {
    font-family: var(--font-primary);
    font-size: 0.4rem;
    color: var(--muted);
    line-height: 1.6;
}

/* Admin Top List */
.admin-top-list {
    max-height: 250px;
    overflow-y: auto;
}

.admin-top-item {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 2px solid rgba(0, 255, 255, 0.2);
    gap: 14px;
    transition: background 0.1s;
}

.admin-top-item:hover {
    background: rgba(0, 255, 255, 0.05);
}

.admin-top-item:last-child {
    border-bottom: none;
}

.admin-top-rank {
    font-family: var(--font-primary);
    font-size: 0.6rem;
    color: var(--accent2);
    width: 30px;
    text-align: center;
}

.admin-top-name {
    flex: 1;
    font-family: var(--font-primary);
    font-size: 0.5rem;
    color: var(--text-bright);
    line-height: 1.4;
}

.admin-top-count {
    font-family: var(--font-primary);
    font-size: 0.45rem;
    color: var(--accent);
    background: rgba(0, 255, 255, 0.15);
    border: 2px solid var(--accent);
    padding: 6px 12px;
}

/* Admin Spotify */
.admin-spotify-connection {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.admin-spotify-status {
    font-family: var(--font-primary);
    font-size: 0.5rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.4;
}

.admin-spotify-status i {
    font-size: 1.2rem;
}

.admin-spotify-status.connected {
    color: #1DB954;
}

.admin-spotify-status.disconnected {
    color: var(--danger);
}

.admin-spotify-buttons {
    display: flex;
    gap: 10px;
}

/* Admin Modal Mobile */
@media (max-width: 768px) {
    .admin-modal-content {
        width: 95%;
        max-height: 90vh;
        box-shadow: 0 0 20px var(--glow), inset 0 0 40px rgba(0, 0, 0, 0.5), 0 6px 0 #006666;
    }
    
    .admin-modal-title {
        font-size: 0.65rem;
        padding: 15px;
    }
    
    .admin-tabs {
        padding: 0;
        flex-shrink: 0;
    }
    
    .admin-tab {
        min-width: 50px;
        min-height: 60px; /* Maintain minimum height on mobile */
        padding: 12px 8px;
        font-size: 0.4rem;
        flex-shrink: 0;
    }
    
    .admin-tab span {
        display: none;
    }
    
    .admin-tab i {
        font-size: 1.3rem;
    }
    
    .admin-tab-content {
        padding: 15px;
    }
    
    .admin-form-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .admin-section-title {
        flex-wrap: wrap;
    }
    
    .admin-search-inline {
        width: 100%;
        margin: 12px 0 0 0;
    }

    .security-hero,
    .security-grid,
    .passkey-invite-form,
    .security-toggle-row {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .security-hero {
        display: block;
    }

    .security-hero-icon {
        margin-bottom: 16px;
    }

    .security-list-row {
        grid-template-columns: 1fr;
    }

    .passkey-code-result {
        align-items: flex-start;
        flex-direction: column;
    }

    #master-code-modal .modal-content {
        width: 92%;
        max-width: 420px;
    }

    #master-code-modal .modal-header,
    #master-code-modal .modal-body,
    #master-code-modal .modal-footer {
        padding-left: 18px;
        padding-right: 18px;
    }

    .modal-auth-actions {
        grid-template-columns: 1fr;
    }

    #master-code-modal .modal-footer {
        flex-direction: column-reverse;
    }
    
    .admin-input-small {
        width: 100%;
    }
    
    .admin-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .admin-stat-card {
        padding: 15px 10px;
    }
    
    .admin-stat-value {
        font-size: 1rem;
    }
    
    .admin-stat-label {
        font-size: 0.35rem;
    }
    
    .admin-member-badges {
        flex-direction: column;
        gap: 4px;
    }
    
    .admin-item-row,
    .admin-member-row {
        flex-wrap: wrap;
    }
    
    .admin-item-category {
        flex: auto;
    }
}

/* Admin Autocomplete Styles */
.admin-autocomplete-wrapper {
    position: relative;
    width: 100%;
}

.admin-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #0a1a1a;
    border: 3px solid var(--accent);
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.8);
}

.admin-autocomplete-dropdown.visible {
    display: block;
}

.admin-autocomplete-item {
    padding: 10px 12px;
    font-family: var(--font-primary);
    font-size: 0.45rem;
    color: var(--text);
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
    line-height: 1.5;
}

.admin-autocomplete-item:last-child {
    border-bottom: none;
}

.admin-autocomplete-item:hover,
.admin-autocomplete-item.selected {
    background: rgba(0, 255, 255, 0.1);
    color: var(--accent);
}

.admin-autocomplete-item .item-detail {
    font-size: 0.35rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.admin-autocomplete-item-new {
    background: rgba(255, 204, 0, 0.1);
    border-left: 4px solid var(--accent2);
}

.admin-autocomplete-item-new:hover {
    background: rgba(255, 204, 0, 0.2);
}

.admin-notice {
    font-family: var(--font-primary);
    font-size: 0.4rem;
    color: var(--accent2);
    background: rgba(255, 204, 0, 0.1);
    border: 2px solid var(--accent2);
    padding: 8px 10px;
    margin-top: 8px;
    line-height: 1.4;
}

.admin-notice i {
    margin-right: 6px;
}
