:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: rgba(59, 130, 246, 0.1);
    --primary-glow: rgba(59, 130, 246, 0.25);
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark-bg: #1f2937;
    --dark-card: #374151;
    --dark-text: #f9fafb;
    --light-bg: #f9fafb;
    --light-card: #ffffff;
    --light-text: #1f2937;
    --border-color: #e2e8f0;
    --border-radius: 10px;
    --border-radius-lg: 16px;
    --border-radius-sm: 6px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --box-shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Random picker specific colors */
    --accent-color: #ff5722;
    --accent-hover: #e64a19;
    --accent-light: rgba(255, 87, 34, 0.1);
    --accent-glow: rgba(255, 87, 34, 0.3);
    --input-bg: #f9f9f9;
    --history-bg: #fafafa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--light-bg) 0%, #e0f2fe 100%);
    color: var(--light-text);
    transition: var(--transition);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.dark-mode {
    background: linear-gradient(135deg, var(--dark-bg) 0%, #1e3a8a 100%);
    color: var(--dark-text);
    --input-bg: #2a2a2a;
    --history-bg: #2a2a2a;
    --border-color: #475569;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    flex: 1;
}

/* Header - Glassmorphism */
header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition);
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
}

.dark-mode header {
    background: rgba(31, 41, 55, 0.85);
    border-bottom-color: rgba(75, 85, 99, 0.5);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-container a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo {
    height: 42px;
    margin-right: 16px;
    transition: transform var(--transition-fast);
}

.logo:hover {
    transform: scale(1.05);
}

.site-title {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-actions {
    display: flex;
    gap: 16px;
}

#theme-btn {
    background: linear-gradient(135deg, #e2e8f0, #f1f5f9);
    border: none;
    font-size: 18px;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--light-text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.dark-mode #theme-btn {
    color: var(--dark-text);
    background: linear-gradient(135deg, #4b5563, #374151);
}

#theme-btn:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    transform: rotate(30deg) scale(1.1);
    box-shadow: 0 4px 16px var(--primary-glow);
}

/* Page Title - Enhanced */
.page-title {
    text-align: center;
    margin: 40px 0;
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-title h1 {
    font-size: 38px;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    display: inline-block;
}

.page-title h1::after {
    content: "";
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), var(--primary-color));
    border-radius: 2px;
}

.page-title p {
    font-size: 18px;
    color: #64748b;
    margin-top: 20px;
}

.dark-mode .page-title p {
    color: #94a3b8;
}

/* Main Container - Enhanced */
.random-picker-container {
    background: var(--light-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-lg);
    border: 1px solid var(--border-color);
    padding: 32px;
    margin: 24px 0;
    transition: var(--transition);
}

.dark-mode .random-picker-container {
    background: var(--dark-card);
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

/* Input Section - Enhanced */
.input-section {
    background: var(--input-bg);
    padding: 28px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
}

.dark-mode .input-section {
    border-color: #475569;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.input-section:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px) translateZ(0);
}

.dark-mode .input-section:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
    border-radius: var(--border-radius);
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #eaeaea;
}

.dark-mode .input-section {
    border-color: #444;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.input-section:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

.dark-mode .input-section:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.input-section h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-description {
    font-size: 0.95rem;
    color: #64748b;
    margin-bottom: 20px;
    line-height: 1.7;
}

.dark-mode .input-description {
    color: #94a3b8;
}

.form-label {
    font-weight: 600;
    color: var(--light-text);
    margin-bottom: 10px;
    display: block;
    font-size: 14px;
}

.dark-mode .form-label {
    color: var(--dark-text);
}

/* Textarea - Enhanced */
#studentListInput {
    width: 100%;
    min-height: 220px;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    resize: vertical;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1.6;
    font-family: inherit;
    background: white;
    color: var(--light-text);
}

.dark-mode #studentListInput {
    border-color: #475569;
    background: #333;
    color: var(--dark-text);
}

#studentListInput:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 4px var(--accent-light);
}

.dark-mode #studentListInput:focus {
    box-shadow: 0 0 0 4px rgba(255, 87, 34, 0.15);
}

.selection-mode {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.selection-mode-select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background: #fff;
    color: var(--light-text);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    appearance: none;
    font-weight: 500;
}

.selection-mode-select:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 4px var(--accent-light);
}

.dark-mode .selection-mode-select {
    border-color: #475569;
    background: #333;
    color: var(--dark-text);
}

.dark-mode .selection-mode-select:focus {
    box-shadow: 0 0 0 4px rgba(255, 87, 34, 0.15);
}

/* Mode Cards Section - Enhanced */
.mode-cards-section {
    margin-top: 24px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.mode-group {
    flex: 1;
    min-width: 180px;
}

.mode-group .form-label {
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.mode-cards {
    display: flex;
    gap: 12px;
}

.mode-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 10px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background: #fff;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.mode-card i {
    font-size: 1.4rem;
    color: #64748b;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.mode-card span {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.mode-card:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
    transform: translateY(-3px) translateZ(0);
}

.mode-card:hover i,
.mode-card:hover span {
    color: var(--primary-color);
}

.mode-card.active {
    border-color: var(--primary-color);
    background: var(--primary-light);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.mode-card.active i {
    color: var(--primary-color);
}

.mode-card.active span {
    color: var(--primary-color);
    font-weight: 700;
}

/* Pair mode card styling - Enhanced */
#pickerModeCards .mode-card[data-value="pair"].active {
    border-color: var(--secondary-color);
    background: rgba(139, 92, 246, 0.1);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}

#pickerModeCards .mode-card[data-value="pair"].active i,
#pickerModeCards .mode-card[data-value="pair"].active span {
    color: var(--secondary-color);
}

#pickerModeCards .mode-card[data-value="pair"]:hover {
    border-color: var(--secondary-color);
    background: rgba(139, 92, 246, 0.08);
}

#pickerModeCards .mode-card[data-value="pair"]:hover i,
#pickerModeCards .mode-card[data-value="pair"]:hover span {
    color: var(--secondary-color);
}

/* Dark mode for mode cards */
.dark-mode .mode-card {
    border-color: #475569;
    background: #333;
}

.dark-mode .mode-card i,
.dark-mode .mode-card span {
    color: #94a3b8;
}

.dark-mode .mode-card:hover {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.15);
}

.dark-mode .mode-card.active {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.15);
}

.dark-mode #pickerModeCards .mode-card[data-value="pair"].active {
    border-color: var(--secondary-color);
    background: rgba(139, 92, 246, 0.2);
}

.dark-mode #pickerModeCards .mode-card[data-value="pair"]:hover {
    border-color: var(--secondary-color);
    background: rgba(139, 92, 246, 0.15);
}

/* Multi mode card styling - Enhanced */
#pickerModeCards .mode-card[data-value="multi"].active {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

#pickerModeCards .mode-card[data-value="multi"].active i,
#pickerModeCards .mode-card[data-value="multi"].active span {
    color: #10b981;
}

#pickerModeCards .mode-card[data-value="multi"]:hover {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.08);
}

#pickerModeCards .mode-card[data-value="multi"]:hover i,
#pickerModeCards .mode-card[data-value="multi"]:hover span {
    color: #10b981;
}

.dark-mode #pickerModeCards .mode-card[data-value="multi"].active {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.2);
}

.dark-mode #pickerModeCards .mode-card[data-value="multi"]:hover {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.15);
}

/* Multi count input - Enhanced */
.multi-count-group {
    min-width: 140px;
}

.multi-count-input {
    display: flex;
    align-items: center;
    gap: 0;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    background: #fff;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.multi-count-input:focus-within {
    border-color: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

.dark-mode .multi-count-input {
    border-color: #475569;
    background: #333;
}

.multi-count-input input {
    width: 50px;
    text-align: center;
    border: none;
    padding: 12px 6px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #10b981;
    background: transparent;
    -moz-appearance: textfield;
    appearance: textfield;
}

.multi-count-input input::-webkit-outer-spin-button,
.multi-count-input input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.multi-count-input input:focus {
    outline: none;
}

.dark-mode .multi-count-input input {
    color: #34d399;
}

.count-btn {
    background: rgba(16, 185, 129, 0.1);
    border: none;
    padding: 12px 16px;
    cursor: pointer;
    color: #10b981;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    font-weight: 600;
}

.count-btn:hover {
    background: #10b981;
    color: white;
}

.dark-mode .count-btn {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.dark-mode .count-btn:hover {
    background: #10b981;
    color: white;
}

/* Buttons - Enhanced */
.button-group {
    display: flex;
    gap: 14px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    min-width: 180px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.2s, transform 0.2s;
}

.btn:active::before {
    opacity: 1;
    transform: scale(1.5);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color), #ff7043);
    color: white;
    box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover), var(--accent-color));
    transform: translateY(-4px) translateZ(0);
    box-shadow: 0 8px 24px var(--accent-glow);
}

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

.btn-secondary {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: #333;
    border: 1px solid var(--border-color);
}

.dark-mode .btn-secondary {
    background: linear-gradient(135deg, #4b5563, #374151);
    color: #eee;
    border-color: #475569;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    transform: translateY(-4px) translateZ(0);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.dark-mode .btn-secondary:hover {
    background: linear-gradient(135deg, #6b7280, #4b5563);
}

.btn-sound {
    background: linear-gradient(135deg, #dbeafe, #e0f2fe);
    color: var(--primary-color);
    border: 1px solid #bfdbfe;
}

.dark-mode .btn-sound {
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
    color: #93c5fd;
    border-color: #1d4ed8;
}

.btn-sound:hover {
    background: linear-gradient(135deg, #bfdbfe, #dbeafe);
    transform: translateY(-4px) translateZ(0);
    box-shadow: 0 6px 16px var(--primary-glow);
}

.dark-mode .btn-sound:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e3a8a);
}

.btn-sound.muted {
    background: #f1f5f9;
    color: #94a3b8;
    border-color: var(--border-color);
}

.dark-mode .btn-sound.muted {
    background: #333;
    color: #6b7280;
    border-color: #475569;
}

.btn-pair {
    background: linear-gradient(135deg, var(--secondary-color), #a78bfa);
    color: white;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.3);
}

.btn-pair:hover {
    background: linear-gradient(135deg, #7c3aed, var(--secondary-color));
    transform: translateY(-4px) translateZ(0);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.35);
}

.btn-pair:active {
    transform: translateY(-2px);
}

.btn-multi {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-multi:hover {
    background: linear-gradient(135deg, #059669, #10b981);
    transform: translateY(-4px) translateZ(0);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
}

.btn-multi:active {
    transform: translateY(-2px);
}

.btn i {
    font-size: 1.15rem;
}

/* Results Section - Enhanced */
.results-section {
    display: flex;
    flex-direction: column;
    background: var(--light-card);
    padding: 28px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: var(--transition);
}

.dark-mode .results-section {
    background: var(--dark-card);
    border-color: #475569;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.results-section:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px) translateZ(0);
}

.dark-mode .results-section:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.results-section h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}

.results-list-container {
    flex: 1;
    background: var(--history-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 20px;
}

.dark-mode .results-list-container {
    border-color: #475569;
}

#selectionHistory {
    max-height: 220px;
    overflow-y: auto;
    list-style-type: none;
    padding: 16px;
}

/* Custom scrollbar */
#selectionHistory::-webkit-scrollbar {
    width: 6px;
}

#selectionHistory::-webkit-scrollbar-track {
    background: transparent;
}

#selectionHistory::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.dark-mode #selectionHistory::-webkit-scrollbar-thumb {
    background: #475569;
}

.history-item {
    background: white;
    padding: 14px 16px;
    margin-bottom: 12px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    font-weight: 600;
    color: var(--light-text);
    border-left: 4px solid var(--primary-color);
    animation: historySlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.history-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

@keyframes historySlideIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.dark-mode .history-item {
    background: #333;
    color: var(--dark-text);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.history-item:last-child {
    margin-bottom: 0;
}

.history-item-number {
    font-weight: 800;
    color: var(--primary-color);
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    border-radius: 50%;
    font-size: 0.85rem;
}

.dark-mode .history-item-number {
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.2);
}

.history-item-time {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 500;
}

.pair-history-item {
    border-left-color: var(--secondary-color);
}

.pair-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.pair-info i {
    color: var(--secondary-color);
}

.dark-mode .pair-info i {
    color: #a78bfa;
}

.pair-info small {
    font-size: 0.7rem;
    color: #94a3b8;
    font-style: italic;
}

.multi-history-item {
    border-left-color: #10b981;
}

.multi-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.multi-info i {
    color: #10b981;
    flex-shrink: 0;
}

.dark-mode .multi-info i {
    color: #34d399;
}

.multi-info small {
    font-size: 0.7rem;
    color: #94a3b8;
    font-style: italic;
}

/* Stats Container - Enhanced */
.stats-container {
    display: flex;
    justify-content: space-between;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    padding: 18px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.dark-mode .stats-container {
    background: linear-gradient(135deg, #2d3748, #374151);
    border-color: #475569;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    padding: 8px;
}

.stat-item:not(:last-child) {
    border-right: 1px solid var(--border-color);
}

.dark-mode .stat-item:not(:last-child) {
    border-right-color: #475569;
}

.stat-label {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 6px;
    font-weight: 500;
}

.dark-mode .stat-label {
    color: #94a3b8;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.dark-mode .stat-value {
    background: linear-gradient(135deg, #93c5fd, #c4b5fd);
    -webkit-background-clip: text;
    background-clip: text;
}

/* Instructions - Enhanced */
.instructions {
    background: linear-gradient(135deg, #fff9f5, #fff5f0);
    border-left: 4px solid var(--accent-color);
    padding: 24px;
    margin-top: 32px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(255, 87, 34, 0.08);
}

.dark-mode .instructions {
    background: linear-gradient(135deg, #3a2a22, #2d211a);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.instructions h4 {
    background: linear-gradient(135deg, var(--accent-color), #ff7043);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 16px;
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.instructions ol {
    margin-left: 28px;
    color: #555;
    line-height: 1.8;
}

.dark-mode .instructions ol {
    color: #bbb;
}

.instructions li {
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.instructions li:last-child {
    margin-bottom: 0;
}

/* Wheel Overlay - Enhanced */
.wheel-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.wheel-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.wheel-container {
    position: relative;
    width: 400px;
    height: 400px;
    margin: 0 auto;
}

.wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 0 12px rgba(255, 255, 255, 0.25),
                0 0 0 24px rgba(255, 255, 255, 0.1),
                0 20px 50px rgba(0, 0, 0, 0.4);
    transition: transform 5s cubic-bezier(0.1, 0.05, 0.05, 1);
}

.wheel-segment {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 50%;
    transform-origin: 0% 100%;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    color: #fff;
    font-weight: bold;
    font-size: 0.9rem;
    overflow: hidden;
    border-right: 1px solid rgba(255, 255, 255, 0.3);
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

.wheel-segment-content {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center bottom;
    pointer-events: none;
    text-align: center;
}

.wheel-segment-label {
    display: inline-block;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 70%;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    transform-origin: center center;
}

.wheel-pointer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 48px;
    background: linear-gradient(180deg, #fff, #f1f5f9);
    clip-path: polygon(50% 0, 0% 100%, 100% 100%);
    z-index: 10;
    filter: drop-shadow(0 0 12px rgba(0, 0, 0, 0.6));
}

/* Winner Overlay - Enhanced */
.winner-overlay {
    position: fixed;
    inset: 0;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.winner-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.winner-container {
    position: relative;
    max-width: 500px;
    width: 90%;
    padding: 36px;
    background: linear-gradient(180deg, #fff, #fafafa);
    border-radius: var(--border-radius-lg);
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    animation: winnerPopIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.dark-mode .winner-container {
    background: linear-gradient(180deg, var(--dark-card), #2d3748);
    border-color: rgba(255, 255, 255, 0.1);
}

@keyframes winnerPopIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    70% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.confetti {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--accent-color);
    opacity: 0.85;
    animation: confettiDrop 5s linear infinite;
}

@keyframes confettiDrop {
    0% {
        transform: translateY(-50px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(500px) rotate(360deg);
        opacity: 0;
    }
}

.winner-content {
    position: relative;
    z-index: 1;
}

.winner-label {
    font-size: 1.2rem;
    color: #64748b;
    margin-bottom: 16px;
    font-weight: 500;
}

.dark-mode .winner-label {
    color: #94a3b8;
}

.winner-name {
    font-size: 2.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-color), #ff7043);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    padding: 18px 24px;
    margin-bottom: 18px;
    background-color: #fff9f5;
    border: 2px solid #ffece2;
    border-radius: var(--border-radius);
    animation: winnerPulse 2s infinite;
}

.dark-mode .winner-name {
    background-color: #3a2a22;
    border-color: #543b2a;
}

/* Pair Winner Display - Enhanced */
.pair-winner-container {
    max-width: 600px;
}

.pair-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.pair-student {
    font-size: 1.9rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-color), #ff7043);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    padding: 18px 28px;
    background-color: #fff9f5;
    border: 2px solid #ffece2;
    border-radius: var(--border-radius);
    animation: winnerPulse 2s infinite;
    min-width: 150px;
    text-align: center;
}

.dark-mode .pair-student {
    background-color: #3a2a22;
    border-color: #543b2a;
}

.pair-separator {
    font-size: 2.2rem;
    background: linear-gradient(135deg, var(--secondary-color), #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: jump 1s infinite alternate;
}

.pair-note {
    font-size: 0.9rem;
    color: #64748b;
    font-style: italic;
    margin-bottom: 12px;
    padding: 10px 18px;
    background: var(--primary-light);
    border-radius: 25px;
    display: none;
    font-weight: 500;
}

.pair-note.show {
    display: inline-block;
}

.dark-mode .pair-note {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
}

/* Multi Winner Display - Enhanced */
.multi-winner-container {
    max-width: 700px;
}

.multi-display {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 18px;
    max-height: 300px;
    overflow-y: auto;
    padding: 12px;
}

.multi-student {
    font-size: 1.2rem;
    font-weight: 700;
    color: #10b981;
    padding: 12px 20px;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border: 2px solid #a7f3d0;
    border-radius: 25px;
    animation: winnerPopIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    display: flex;
    align-items: center;
    gap: 10px;
}

.multi-student .student-number {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 800;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.dark-mode .multi-student {
    background: linear-gradient(135deg, #064e3b, #065f46);
    border-color: #065f46;
    color: #34d399;
}

.dark-mode .multi-student .student-number {
    background: linear-gradient(135deg, #34d399, #10b981);
    color: #064e3b;
}

/* Picker mode styling */
.picker-mode {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.winner-emoji {
    font-size: 3.2rem;
    animation: jump 1s infinite alternate;
}

@keyframes winnerPulse {
    0% {
        box-shadow: 0 0 0 0 var(--accent-glow);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(255, 87, 34, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 87, 34, 0);
    }
}

@keyframes jump {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-12px);
    }
}

/* Footer - Glassmorphism */
.footer {
    margin-top: 50px;
    padding: 24px 0;
    text-align: center;
    border-top: 1px solid rgba(226, 232, 240, 0.5);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: var(--transition);
}

.dark-mode .footer {
    background: rgba(31, 41, 55, 0.85);
    border-top-color: rgba(75, 85, 99, 0.5);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.footer-links {
    line-height: 1.8;
    color: #64748b;
    font-size: 0.9rem;
}

.dark-mode .footer-links {
    color: #94a3b8;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all var(--transition-fast);
    position: relative;
}

.footer a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width var(--transition);
}

.footer a:hover::after {
    width: 100%;
}

.footer a:hover {
    color: var(--primary-hover);
}

/* Responsive - Enhanced */
@media (max-width: 992px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .random-picker-container {
        padding: 24px;
    }
    
    .wheel-container {
        width: 350px;
        height: 350px;
    }
}

@media (max-width: 768px) {
    .page-title h1 {
        font-size: 28px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .wheel-container {
        width: 300px;
        height: 300px;
    }
    
    .winner-name {
        font-size: 2rem;
    }
    
    .pair-student {
        font-size: 1.5rem;
        padding: 14px 20px;
    }
}

@media (max-width: 480px) {
    .page-title h1 {
        font-size: 24px;
    }
    
    .page-title p {
        font-size: 15px;
    }
    
    .input-section,
    .results-section {
        padding: 18px;
    }
    
    .wheel-container {
        width: 250px;
        height: 250px;
    }
    
    .winner-container {
        padding: 24px;
    }
    
    .winner-name {
        font-size: 1.7rem;
        padding: 12px;
    }
    
    .winner-emoji {
        font-size: 2.5rem;
    }
    
    .mode-cards-section {
        flex-direction: column;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .wheel {
        transition: none !important;
    }
}
