/* ===================================
   Modern Minimal Design System
   Clean, Minimal, Modern UI/UX
   =================================== */

/* CSS Variables */
:root {
    /* Colors - Softer, More Refined */
    --bg-primary: #0a0a0f;
    --bg-secondary: #14141a;
    --bg-tertiary: #1a1a22;
    --bg-card: #16161d;
    --bg-hover: #1f1f28;
    --bg-elevated: #1c1c24;

    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --text-disabled: #4b5563;

    --accent-primary: #8b5cf6;
    --accent-secondary: #a78bfa;
    --accent-hover: #7c3aed;
    --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);

    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;

    /* Spacing - More Consistent */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    --spacing-3xl: 64px;

    /* Border Radius - Subtle */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Shadows - Subtle */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.25);

    /* Transitions - Smooth */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Sidebar */
    --sidebar-width: 240px;
}

/* Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.025em;
    color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-secondary);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

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

.text-secondary {
    color: var(--text-secondary);
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.uppercase {
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tracking-wider {
    letter-spacing: 0.05em;
}

.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

/* ===================================
   Buttons - Modern & Minimal
   =================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 10px 20px;
    font-size: 0.9375rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
    transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--bg-hover);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 16px;
}

.btn-ghost:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-icon {
    font-size: 1rem;
    line-height: 1;
}

/* ===================================
   Form Elements - Clean & Modern
   =================================== */
.form-group {
    margin-bottom: var(--spacing-lg);
}

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

.form-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--bg-hover);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-elevated);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}

select:hover {
    border-color: var(--accent-secondary);
}

select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 8px;
}

/* ===================================
   Hall Section
   =================================== */

.hall-container {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    align-items: start;
    gap: var(--spacing-lg);
    animation: hallFadeIn 0.4s ease;
}

@keyframes hallFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hall Cards - Base */
.hall-card {
    background: var(--bg-elevated);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all var(--transition-fast);
}

.hall-card:hover {
    border-color: var(--bg-hover);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* Card Label */
.hall-card-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
}

.hall-label-icon {
    font-size: 0.8125rem;
}

/* Video Card */
.hall-card-video {
    grid-row: 1 / 2;
    display: flex;
    flex-direction: column;
}

/* TV Frame */
.hall-video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    border-radius: 14px;
    overflow: hidden;
    background: #0a0a0a;
    border: 6px solid #1a1a2e;
    box-shadow:
        inset 0 0 8px rgba(0, 0, 0, 0.6),
        0 4px 20px rgba(0, 0, 0, 0.4),
        0 0 0 2px #111;
}

/* TV bezel highlight */
.hall-video-wrapper::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(60, 60, 80, 0.3) 0%, transparent 40%, transparent 60%, rgba(30, 30, 50, 0.2) 100%);
    pointer-events: none;
    z-index: 2;
}

/* LED indicator */
.hall-video-wrapper::after {
    content: '';
    position: absolute;
    bottom: 8px;
    right: 12px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 6px #ef4444, 0 0 12px rgba(239, 68, 68, 0.4);
    z-index: 3;
    animation: tvLedPulse 3s ease-in-out infinite;
}

@keyframes tvLedPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.hall-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    z-index: 1;
}

/* Vintage TV Channel Buttons */
.tv-channel-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 10px 0 2px;
}

.tv-channel-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: radial-gradient(circle at 35% 35%, #555, #222 60%, #111);
    color: #aaa;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 2px 4px rgba(0,0,0,0.5),
        inset 0 1px 1px rgba(255,255,255,0.1);
    position: relative;
    font-family: 'Courier New', monospace;
}

.tv-channel-btn::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}

.tv-channel-btn:hover {
    background: radial-gradient(circle at 35% 35%, #666, #333 60%, #1a1a1a);
    color: #ddd;
    transform: scale(1.1);
}

.tv-channel-btn:active {
    transform: scale(0.95);
    box-shadow: 0 1px 2px rgba(0,0,0,0.5), inset 0 1px 3px rgba(0,0,0,0.4);
}

.tv-channel-btn.active {
    background: radial-gradient(circle at 35% 35%, #555, #222 60%, #111);
    color: #fff;
    box-shadow:
        0 2px 4px rgba(0,0,0,0.5),
        0 0 8px rgba(239, 68, 68, 0.3),
        inset 0 1px 1px rgba(255,255,255,0.1);
}

.tv-channel-btn.active::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 6px #ef4444;
}

/* User channel wrapper — holds button + remove badge */
.tv-channel-wrapper {
    position: relative;
    display: inline-flex;
}

.tv-channel-remove {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.85);
    border: 1.5px solid rgba(30, 10, 10, 0.9);
    color: #fff;
    font-size: 0.45rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.15s, transform 0.15s;
    z-index: 2;
}

.tv-channel-wrapper:hover .tv-channel-remove {
    opacity: 1;
    transform: scale(1);
}

.tv-channel-remove:hover {
    background: rgba(239, 68, 68, 1);
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
}

/* User channel accent ring */
.tv-channel-btn.user-ch {
    box-shadow:
        0 2px 4px rgba(0,0,0,0.5),
        inset 0 1px 1px rgba(255,255,255,0.1),
        0 0 0 2px rgba(139, 92, 246, 0.5);
}

.tv-channel-btn.user-ch.active {
    box-shadow:
        0 2px 4px rgba(0,0,0,0.5),
        0 0 8px rgba(139, 92, 246, 0.4),
        inset 0 1px 1px rgba(255,255,255,0.1),
        0 0 0 2px rgba(139, 92, 246, 0.65);
}

.tv-channel-btn.user-ch.active::before {
    background: #8b5cf6;
    box-shadow: 0 0 6px #8b5cf6;
}

/* TV Static / Snow Effect */
.tv-static-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: repeating-radial-gradient(
        circle at 50% 50%,
        rgba(255,255,255,0.03) 0px,
        rgba(0,0,0,0.1) 1px,
        transparent 2px
    );
    animation: tvStatic 0.1s steps(4) infinite;
}

.tv-static-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0,0,0,0.15) 2px,
            rgba(0,0,0,0.15) 4px
        );
    animation: tvScanline 0.3s linear infinite;
}

@keyframes tvStatic {
    0% { opacity: 0.8; }
    25% { opacity: 0.6; }
    50% { opacity: 0.9; }
    75% { opacity: 0.5; }
    100% { opacity: 0.7; }
}

@keyframes tvScanline {
    from { transform: translateY(0); }
    to { transform: translateY(4px); }
}

/* Channel Number Indicator */
.tv-channel-indicator {
    position: absolute;
    top: 14px;
    right: 16px;
    background: rgba(0, 0, 0, 0.75);
    color: #00ff88;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    letter-spacing: 1px;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
}

.tv-channel-indicator.show {
    opacity: 1;
}

.hall-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    gap: var(--spacing-xs);
}

.hall-placeholder-icon {
    font-size: 2rem;
    opacity: 0.5;
}

.hall-placeholder p {
    font-size: 0.8125rem;
    opacity: 0.6;
}

.hall-video-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-top: var(--spacing-sm);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Right Column */
.hall-right-col {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

/* Motivation Card */
.hall-card-motivation {
    background: linear-gradient(135deg, #1a1035 0%, #0f172a 50%, #1e1145 100%);
    border: 1px solid rgba(139, 92, 246, 0.25);
    position: relative;
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.hall-card-motivation::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.hall-card-motivation::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -20%;
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.hall-card-motivation .hall-card-label {
    position: relative;
    z-index: 1;
    color: rgba(139, 92, 246, 0.7);
    letter-spacing: 1px;
}

.hall-motivation-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 48px;
    position: relative;
    z-index: 1;
    padding: var(--spacing-sm) 0;
}

/* Motivation Row: Image + Quote side by side */
.hall-motivation-row {
    display: flex;
    gap: var(--spacing-md);
    align-items: stretch;
}

/* Motivation Image Card */
.hall-card-motivation-img {
    background: linear-gradient(135deg, #1a1035 0%, #0f172a 50%, #1e1145 100%);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: var(--radius-lg);
    padding: var(--spacing-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-shrink: 0;
    width: 130px;
}

.hall-motivation-img-frame {
    width: 100%;
    height: 150px;
    border-radius: 14px;
    overflow: hidden;
    border: 2px solid rgba(139, 92, 246, 0.3);
}

.hall-motivation-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hall-motivation-quote {
    font-size: 1.0625rem;
    font-style: italic;
    color: #e2d6ff;
    line-height: 1.7;
    margin: 0;
    text-shadow: 0 0 30px rgba(139, 92, 246, 0.15);
}

.hall-motivation-author {
    font-size: 0.75rem;
    color: rgba(180, 160, 210, 0.5);
    margin-top: 8px;
    font-weight: 500;
}

/* Edit Button in Card Label */
.hall-edit-btn {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.hall-card:hover .hall-edit-btn {
    opacity: 0.6;
}

.hall-edit-btn:hover {
    opacity: 1 !important;
    background: var(--bg-hover);
}

/* Motivation Quote Fade Animation */
.motivation-fade-out {
    animation: motivFadeOut 0.4s ease forwards;
}

.motivation-fade-in {
    animation: motivFadeIn 0.5s ease forwards;
}

@keyframes motivFadeOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-6px); }
}

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

/* Motivation Dots Indicator */
.hall-motivation-dots {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: auto;
    padding-top: var(--spacing-sm);
}

.motivation-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.25);
    transition: all 0.3s ease;
}

.motivation-dot.active {
    background: rgba(139, 92, 246, 0.55);
    border-color: rgba(139, 92, 246, 0.7);
    box-shadow: 0 0 4px rgba(139, 92, 246, 0.3);
}

/* Motivation Edit Form */
.hall-motivation-edit {
    display: none;
    flex-direction: column;
    gap: var(--spacing-sm);
    position: relative;
    z-index: 1;
}

.hall-motivation-edit.active {
    display: flex;
}

.motivation-quotes-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
}

.motivation-quote-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.motivation-quote-row-inputs {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.motivation-row-quote {
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: var(--radius-md);
    color: #e2d6ff;
    font-family: inherit;
    font-size: 0.82rem;
    font-style: italic;
    transition: border-color var(--transition-fast);
}

.motivation-row-quote:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.motivation-row-author {
    padding: 3px var(--spacing-sm);
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: var(--radius-sm);
    color: rgba(200, 180, 255, 0.6);
    font-family: inherit;
    font-size: 0.72rem;
    transition: border-color var(--transition-fast);
}

.motivation-row-author:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.motivation-row-remove {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: rgba(239, 68, 68, 0.5);
    cursor: pointer;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 5px;
    transition: all 0.2s;
    padding: 0;
}

.motivation-row-remove:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.5);
    color: rgba(239, 68, 68, 0.9);
}

.motivation-add-quote-btn {
    background: transparent;
    border: 1px dashed rgba(139, 92, 246, 0.25);
    color: rgba(139, 92, 246, 0.5);
    cursor: pointer;
    border-radius: var(--radius-md);
    padding: 5px 0;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: all 0.2s;
}

.motivation-add-quote-btn:hover {
    border-color: rgba(139, 92, 246, 0.5);
    color: rgba(139, 92, 246, 0.8);
    background: rgba(139, 92, 246, 0.05);
}

.hall-motivation-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-xs);
}

/* Hall To-Do Card */
.hall-card-todo {
    background: linear-gradient(135deg, #0a1628 0%, #0f172a 50%, #0c1a2e 100%);
    border: 1px solid rgba(129, 140, 248, 0.2);
    position: relative;
    overflow: hidden;
}

.hall-card-todo::before {
    content: '';
    position: absolute;
    top: -40%;
    left: -20%;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(129, 140, 248, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.hall-card-todo .hall-card-label {
    position: relative;
    z-index: 1;
    color: rgba(129, 140, 248, 0.7);
    letter-spacing: 1px;
}

.hall-card-todo .hall-edit-btn {
    margin-left: auto;
    font-size: 1.1rem;
    background: rgba(129, 140, 248, 0.15);
    border: 1px solid rgba(129, 140, 248, 0.3);
    color: rgba(129, 140, 248, 0.9);
    cursor: pointer;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
}

.hall-card-todo .hall-edit-btn:hover {
    background: rgba(129, 140, 248, 0.3);
    transform: scale(1.1);
}

.hall-todo-list {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 190px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(129, 140, 248, 0.2) transparent;
}

.hall-todo-list::-webkit-scrollbar {
    width: 4px;
}

.hall-todo-list::-webkit-scrollbar-track {
    background: transparent;
}

.hall-todo-list::-webkit-scrollbar-thumb {
    background: rgba(129, 140, 248, 0.2);
    border-radius: 4px;
}

.hall-todo-list::-webkit-scrollbar-thumb:hover {
    background: rgba(129, 140, 248, 0.4);
}

.hall-todo-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(129, 140, 248, 0.06);
    transition: background 0.2s;
}

.hall-todo-item:hover {
    background: rgba(129, 140, 248, 0.12);
}

.hall-todo-item-check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(129, 140, 248, 0.4);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: transparent;
    background: transparent;
    padding: 0;
}

.hall-todo-item-check:hover {
    border-color: rgba(129, 140, 248, 0.8);
    background: rgba(129, 140, 248, 0.15);
    color: rgba(129, 140, 248, 0.8);
}

.hall-todo-item-text {
    font-size: 0.82rem;
    color: rgba(186, 230, 240, 0.85);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hall-todo-item-priority {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.hall-todo-empty {
    text-align: center;
    padding: 12px 0;
    position: relative;
    z-index: 1;
}

.hall-todo-empty p {
    font-size: 0.8rem;
    color: rgba(148, 163, 184, 0.5);
    margin: 0;
}

.hall-todo-footer {
    text-align: center;
    margin-top: 8px;
    position: relative;
    z-index: 1;
}

.hall-todo-see-all {
    font-size: 0.78rem;
    color: rgba(129, 140, 248, 0.7);
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s;
}

.hall-todo-see-all:hover {
    color: rgba(129, 140, 248, 1);
    text-decoration: underline;
}

/* ===== Writing Tree Card ===== */
.hall-card-tree {
    background: linear-gradient(180deg, #0f0d1e 0%, #12101f 60%, #1a1530 100%);
    border: 1px solid rgba(168, 130, 80, 0.15);
    text-align: center;
    padding: var(--spacing-md) var(--spacing-lg) var(--spacing-sm);
}

.hall-card-tree .hall-card-label {
    margin-bottom: var(--spacing-xs);
}

.writing-tree-body {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.writing-tree-scene {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 0;
}

.writing-tree-scene canvas {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.writing-tree-badges {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding-top: 2px;
    flex-shrink: 0;
    min-width: 38px;
}

.writing-tree-badges:empty {
    display: none;
}

.wt-badge {
    width: 38px;
    min-height: 38px;
    border-radius: 12px;
    background: radial-gradient(circle at 40% 35%, rgba(255, 225, 120, 0.2) 0%, rgba(30, 25, 15, 0.35) 100%);
    border: 1.5px solid rgba(200, 170, 70, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3px 0;
    position: relative;
    box-shadow: 0 0 10px rgba(255, 200, 60, 0.18), inset 0 1px 4px rgba(255, 255, 200, 0.08);
}

.wt-badge svg {
    width: 30px;
    height: 30px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

.wt-badge-count {
    display: block;
    font-size: 0.6rem;
    font-weight: 700;
    color: rgba(255, 215, 80, 0.85);
    letter-spacing: 0.5px;
    margin-top: -2px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* Info text */
.writing-tree-info {
    font-size: 0.68rem;
    color: rgba(200, 180, 150, 0.4);
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.writing-tree-info .wt-level {
    color: rgba(168, 130, 80, 0.6);
    font-weight: 600;
}

/* ===== Pomodoro Timer Card ===== */
/* Mode Buttons */
.pomodoro-modes {
    display: flex;
    gap: 4px;
    background: rgba(168, 130, 80, 0.06);
    border-radius: 8px;
    padding: 3px;
    position: relative;
    z-index: 1;
}

.pomodoro-mode-btn {
    background: transparent;
    border: none;
    color: rgba(200, 180, 150, 0.4);
    font-size: 0.68rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.pomodoro-mode-btn:hover {
    color: rgba(200, 180, 150, 0.7);
}

.pomodoro-mode-btn.active {
    background: rgba(168, 130, 80, 0.18);
    color: rgba(220, 190, 130, 0.95);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.pomodoro-ring-container {
    position: relative;
    width: 130px;
    height: 130px;
}

.pomodoro-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.pomodoro-ring-bg {
    fill: none;
    stroke: rgba(168, 130, 80, 0.08);
    stroke-width: 4;
}

.pomodoro-ring-progress {
    fill: none;
    stroke: rgba(168, 130, 80, 0.5);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 326.73;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.5s ease;
}

.pomodoro-ring-progress.running {
    stroke: rgba(200, 170, 100, 0.7);
}

.pomodoro-ring-progress.break-mode {
    stroke: rgba(100, 180, 140, 0.6);
}

.pomodoro-time {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.65rem;
    font-weight: 300;
    color: rgba(220, 200, 170, 0.9);
    font-family: 'Courier New', 'Courier', monospace;
    letter-spacing: 2px;
}

/* Controls */
.pomodoro-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.pomodoro-btn {
    background: transparent;
    border: 1px solid rgba(168, 130, 80, 0.25);
    color: rgba(200, 180, 150, 0.7);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.pomodoro-start-btn {
    width: 42px;
    height: 42px;
    font-size: 1rem;
    background: rgba(168, 130, 80, 0.1);
    border-color: rgba(168, 130, 80, 0.35);
    color: rgba(220, 190, 130, 0.9);
}

.pomodoro-start-btn:hover {
    background: rgba(168, 130, 80, 0.25);
    border-color: rgba(168, 130, 80, 0.5);
    transform: scale(1.08);
    box-shadow: 0 0 12px rgba(168, 130, 80, 0.15);
}

.pomodoro-start-btn.running {
    background: rgba(200, 80, 80, 0.12);
    border-color: rgba(200, 100, 100, 0.35);
    color: rgba(220, 140, 140, 0.9);
}

.pomodoro-start-btn.running:hover {
    background: rgba(200, 80, 80, 0.25);
    border-color: rgba(200, 100, 100, 0.5);
    box-shadow: 0 0 12px rgba(200, 80, 80, 0.15);
}

.pomodoro-reset-btn {
    width: 32px;
    height: 32px;
    font-size: 1rem;
}

.pomodoro-reset-btn:hover {
    background: rgba(168, 130, 80, 0.15);
    border-color: rgba(168, 130, 80, 0.4);
    transform: scale(1.08);
}

/* Editable Time Input */
.pomodoro-time-display {
    cursor: pointer;
    transition: color 0.2s ease;
}

.pomodoro-time-display:hover {
    color: rgba(220, 190, 130, 1);
}

.pomodoro-time-input {
    width: 56px;
    background: transparent;
    border: none;
    border-bottom: 1.5px solid rgba(168, 130, 80, 0.5);
    color: rgba(220, 200, 170, 0.9);
    font-size: 1.4rem;
    font-family: 'Courier New', 'Courier', monospace;
    text-align: center;
    outline: none;
    letter-spacing: 1px;
    -moz-appearance: textfield;
}

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

/* Notification Bell & Dropdown */
.sidebar-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.sidebar-notif-btn {
    position: relative;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.15);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: all 0.25s ease;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-notif-btn svg {
    width: 17px;
    height: 17px;
    stroke: rgba(251, 191, 36, 0.65);
    transition: all 0.25s ease;
}

.sidebar-notif-btn:hover {
    background: rgba(251, 191, 36, 0.18);
    border-color: rgba(251, 191, 36, 0.3);
}

.sidebar-notif-btn:hover svg {
    stroke: rgba(251, 191, 36, 0.9);
}

.notif-badge {
    position: absolute;
    top: -3px;
    right: -5px;
    background: rgba(239, 68, 68, 0.85);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 99px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

.notif-dropdown {
    position: absolute;
    top: 56px;
    left: 8px;
    right: 8px;
    background: var(--bg-elevated, #1e293b);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 200;
    max-height: 340px;
    overflow-y: auto;
    padding: 0;
}

.notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.notif-mark-read {
    background: none;
    border: none;
    color: rgba(34, 211, 238, 0.7);
    font-size: 0.72rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s;
}

.notif-mark-read:hover {
    background: rgba(34, 211, 238, 0.1);
    color: rgba(34, 211, 238, 1);
}

.notif-dropdown-list {
    padding: 6px;
}

.notif-item {
    padding: 10px 10px;
    border-radius: 8px;
    cursor: default;
    transition: background 0.15s;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

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

.notif-item.unread {
    background: rgba(34, 211, 238, 0.06);
}

.notif-item.unread::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22d3ee;
    flex-shrink: 0;
    margin-top: 5px;
}

.notif-item-content {
    flex: 1;
    min-width: 0;
}

.notif-item-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 2px;
}

.notif-item-body {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.5;
}

.notif-item-time {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 4px;
}

.notif-item + .notif-item {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.notif-dropdown-empty {
    text-align: center;
    padding: 24px 14px;
}

.notif-dropdown-empty p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.35);
    margin: 0;
}

.notif-item {
    cursor: pointer;
}

/* TV User YouTube Link */
.tv-add-user-btn {
    background: radial-gradient(circle at 35% 35%, #333, #1a1a1a 60%, #111) !important;
    color: rgba(255, 255, 255, 0.4) !important;
    border: 1px dashed rgba(255, 255, 255, 0.2) !important;
    font-size: 1rem !important;
    letter-spacing: 0;
}

.tv-add-user-btn:hover {
    color: rgba(255, 255, 255, 0.8) !important;
    border-color: rgba(139, 92, 246, 0.5) !important;
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.2) !important;
}


.tv-user-link-input-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 400px;
    margin: 8px auto 0;
}

.tv-user-link-input-wrapper input {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.2s;
}

.tv-user-link-input-wrapper input:focus {
    border-color: rgba(139, 92, 246, 0.5);
}

.tv-user-link-input-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.tv-user-link-play {
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: rgba(139, 92, 246, 0.9);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.tv-user-link-play:hover {
    background: rgba(139, 92, 246, 0.35);
    transform: scale(1.05);
}

.tv-user-link-cancel {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: rgba(239, 68, 68, 0.8);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.tv-user-link-cancel:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* Calm ambience strip under TV controls */
.hall-calm-strip {
    position: relative;
    margin-top: 8px;
    border-radius: 12px;
    padding: 10px 12px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: linear-gradient(180deg, rgba(16, 20, 38, 0.75) 0%, rgba(19, 24, 45, 0.62) 100%);
}

.hall-calm-strip::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 120%, rgba(0, 0, 0, 0.28) 0%, transparent 60%),
        radial-gradient(circle at 15% 5%, rgba(255, 255, 255, 0.04) 0%, transparent 35%);
}

.hall-calm-strip::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.12;
    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(255, 255, 255, 0.08) 0px,
            rgba(255, 255, 255, 0.08) 1px,
            transparent 1px,
            transparent 2px
        );
}

.hall-calm-aurora {
    position: absolute;
    left: -20%;
    right: -20%;
    top: 2px;
    height: 18px;
    border-radius: 999px;
    opacity: 0.5;
    filter: blur(6px);
    background: linear-gradient(90deg, rgba(96, 165, 250, 0.1) 0%, rgba(139, 92, 246, 0.36) 35%, rgba(16, 185, 129, 0.2) 65%, rgba(59, 130, 246, 0.12) 100%);
    animation: calmAuroraDrift 22s ease-in-out infinite alternate;
}

.hall-calm-mantra {
    position: relative;
    z-index: 1;
    margin: 0;
    text-align: center;
    font-size: 0.76rem;
    letter-spacing: 0.45px;
    line-height: 1.55;
    color: rgba(212, 222, 242, 0.75);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    animation: calmMantraPulse 8s ease-in-out infinite;
}

@keyframes calmAuroraDrift {
    0% {
        transform: translateX(-2%) scaleX(1);
    }
    100% {
        transform: translateX(2%) scaleX(1.06);
    }
}

@keyframes calmMantraPulse {
    0%, 100% {
        opacity: 0.72;
    }
    50% {
        opacity: 0.9;
    }
}

/* News Card */
.hall-card-news {
    background: linear-gradient(135deg, var(--bg-elevated) 0%, rgba(34, 197, 94, 0.05) 100%);
    border-color: rgba(34, 197, 94, 0.15);
}

.hall-news-content p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.hall-news-empty {
    color: var(--text-muted) !important;
    font-style: italic;
}

.hall-coming-soon {
    color: rgba(34, 211, 238, 0.3) !important;
    font-style: italic;
}

.hall-motivation-placeholder {
    font-style: normal !important;
    color: rgba(139, 92, 246, 0.4) !important;
    opacity: 1;
    font-size: 0.9375rem !important;
    text-shadow: none !important;
}

.hall-news-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-xs);
    padding: 4px 0;
}

.hall-news-item::before {
    content: "•";
    color: var(--text-muted);
    font-weight: bold;
    flex-shrink: 0;
}

/* Hall Responsive */
@media (max-width: 900px) {
    .hall-container {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .hall-right-col {
        gap: var(--spacing-md);
    }

    .hall-card {
        padding: var(--spacing-md);
    }

    .hall-motivation-quote {
        font-size: 0.875rem;
    }

    .hall-motivation-row {
        flex-direction: column;
    }

    .hall-card-motivation-img {
        width: 100%;
        flex-direction: row;
        padding: var(--spacing-sm);
    }

    .hall-motivation-img-frame {
        width: 80px;
        height: 100px;
    }

}

/* ===================================
   Materials Page - Tab Layout
   =================================== */

/* Tabs Wrapper */
.materials-tabs-wrapper {
    margin-top: var(--spacing-lg);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.materials-tabs-wrapper::-webkit-scrollbar {
    display: none;
}

.materials-tabs {
    display: flex;
    gap: var(--spacing-xs);
    border-bottom: 1px solid var(--bg-tertiary);
    padding-bottom: 0;
    min-width: max-content;
}

.materials-tab {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 10px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    font-family: inherit;
    position: relative;
    bottom: -1px;
}

.materials-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.materials-tab.active {
    color: var(--accent-secondary);
    border-bottom-color: var(--accent-primary);
}

/* "+ New" tab */
.materials-tab-add {
    color: var(--text-muted);
    border: 1px dashed var(--bg-hover);
    border-bottom: 2px solid transparent;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    font-size: 0.8125rem;
    padding: 8px 14px;
}

.materials-tab-add:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    border-bottom-color: transparent;
    background: rgba(139, 92, 246, 0.06);
}

/* Delete icon on active tab */
.materials-tab-delete {
    font-size: 1rem;
    line-height: 1;
    color: var(--text-muted);
    margin-left: 2px;
    padding: 0 2px;
    border-radius: 50%;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.materials-tab-delete:hover {
    color: var(--error);
    background: rgba(239, 68, 68, 0.15);
}

/* Drag & Drop states */
.materials-tab.dragging {
    opacity: 0.4;
    transform: scale(0.95);
}

.materials-tab.drag-over-left {
    box-shadow: -3px 0 0 0 var(--accent-primary);
}

.materials-tab.drag-over-right {
    box-shadow: 3px 0 0 0 var(--accent-primary);
}

.materials-tab[draggable="true"] {
    cursor: grab;
}

.materials-tab[draggable="true"]:active {
    cursor: grabbing;
}

/* Delete confirmation modal input */
#delete-category-input {
    font-family: inherit;
    letter-spacing: 2px;
    text-align: center;
    font-weight: 600;
}

#delete-category-confirm-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#delete-category-confirm-btn:not(:disabled):hover {
    filter: brightness(1.1);
}

.materials-tab-icon {
    font-size: 1.1rem;
}

.materials-tab-count {
    font-size: 0.6875rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 1px 6px;
    border-radius: var(--radius-full);
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

.materials-tab.active .materials-tab-count {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-secondary);
}

/* Tab Content Area */
.materials-content {
    margin-top: var(--spacing-lg);
}

.word-games-overview {
    margin-top: var(--spacing-lg);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: var(--spacing-md);
}

.word-game-card {
    text-align: left;
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(116, 192, 252, 0.14) 0%, rgba(116, 192, 252, 0) 50%),
        linear-gradient(160deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0) 100%),
        var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: calc(var(--radius-lg) + 2px);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
    color: inherit;
    min-height: 148px;
    position: relative;
    box-shadow: 0 8px 22px rgba(2, 6, 23, 0.22);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.word-game-card::before {
    content: "🎮";
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(116, 192, 252, 0.16);
    border: 1px solid rgba(116, 192, 252, 0.35);
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.word-game-card:hover {
    border-color: rgba(116, 192, 252, 0.56);
    transform: translateY(-4px);
    box-shadow: 0 14px 28px rgba(2, 6, 23, 0.34);
}

.word-game-card:nth-child(1)::before {
    content: "🧩";
}

.word-game-card:nth-child(2)::before {
    content: "🎯";
}

.word-game-card:nth-child(3)::before {
    content: "🔤";
}

.word-game-card:nth-child(4)::before {
    content: "🎧";
}

.word-game-card-title {
    font-size: 1.03rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.1px;
}

.word-game-card-desc {
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--text-secondary);
    max-width: 30ch;
}

.word-games-game-area {
    margin-top: var(--spacing-sm);
    position: relative;
}

.word-games-game-top {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 14px;
}

.word-games-back-btn {
    border: 1px solid rgba(116, 192, 252, 0.34);
    background: linear-gradient(145deg, rgba(116, 192, 252, 0.14), rgba(116, 192, 252, 0.04));
    color: var(--text-primary);
    border-radius: 999px;
    width: 34px;
    height: 34px;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(2, 6, 23, 0.26);
    transition: all 0.2s ease;
    position: relative;
    margin: 0 10px 0 0;
    flex-shrink: 0;
    z-index: 4;
}

.word-games-back-btn:hover {
    border-color: rgba(116, 192, 252, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 11px 22px rgba(2, 6, 23, 0.34);
}

.word-games-back-btn:active {
    transform: translateY(0);
}

.word-games-back-icon {
    color: #b9e3ff;
    font-size: 0.95rem;
    line-height: 1;
}

.word-games-host > .page {
    margin-top: 0;
}

.word-games-host .page-header > div:first-child,
.word-games-host .compact-header > div:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.word-games-host .page-header h1,
.word-games-host .compact-header h1 {
    white-space: nowrap;
}

#word-games-page.game-open #word-games-header,
#word-games-page.game-open #word-games-overview {
    display: none !important;
}

.pronunciation-setup,
.pronunciation-game,
.pronunciation-result {
    max-width: 860px;
    margin: 0 auto;
}

.pronunciation-setup-card,
.pronunciation-question-card,
.pronunciation-result-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-tertiary);
    border-radius: 16px;
    padding: 22px;
}

.pronunciation-setup-card {
    text-align: center;
}

.pronunciation-setup-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.pronunciation-count-selector {
    margin: 16px 0 18px;
}

.pronunciation-count-buttons {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.pronunciation-count-btn {
    min-width: 56px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 10px;
    padding: 8px 10px;
    cursor: pointer;
}

.pronunciation-count-btn.active {
    border-color: rgba(167, 139, 250, 0.8);
    color: var(--text-primary);
    background: rgba(167, 139, 250, 0.16);
}

.pronunciation-count-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.pronunciation-progress {
    margin-bottom: 12px;
}

.pronunciation-progress-bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.pronunciation-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
    transition: width 0.25s ease;
}

.pronunciation-progress-info {
    margin-top: 8px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
}

.pronunciation-player-wrap {
    position: relative;
    overflow: hidden;
    height: 320px;
    border: 1px solid var(--bg-tertiary);
    border-radius: 12px;
    padding: 0;
    background: #11131d;
}

#pronunciation-widget {
    width: 100%;
    height: 500px;
}

.pronunciation-helper-row {
    margin: 12px 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.pronunciation-helper-text {
    margin: 0;
    font-size: 0.82rem;
    color: rgba(244, 208, 63, 0.9);
}

.pronunciation-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.pronunciation-option-btn {
    border: 1px solid var(--bg-tertiary);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 10px 12px;
    text-align: left;
    cursor: pointer;
}

.pronunciation-option-btn:disabled {
    cursor: default;
    opacity: 0.7;
}

.pronunciation-option-btn.correct {
    border-color: rgba(110, 231, 183, 0.65);
    background: rgba(16, 185, 129, 0.18);
}

.pronunciation-option-btn.wrong {
    border-color: rgba(248, 113, 113, 0.65);
    background: rgba(239, 68, 68, 0.18);
}

.pronunciation-feedback {
    margin-top: 12px;
    font-size: 0.92rem;
}

.pronunciation-feedback.correct {
    color: #6ee7b7;
}

.pronunciation-feedback.wrong {
    color: #fca5a5;
}

#pronunciation-next-btn {
    margin-top: 14px;
}

.pronunciation-result-card {
    text-align: center;
}

.pronunciation-result-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.pronunciation-result-score {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    margin: 8px 0 16px;
}

.pronunciation-result-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.pronunciation-result-separator {
    font-size: 1.2rem;
    color: var(--text-muted);
}

@media (max-width: 640px) {
    .pronunciation-player-wrap {
        height: 240px;
    }

    #pronunciation-widget {
        height: 400px;
    }

    .pronunciation-options {
        grid-template-columns: 1fr;
    }
}

.materials-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-md);
}

/* Material Card */
.material-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all var(--transition-fast);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.material-card:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

.material-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.material-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-secondary);
    line-height: 1.4;
    transition: color var(--transition-fast);
}

.material-card-link:hover .material-card-title {
    color: var(--accent-primary);
}

.material-card-url {
    font-size: 0.75rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.material-card-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.material-card-actions {
    display: flex;
    gap: var(--spacing-xs);
    justify-content: flex-end;
    opacity: 0;
    transition: opacity var(--transition-fast);
    margin-top: auto;
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--bg-tertiary);
}

.material-card:hover .material-card-actions {
    opacity: 1;
}

.material-action-btn {
    padding: 4px 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0.7;
    transition: all var(--transition-fast);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
}

.material-action-btn:hover {
    opacity: 1;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transform: scale(1.1);
}

/* Empty Tab State */
.materials-empty {
    text-align: center;
    padding: var(--spacing-3xl) var(--spacing-xl);
    color: var(--text-muted);
}

.materials-empty-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.materials-empty p {
    font-size: 0.9375rem;
    margin-bottom: var(--spacing-lg);
}

.materials-empty .btn {
    font-size: 0.875rem;
}

/* Category Icon Picker */
.category-icon-picker {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.category-icon-option {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.category-icon-option:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    transform: scale(1.1);
}

.category-icon-option.selected {
    border-color: var(--accent-primary);
    background: rgba(139, 92, 246, 0.15);
}

textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.6;
}

.input-with-button {
    display: flex;
    gap: var(--spacing-sm);
    align-items: stretch;
}

.input-with-button input {
    flex: 1;
}

/* ===================================
   Landing Page
   =================================== */
.landing-page {
    min-height: 100vh;
    background: var(--bg-primary);
}

/* Landing Nav */
.landing-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(15, 15, 20, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--bg-tertiary);
}

.landing-nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: var(--spacing-md) var(--spacing-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.landing-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-primary);
}

.landing-logo-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 800;
    font-size: 0.95rem;
}

.landing-logo-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-nav-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.landing-nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.landing-nav-link:hover {
    color: var(--text-primary);
}

.landing-nav-btn {
    display: inline-block;
    padding: 8px 20px;
    background: var(--accent-primary);
    color: white;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.landing-nav-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

/* Landing Hero */
.landing-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 100px var(--spacing-xl) var(--spacing-3xl);
    background-image:
        radial-gradient(ellipse at top left, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(99, 102, 241, 0.07) 0%, transparent 50%);
}

.landing-hero-content {
    max-width: 700px;
}

.landing-hero-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
}

.landing-hero-accent {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-hero-desc {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--spacing-2xl);
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.landing-hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-3xl);
}

.landing-hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-2xl);
}

.landing-stat {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.landing-stat-icon {
    font-size: 1.1rem;
}

/* Landing Features */
.landing-features {
    padding: var(--spacing-3xl) var(--spacing-xl);
    background: var(--bg-secondary);
    border-top: 1px solid var(--bg-tertiary);
    border-bottom: 1px solid var(--bg-tertiary);
}

.landing-section-inner {
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
}

.landing-section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.landing-section-desc {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: var(--spacing-3xl);
}

.landing-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-xl);
    text-align: left;
}

.landing-feature-card {
    background: var(--bg-primary);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    transition: all var(--transition-fast);
}

.landing-feature-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.08);
}

.landing-feature-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-md);
}

.landing-feature-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.landing-feature-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 0;
}

/* Landing How It Works */
.landing-how {
    padding: var(--spacing-3xl) var(--spacing-xl);
}

.landing-steps {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: var(--spacing-xl);
    margin-top: var(--spacing-2xl);
}

.landing-step {
    flex: 1;
    max-width: 280px;
    text-align: center;
}

.landing-step-num {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    color: white;
    border-radius: 50%;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 auto var(--spacing-md);
}

.landing-step h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.landing-step p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 0;
}

.landing-step-arrow {
    color: var(--text-secondary);
    font-size: 1.5rem;
    margin-top: 12px;
    opacity: 0.4;
}

/* Landing CTA */
.landing-cta {
    padding: var(--spacing-3xl) var(--spacing-xl);
    background: var(--bg-secondary);
    border-top: 1px solid var(--bg-tertiary);
    text-align: center;
}

.landing-cta h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.landing-cta p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: var(--spacing-xl);
}

/* Landing Footer */
.landing-footer {
    padding: var(--spacing-xl) var(--spacing-xl);
    border-top: 1px solid var(--bg-tertiary);
}

.landing-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.landing-footer-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.landing-footer-copy {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin: 0;
}

/* Auth Modal */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
}

.auth-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.auth-modal .auth-card {
    position: relative;
    z-index: 1;
    animation: authModalIn 0.25s ease;
}

@keyframes authModalIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-modal-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.auth-modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    padding: var(--spacing-2xl);
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--bg-tertiary);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.logo h1 {
    font-size: 1.75rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-form h2 {
    margin-bottom: var(--spacing-xl);
    text-align: center;
    font-size: 1.5rem;
}

.auth-forgot {
    text-align: center;
    margin-top: var(--spacing-md);
    font-size: 0.8125rem;
}

.auth-forgot a {
    color: var(--text-secondary);
    text-decoration: none;
}

.auth-forgot a:hover {
    color: var(--accent-primary);
}

.auth-forgot-desc {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-lg);
    line-height: 1.5;
}

.auth-switch {
    text-align: center;
    margin-top: var(--spacing-xl);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.auth-switch a {
    color: var(--accent-primary);
    font-weight: 500;
}

.auth-error {
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    border-radius: var(--radius-md);
    color: var(--error);
    font-size: 0.875rem;
    text-align: center;
}

/* Landing Page Responsive */
@media (max-width: 768px) {
    .landing-hero-title {
        font-size: 2rem;
    }

    .landing-hero-desc {
        font-size: 1rem;
    }

    .landing-hero-actions {
        flex-direction: column;
    }

    .landing-hero-stats {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .landing-features-grid {
        grid-template-columns: 1fr;
    }

    .landing-steps {
        flex-direction: column;
        align-items: center;
    }

    .landing-step-arrow {
        transform: rotate(90deg);
    }

    .landing-footer-inner {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
}
}

/* ===================================
   App Container & Layout
   =================================== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar - Clean & Minimal */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: var(--bg-secondary);
    border-right: 1px solid var(--bg-tertiary);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* Collapsed Sidebar */
.sidebar.collapsed {
    width: 54px;
}

.sidebar.collapsed .sidebar-header h2,
.sidebar.collapsed .nav-item span:not(.nav-icon),
.sidebar.collapsed .sidebar-footer .speech-bubble-wrapper,
.sidebar.collapsed .sidebar-timer-header .sidebar-timer-label,
.sidebar.collapsed .sidebar-timer-modes,
.sidebar.collapsed .sidebar-timer .pomodoro-controls,
.sidebar.collapsed .sidebar-footer-row #user-name,
.sidebar.collapsed .sidebar-footer-row .sidebar-fullscreen-btn,
.sidebar.collapsed .notif-dropdown,
.sidebar.collapsed .sidebar-header-actions {
    display: none;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: var(--spacing-sm) 4px;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 10px 0;
}

.sidebar.collapsed .nav-icon {
    margin-right: 0;
}

.sidebar.collapsed .sidebar-footer {
    padding: 6px 4px;
    align-items: center;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-timer {
    padding: 6px 4px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar.collapsed .sidebar-timer-header {
    justify-content: center;
    margin-bottom: 4px;
}

.sidebar.collapsed .sidebar-timer-body {
    flex-direction: column;
    gap: 4px;
}

.sidebar.collapsed .pomodoro-ring-container {
    width: 40px;
    height: 40px;
}

.sidebar.collapsed .pomodoro-time {
    font-size: 0.55rem;
    letter-spacing: 0;
}

.sidebar.collapsed .sidebar-footer-row {
    justify-content: center;
    padding: 0;
}

.sidebar.collapsed .user-info {
    padding: 4px;
    justify-content: center;
    flex: none;
}

.sidebar.collapsed .user-avatar {
    margin: 0;
    width: 34px;
    height: 34px;
}

.sidebar.collapsed .nav-menu {
    overflow: hidden;
}

/* Main content adapts to collapsed sidebar */
.main-content.sidebar-collapsed {
    margin-left: 54px;
    max-width: calc(100vw - 54px);
}

/* Sidebar toggle bar — bottom of sidebar */
.sidebar-toggle-bar {
    width: 100%;
    padding: 7px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-top: 1px solid rgba(168, 130, 80, 0.12);
    background: rgba(168, 130, 80, 0.04);
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.sidebar-toggle-bar:hover {
    background: rgba(168, 130, 80, 0.12);
}

.sidebar-toggle-bar:hover .sidebar-toggle-chevron {
    color: rgba(220, 190, 130, 0.95);
}

.sidebar-toggle-chevron {
    color: rgba(200, 180, 150, 0.4);
    font-size: 13px;
    transition: color 0.2s ease, transform 0.3s ease;
    letter-spacing: 4px;
}

.sidebar.collapsed .sidebar-toggle-chevron {
    transform: rotate(180deg);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg) var(--spacing-md);
    border-bottom: 1px solid var(--bg-tertiary);
    position: relative;
}

.sidebar-header h2 {
    font-size: 1.25rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-fullscreen-btn {
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: var(--accent-primary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1.1rem;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.sidebar-fullscreen-btn:hover {
    background: rgba(139, 92, 246, 0.25);
    border-color: var(--accent-primary);
    color: white;
    transform: scale(1.08);
}

.nav-menu {
    list-style: none;
    padding: var(--spacing-md);
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: 10px var(--spacing-md);
    margin-bottom: 4px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(139, 92, 246, 0.1);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(139, 92, 246, 0.2);
    color: rgba(210, 190, 255, 0.95);
    border-right: 2.5px solid rgba(139, 92, 246, 0.6);
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.nav-item:hover .nav-icon svg,
.nav-item.active .nav-icon svg {
    opacity: 1;
}

.sidebar-footer {
    padding: var(--spacing-md);
    border-top: 1px solid var(--bg-tertiary);
}

/* Sidebar Timer */
.sidebar-timer {
    background: linear-gradient(135deg, rgba(18, 14, 31, 0.6) 0%, rgba(26, 16, 48, 0.6) 50%, rgba(15, 13, 30, 0.6) 100%);
    border: 1px solid rgba(168, 130, 80, 0.15);
    border-radius: 10px;
    padding: 8px 10px;
    margin-bottom: 22px;
    position: relative;
    overflow: hidden;
}

.sidebar-timer::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -15%;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(168, 130, 80, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.sidebar-timer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}

.sidebar-timer-label {
    font-size: 0.62rem;
    font-weight: 600;
    color: rgba(168, 130, 80, 0.6);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sidebar-timer .pomodoro-modes {
    gap: 2px;
    padding: 2px;
    border-radius: 6px;
}

.sidebar-timer .pomodoro-mode-btn {
    font-size: 0.58rem;
    padding: 2px 7px;
    border-radius: 4px;
}

.sidebar-timer-body {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.sidebar-timer .pomodoro-ring-container {
    width: 70px;
    height: 70px;
}

.sidebar-timer .pomodoro-time {
    font-size: 0.95rem;
    letter-spacing: 1px;
}

.sidebar-timer .pomodoro-time-input {
    width: 36px;
    font-size: 0.85rem;
}

.sidebar-timer .pomodoro-controls {
    flex-direction: column;
    gap: 6px;
}

.sidebar-timer .pomodoro-start-btn {
    width: 30px;
    height: 30px;
    font-size: 0.7rem;
}

.sidebar-timer .pomodoro-reset-btn {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
}

/* Speech Bubble */
.speech-bubble-wrapper {
    padding: 0 var(--spacing-md) var(--spacing-sm) var(--spacing-md);
}

.speech-bubble {
    position: relative;
    background: linear-gradient(135deg, #facc15 0%, #f59e0b 100%);
    border: none;
    border-radius: 14px;
    padding: 7px 12px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #1a1a2e;
    text-align: center;
    cursor: default;
    box-shadow: 0 2px 10px rgba(250, 204, 21, 0.25);
    animation: bubbleBounce 2s ease-in-out infinite;
}

.speech-bubble span {
    display: inline-block;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 24px;
    width: 11px;
    height: 11px;
    background: linear-gradient(135deg, #f7c825 0%, #f59e0b 100%);
    transform: rotate(45deg);
    border-radius: 0 0 3px 0;
}

@keyframes bubbleBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.sidebar-footer-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex: 1;
    min-width: 0;
}

.user-info:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    overflow: hidden;
    padding: 5px;
    box-sizing: border-box;
    flex-shrink: 0;
}

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

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: var(--spacing-2xl);
    min-height: 100vh;
    background: var(--bg-primary);
    max-width: calc(100vw - var(--sidebar-width));
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Page Layout */
.check-answer-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    user-select: none;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.check-answer-label:hover {
    background: var(--bg-hover);
}

.check-answer-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.check-answer-label span {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.check-answer-checkbox:checked + span {
    color: var(--text-primary);
}

/* Show Answer Style */
.crossword-cell.show-answer {
    background: rgba(5, 150, 105, 0.1) !important;
}

.crossword-cell.show-answer input {
    background: transparent;
}

.crossword-cell.show-answer-correct {
    background: rgba(5, 150, 105, 0.15) !important;
    border-color: rgba(5, 150, 105, 0.4) !important;
}

.crossword-cell.show-answer-wrong {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
}

/* Page Layout */
.page {
    animation: fadeIn 0.3s ease;
    max-width: 1400px;
    margin: 0 auto;
}

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

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-2xl);
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.page-header h1 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(220, 210, 240, 0.75);
}

.compact-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-xl);
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.page-subtitle {
    margin: 4px 0 0;
    font-size: 0.74rem;
    font-style: italic;
    letter-spacing: 0.5px;
    color: rgba(200, 180, 255, 0.45);
    font-weight: 300;
}

.compact-header h1 {
    margin: 0;
    white-space: nowrap;
}

.compact-header > div:first-child {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.words-count-badge {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    padding: 4px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    border: 1px solid var(--bg-elevated);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex: 1;
    justify-content: flex-end;
}

/* ===================================
   My Words Page - Clean Cards
   =================================== */
.search-wrapper {
    position: relative;
    max-width: 320px;
    width: 100%;
}

.search-wrapper input {
    width: 100%;
    padding-left: 40px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--bg-hover);
    border-radius: var(--radius-full);
    height: 40px;
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%239ca3af' viewBox='0 0 24 24'%3E%3Cpath d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
    background-size: 18px;
}

.search-wrapper input:focus {
    background-color: var(--bg-elevated);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.words-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-lg);
}

.word-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    border: 1px solid var(--bg-tertiary);
    transition: all var(--transition-normal);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* Resource Card Styles */
.resource-card-wrapper {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--bg-tertiary);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.resource-card-wrapper:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.resource-card-content {
    padding: var(--spacing-xl);
    flex: 1;
}

.resource-card-main {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.resource-title-link {
    text-decoration: none;
    color: inherit;
    display: inline-block;
    transition: all var(--transition-fast);
}

.resource-title-link:hover .resource-title {
    color: var(--accent-primary);
    transform: translateX(4px);
}

.resource-title {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--accent-secondary);
    margin: 0;
    line-height: 1.4;
    word-wrap: break-word;
    transition: all var(--transition-fast);
    display: inline-block;
    cursor: pointer;
}

.resource-description {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
    word-wrap: break-word;
}

.resource-card-actions {
    display: flex;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-tertiary);
    border-top: 1px solid var(--bg-hover);
    opacity: 0;
    transition: opacity var(--transition-fast);
    justify-content: flex-end;
}

.resource-card-wrapper:hover .resource-card-actions {
    opacity: 1;
}

.resource-action-btn {
    padding: 6px 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.7;
    transition: all var(--transition-fast);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}

.resource-action-btn:hover {
    opacity: 1;
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: scale(1.1);
}

.word-english {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent-secondary);
    line-height: 1.3;
}

.word-card-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity var(--transition-fast);
    margin-top: auto;
    padding-top: var(--spacing-xs);
    justify-content: flex-end;
}

.word-card:hover .word-card-actions,
.resource-card:hover .word-card-actions {
    opacity: 1;
}

.word-card-actions button {
    padding: 4px 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    opacity: 0.7;
    transition: all var(--transition-fast);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
}

.word-card-actions button:hover {
    opacity: 1;
    background: var(--bg-hover);
    color: var(--text-secondary);
    transform: scale(1.1);
}

/* YouGlish button on word card */
.youglish-card-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.youglish-card-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    transform: scale(1.1);
}

.youglish-btn-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    display: block;
}

.word-turkish {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.word-definition {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.word-examples {
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--bg-tertiary);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.word-example-item {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    padding-left: var(--spacing-sm);
    border-left: 2px solid var(--accent-primary);
}

.word-example-item b {
    color: var(--accent-secondary);
    font-weight: 600;
}

.word-examples-toggle {
    background: none;
    border: none;
    color: var(--accent-primary);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    padding: var(--spacing-xs) 0;
    transition: color var(--transition-fast);
}

.word-examples-toggle:hover {
    color: var(--accent-secondary);
}

.word-examples-toggle.expanded {
    color: var(--text-muted);
}

.word-examples-toggle.expanded:hover {
    color: var(--text-secondary);
}

/* Examples Form */
#examples-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.example-entry {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
}

.example-input {
    flex: 1;
    min-height: 36px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9375rem;
    line-height: 1.5;
    outline: none;
    transition: border-color var(--transition-fast);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.example-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.example-input:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
    pointer-events: none;
}

.example-input b {
    color: var(--accent-secondary);
    font-weight: 700;
}

.example-remove-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    margin-top: 4px;
}

.example-remove-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

#add-example-btn {
    align-self: flex-start;
    margin-top: var(--spacing-xs);
    font-size: 0.8125rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--spacing-3xl) var(--spacing-xl);
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-lg);
    display: block;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
    font-size: 1.25rem;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.9375rem;
}

/* ===================================
   Word Selection Grid
   =================================== */
.word-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin: var(--spacing-lg) 0;
    max-height: 500px;
    overflow-y: auto;
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
}

.word-select-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-card);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.word-select-item:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

.word-select-item.selected {
    border-color: var(--accent-primary);
    background: rgba(139, 92, 246, 0.1);
}

.word-select-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

/* ===================================
   Setup Cards - Puzzle
   =================================== */
.puzzle-setup {
    max-width: 1000px;
    margin: 0 auto;
}

.setup-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    border: 1px solid var(--bg-tertiary);
    transition: all var(--transition-fast);
}

.setup-card:hover {
    border-color: var(--bg-hover);
}

.setup-card-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.step-number {
    width: 36px;
    height: 36px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9375rem;
    color: white;
    flex-shrink: 0;
}

.setup-card-header h3 {
    margin: 0;
    font-size: 1.125rem;
    color: var(--text-primary);
    flex: 1;
}

.selection-badge {
    background: var(--accent-primary);
    color: white;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
}

/* Level Buttons */
.level-buttons {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.level-btn {
    padding: 8px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--bg-hover);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 60px;
    text-align: center;
    font-size: 0.9375rem;
}

.level-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
    background: var(--bg-hover);
}

.level-btn.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
}

/* Word Selection Toolbar */
.word-selection-toolbar {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
}

.word-selection-toolbar input[type="text"] {
    flex: 1;
    min-width: 200px;
}

.toolbar-actions {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.toolbar-actions input[type="number"] {
    width: 70px;
    text-align: center;
    padding: 8px;
}

/* Generate Button */
.btn-generate {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
    border-radius: var(--radius-md);
}

/* ===================================
   Crossword Puzzle
   =================================== */
.puzzle-game {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: var(--spacing-xl);
    align-items: start;
    height: calc(100vh - 180px);
    width: 100%;
    overflow: hidden;
}

.puzzle-main-area {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    gap: var(--spacing-md);
}

.puzzle-controls {
    display: flex;
    gap: var(--spacing-sm);
}

.crossword-wrapper {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--bg-tertiary);
    flex: 1;
    overflow: auto;
}

.crossword-grid {
    display: inline-grid;
    gap: 2px;
    background: transparent;
    padding: var(--spacing-lg);
    max-width: 100%;
    max-height: 100%;
}

.crossword-cell {
    width: 32px;
    height: 32px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.crossword-cell.blocked {
    border-color: transparent;
    background: transparent;
}

.crossword-cell:not(.blocked) {
    background: #e5e7eb;
    border: 1px solid #9ca3af;
}

.crossword-cell:not(.blocked):hover {
    background: #fff;
    border-color: #fbbf24;
}

.crossword-cell input {
    width: 100%;
    height: 100%;
    border: none;
    padding: 0;
    margin: 0;
    background: transparent;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #111827;
    font-family: 'Inter', sans-serif;
    outline: none;
    cursor: default;
}

.crossword-cell input:focus {
    cursor: text;
}

.crossword-cell .cell-number {
    position: absolute;
    top: 2px;
    left: 3px;
    font-size: 0.625rem;
    font-weight: 700;
    color: #4b5563;
    pointer-events: none;
}

.crossword-cell.active-word {
    background: #E4D9B9;
    border-color: transparent;
    box-shadow: none;
}

.crossword-cell.active-cell {
    background: #ffffff;
    border-color: #fbbf24;
    box-shadow: 0 0 0 2px #fbbf24;
    transform: scale(1.1);
    z-index: 20;
}

.crossword-cell.active-cell input {
    color: #f59e0b;
}

/* Clues Container */
.clues-container {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--bg-tertiary);
    height: 100%;
    overflow: hidden;
}

.clues-scroll-area {
    padding: var(--spacing-lg);
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

.clue-item.active-clue {
    background: rgba(255, 166, 0, 0.1);
    border-left: 3px solid #fbbf24;
    color: var(--text-primary);
}

.clue-item.clue-correct {
    opacity: 0.6;
    position: relative;
}

.clue-item.clue-correct::before {
    content: '✓';
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    color: #059669;
    font-weight: 700;
    font-size: 1rem;
}

.clue-item.clue-correct .clue-content {
    text-decoration: line-through;
    text-decoration-color: #059669;
    text-decoration-thickness: 2px;
}

/* Check Answer: correct clue */
.clue-item.clue-check-correct {
    border-left: 3px solid #059669;
    background: rgba(5, 150, 105, 0.08);
    opacity: 0.65;
}

.clue-item.clue-check-correct .clue-content {
    text-decoration: line-through;
    text-decoration-color: #059669;
    text-decoration-thickness: 2px;
}

/* Check Answer: wrong/empty clue */
.clue-item.clue-check-wrong {
    border-left: 3px solid #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.clue-item.clue-check-wrong .clue-content {
    font-weight: 600;
}

.clues-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.clues-section h3 {
    margin: 0 calc(-1 * var(--spacing-lg));
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-bottom: 1px solid var(--bg-tertiary);
    position: sticky;
    top: calc(-1 * var(--spacing-lg));
    background: var(--bg-card);
    z-index: 5;
}

.clue-item {
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    color: var(--text-secondary);
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--spacing-sm);
    outline: none;
}

.clue-content {
    flex: 1;
    text-align: left;
}

.clue-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.clue-item:focus {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.clue-number {
    font-weight: 700;
    color: var(--accent-primary);
    margin-right: 6px;
}

.btn-hint {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.6;
    flex-shrink: 0;
    transition: all var(--transition-fast);
    margin-top: 2px;
}

.btn-hint:hover,
.btn-hint.active {
    background: var(--accent-primary);
    color: white;
    opacity: 1;
}

.clue-hint {
    font-style: italic;
    color: var(--accent-secondary);
    font-weight: 500;
    margin-left: 6px;
}

.clue-hint.hidden {
    display: none;
}


/* ===================================
   Youglish Page
   =================================== */
.youglish-content {
    max-width: 900px;
    margin: 0 auto;
}

.youglish-word-list {
    margin-bottom: var(--spacing-xl);
}

.youglish-status {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: var(--spacing-lg);
}

.youglish-word-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.word-chip {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-full);
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    font-weight: 500;
}

.word-chip:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

/* ===================================
   Modal - Modern & Clean
   =================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 520px;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--bg-tertiary);
    animation: modalIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-xl);
    border-bottom: 1px solid var(--bg-tertiary);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition-fast);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

#word-form,
#resource-form {
    padding: var(--spacing-xl);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--bg-tertiary);
}


/* ===================================
   Loading & Toast
   =================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay p {
    margin-top: var(--spacing-lg);
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.toast-container {
    position: fixed;
    bottom: var(--spacing-xl);
    right: var(--spacing-xl);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.toast {
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border-left: 3px solid var(--accent-primary);
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 380px;
    font-size: 0.9375rem;
    border: 1px solid var(--bg-tertiary);
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--error);
}

.toast.warning {
    border-left-color: var(--warning);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 1024px) {
    .puzzle-game {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .clues-container {
        max-height: 400px;
    }
}

/* Mobile Top Bar */
.mobile-topbar {
    display: none;
}

.sidebar-overlay {
    display: none;
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }

    /* Mobile Top Bar */
    .mobile-topbar {
        display: flex;
        align-items: center;
        gap: var(--spacing-md);
        padding: var(--spacing-sm) var(--spacing-md);
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--bg-tertiary);
        position: sticky;
        top: 0;
        z-index: 90;
        height: 52px;
    }

    .mobile-topbar-title {
        font-size: 1.1rem;
        font-weight: 700;
        background: var(--accent-gradient);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    .mobile-menu-btn {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 36px;
        height: 36px;
        padding: 8px;
        background: none;
        border: none;
        cursor: pointer;
    }

    .mobile-menu-btn span {
        display: block;
        width: 100%;
        height: 2px;
        background: var(--text-primary);
        border-radius: 2px;
        transition: all var(--transition-fast);
    }

    /* Sidebar Overlay */
    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 99;
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-normal);
    }

    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* Sidebar */
    .sidebar {
        transform: translateX(-100%);
        width: 270px;
        transition: transform var(--transition-normal);
    }

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

    /* Main Content */
    .main-content {
        margin-left: 0;
        padding: var(--spacing-md);
        max-width: 100vw;
    }

    /* Page Headers */
    .page-header,
    .compact-header {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: var(--spacing-lg);
    }

    .page-header h1,
    .compact-header h1 {
        font-size: 1rem;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .search-wrapper {
        max-width: 100%;
    }

    /* Word Cards */
    .words-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .word-card {
        padding: var(--spacing-lg);
    }

    .word-selection-grid {
        grid-template-columns: 1fr;
    }

    .input-with-button {
        flex-direction: column;
    }

    /* Materials - mobile grid */
    .materials-list {
        grid-template-columns: 1fr;
    }

    /* Modals */
    .modal-content {
        max-width: calc(100vw - 24px);
        margin: var(--spacing-sm);
    }

    /* Toast */
    .toast-container {
        left: var(--spacing-md);
        right: var(--spacing-md);
    }

    .toast {
        max-width: 100%;
    }

    /* Profile */
    .profile-container {
        padding: 0;
    }

    .profile-card {
        padding: var(--spacing-lg);
    }

    /* Puzzle */
    .puzzle-setup .setup-card {
        padding: var(--spacing-lg);
    }

    .word-selection-toolbar {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    /* Context Master */
    .context-setup-card {
        padding: var(--spacing-xl) var(--spacing-lg);
    }

    /* Fullscreen button - hide on mobile */
    .sidebar-fullscreen-btn {
        display: none;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bg-hover);
}

/* ===================================
   Profile Page Styles
   =================================== */

.profile-container {
    max-width: 500px;
    margin: 0 auto;
}

.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-2xl);
    text-align: center;
}

.profile-avatar-large {
    margin-bottom: var(--spacing-md);
    width: 96px;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
    background: var(--bg-tertiary);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 3px solid transparent;
    overflow: hidden;
    padding: 12px;
    box-sizing: border-box;
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.profile-avatar-large:hover {
    transform: scale(1.08);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}

.avatar-picker {
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.avatar-picker-title {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.avatar-picker-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-xs);
    max-width: 320px;
    margin: 0 auto;
}

.avatar-option {
    width: 56px;
    height: 56px;
    padding: 8px;
    border: 2px solid var(--bg-tertiary);
    border-radius: 50%;
    background: var(--bg-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    overflow: hidden;
    box-sizing: border-box;
}

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

.avatar-option:hover {
    border-color: var(--accent);
    transform: scale(1.15);
    background: var(--bg-tertiary);
}

.avatar-option.selected {
    border-color: var(--accent);
    background: rgba(139, 92, 246, 0.15);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.profile-details {
    text-align: left;
}

.profile-field {
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--bg-tertiary);
}

.profile-field:last-child {
    border-bottom: none;
}

.profile-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-xs);
}

.profile-field p {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.profile-nickname-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.btn-edit-nickname {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    opacity: 0.5;
    transition: all var(--transition-fast);
    padding: 2px 4px;
    border-radius: var(--radius-sm);
}

.btn-edit-nickname:hover {
    opacity: 1;
    background: var(--bg-hover);
}

.nickname-edit-form {
    margin-top: var(--spacing-sm);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.nickname-edit-form input {
    padding: 8px 12px;
    font-size: 0.9375rem;
}

.nickname-edit-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.profile-card-section {
    margin-top: var(--spacing-lg);
    text-align: left;
}

.profile-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
}

.profile-form .form-group {
    margin-bottom: var(--spacing-md);
}

.profile-form .btn-full {
    margin-top: var(--spacing-md);
}

.export-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-lg);
}

.export-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.export-btn {
    justify-content: center;
}

.profile-actions {
    margin-top: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.profile-action-btn {
    padding: var(--spacing-md);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
}

.profile-logout-btn {
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.profile-logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}


/* ===================================
   Context Master Game
   =================================== */

/* Setup Screen */
.context-setup {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.context-setup-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-3xl) var(--spacing-2xl);
    text-align: center;
    max-width: 480px;
    width: 100%;
}

.context-setup-icon {
    font-size: 3.5rem;
    margin-bottom: var(--spacing-lg);
}

.context-setup-card h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.context-setup-card .text-muted {
    margin-bottom: var(--spacing-xl);
}

.context-count-selector {
    margin-bottom: var(--spacing-xl);
}

.context-count-selector label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    font-weight: 500;
}

.context-count-buttons {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
}

.context-count-btn {
    width: 56px;
    height: 44px;
    border-radius: var(--radius-md);
    border: 1px solid var(--bg-tertiary);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.context-count-btn:hover:not(:disabled) {
    border-color: var(--accent-primary);
    color: var(--accent-secondary);
    background: rgba(139, 92, 246, 0.08);
}

.context-count-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}

.context-count-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.context-count-input {
    width: 56px;
    height: 44px;
    border-radius: var(--radius-md);
    border: 1px solid var(--bg-tertiary);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    outline: none;
    transition: all 0.2s;
    -moz-appearance: textfield;
}

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

.context-count-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.15);
}

.context-count-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.85rem;
}

/* Game Screen */
.context-game {
    max-width: 680px;
    margin: 0 auto;
}

.context-progress {
    margin-bottom: var(--spacing-xl);
}

.context-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: var(--spacing-sm);
}

.context-progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 3px;
    transition: width 0.4s ease;
    width: 0%;
}

.context-progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Question Card */
.context-question-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-2xl);
}

.context-word-title {
    text-align: center;
    font-size: 0.90rem;
    font-weight: 600;
    color: var(--accent-primary);
    padding-bottom: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--bg-tertiary);
    letter-spacing: 0.02em;
    opacity: 0.85;
}

.context-sentence {
    font-size: 1.25rem;
    line-height: 1.8;
    color: var(--text-primary);
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--bg-tertiary);
}

.context-highlight {
    color: var(--accent-secondary);
    font-weight: 700;
}

/* Options */
.context-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.context-option {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.context-option:hover:not(:disabled) {
    border-color: var(--accent-primary);
    background: rgba(139, 92, 246, 0.06);
    transform: translateY(-1px);
}

.context-option:disabled {
    cursor: default;
    transform: none !important;
}

.context-option.correct {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.context-option.correct .context-option-label {
    background: var(--success);
    color: #fff;
}

.context-option.wrong {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

.context-option.wrong .context-option-label {
    background: var(--error);
    color: #fff;
}

.context-option-label {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.8125rem;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.context-option-text {
    line-height: 1.4;
}

/* Feedback */
.context-feedback {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    text-align: center;
    font-weight: 500;
    font-size: 0.9375rem;
}

.context-feedback.correct {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: var(--success);
}

.context-feedback.wrong {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.context-feedback .feedback-icon {
    font-weight: 700;
    margin-right: var(--spacing-xs);
}

.context-feedback strong {
    color: var(--success);
}

/* Next Button */
.context-next-btn {
    width: 100%;
    font-size: 1rem;
    padding: var(--spacing-md);
}

/* Result Screen */
.context-result {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.context-result-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-3xl) var(--spacing-2xl);
    text-align: center;
    max-width: 520px;
    width: 100%;
}

.context-result-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-lg);
}

.context-result-card h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xl);
}

.context-result-score {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.context-result-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent-secondary);
}

.context-result-separator {
    font-size: 2rem;
    color: var(--text-muted);
    font-weight: 300;
}

.context-result-percentage {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-2xl);
    font-weight: 600;
}

/* Wrong Answers Review */
.context-result-wrong {
    margin-bottom: var(--spacing-xl);
    text-align: left;
}

.context-result-wrong h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--bg-tertiary);
}

.context-wrong-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.context-wrong-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--error);
}

.context-wrong-word {
    font-weight: 600;
    color: var(--accent-secondary);
    min-width: 100px;
}

.context-wrong-meaning {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

#context-play-again-btn {
    width: 100%;
    margin-top: var(--spacing-md);
}

/* Responsive for Context Master */
@media (max-width: 640px) {
    .context-options {
        grid-template-columns: 1fr;
    }

    .context-sentence {
        font-size: 1.1rem;
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .context-question-card {
        padding: var(--spacing-lg);
    }

    .context-result-number {
        font-size: 2.5rem;
    }
}

/* ===================================
   Jumble Game
   =================================== */

.jumble-setup {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.jumble-setup-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-3xl) var(--spacing-2xl);
    text-align: center;
    max-width: 480px;
    width: 100%;
}

.jumble-setup-icon {
    font-size: 3.5rem;
    margin-bottom: var(--spacing-lg);
}

.jumble-setup-card h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.jumble-setup-card .text-muted {
    margin-bottom: var(--spacing-xl);
}

.jumble-count-selector {
    margin-bottom: var(--spacing-xl);
}

.jumble-count-selector label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    font-weight: 500;
}

.jumble-count-buttons {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
}

.jumble-count-btn {
    width: 56px;
    height: 44px;
    border-radius: var(--radius-md);
    border: 1px solid var(--bg-tertiary);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.jumble-count-btn:hover:not(:disabled) {
    border-color: var(--accent-primary);
    color: var(--accent-secondary);
    background: rgba(139, 92, 246, 0.08);
}

.jumble-count-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}

.jumble-count-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.jumble-count-input {
    width: 56px;
    height: 44px;
    border-radius: var(--radius-md);
    border: 1px solid var(--bg-tertiary);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    outline: none;
    transition: all 0.2s;
    -moz-appearance: textfield;
}

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

.jumble-count-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.15);
}

.jumble-count-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.85rem;
}

.jumble-game {
    max-width: 760px;
    margin: 0 auto;
}

.jumble-progress {
    margin-bottom: var(--spacing-xl);
}

.jumble-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: var(--spacing-sm);
}

.jumble-progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 3px;
    transition: width 0.4s ease;
    width: 0%;
}

.jumble-progress-info {
    display: flex;
    justify-content: flex-end;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.jumble-question-card {
    background: var(--bg-card);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: var(--radius-lg);
    padding: 24px 22px 20px;
    box-shadow: none;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 580px;
}

.jumble-definition {
    font-size: 1.08rem;
    line-height: 1.75;
    color: rgba(226, 232, 240, 0.95);
    text-align: center;
    padding: 14px 16px;
    margin: 0 auto 10px;
    max-width: 96%;
    background: rgba(15, 23, 42, 0.3);
    border-radius: var(--radius-md);
    border: none;
}

.jumble-answer-wrap {
    position: relative;
    margin: 4px 0 10px;
}

.jumble-answer-slots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
    gap: 8px;
    min-height: 56px;
    outline: none;
}

.jumble-word-group {
    display: inline-flex;
    align-items: flex-end;
    gap: 8px;
    white-space: nowrap;
}

.jumble-slot-space {
    width: 14px;
    flex: 0 0 14px;
}

.jumble-answer-input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.jumble-slot {
    width: 32px;
    height: 42px;
    border-bottom: 2px solid rgba(148, 163, 184, 0.46);
    border-radius: 0;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.04rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    user-select: none;
    transition: border-color 0.18s ease, color 0.18s ease;
}

.jumble-slot.filled {
    border-bottom-color: rgba(148, 163, 184, 0.9);
}

.jumble-slot.cursor {
    position: relative;
}

.jumble-slot.cursor::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 20px;
    background: rgba(203, 213, 225, 0.9);
    border-radius: 2px;
    animation: jumbleCaretBlink 0.9s steps(1, end) infinite;
}

.jumble-slot.correct {
    color: #6ee7b7;
    border-bottom-color: rgba(110, 231, 183, 0.78);
    text-shadow: none;
}

.jumble-slot.giveup {
    color: rgba(203, 213, 225, 0.92);
    border-bottom-color: rgba(148, 163, 184, 0.56);
}

.jumble-slot.static {
    border-bottom-color: transparent;
    color: var(--text-muted);
    opacity: 0.55;
    background: transparent;
}

.jumble-hint {
    margin: 0 auto 6px;
    padding: 6px 12px;
    border-radius: 8px;
    border: none;
    background: rgba(15, 23, 42, 0.26);
    color: #c88442;
    text-align: center;
    font-size: 0.86rem;
    font-weight: 500;
    letter-spacing: 0.2px;
    text-shadow: none;
    max-width: 84%;
}

.jumble-actions {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    margin-top: auto;
    margin-bottom: 66px;
    flex-wrap: wrap;
}

.jumble-feedback-zone {
    min-height: 165px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
}

.jumble-shortcuts-wrap {
    display: flex;
    justify-content: center;
    position: absolute;
    top: auto;
    bottom: 4px;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    z-index: 3;
    width: 28px;
    pointer-events: none;
}

.jumble-shortcuts-panel {
    position: absolute;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    bottom: 36px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 5px 8px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(15, 23, 42, 0.72);
    color: rgba(148, 163, 184, 0.82);
    font-size: 0.68rem;
    width: max-content;
    max-width: 420px;
    pointer-events: auto;
}

.jumble-shortcuts-panel kbd {
    font-family: inherit;
    font-size: 0.68rem;
    color: rgba(226, 232, 240, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(30, 41, 59, 0.5);
    border-radius: 4px;
    padding: 1px 4px;
    line-height: 1.2;
}

.jumble-shortcuts-close {
    border: none;
    background: transparent;
    color: rgba(148, 163, 184, 0.75);
    cursor: pointer;
    font-size: 0.78rem;
    padding: 0 2px;
}

.jumble-shortcuts-close:hover {
    color: rgba(226, 232, 240, 0.95);
}

#jumble-shortcuts-show-btn {
    min-width: 28px;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 999px;
    font-size: 0.82rem;
    opacity: 0.45;
    border: 1px solid rgba(148, 163, 184, 0.12);
    pointer-events: auto;
}

#jumble-shortcuts-show-btn:hover {
    opacity: 0.85;
}

.jumble-icon-btn {
    min-width: 34px;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 8px;
    font-size: 1rem;
}

.jumble-actions .btn {
    min-width: 92px;
    border-radius: 8px;
}

.jumble-hint-anchor {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 42px;
    margin-bottom: 12px;
}


.jumble-feedback {
    width: auto;
    margin: 0;
    padding: 2px 0;
    border-radius: 0;
    text-align: center;
    font-weight: 600;
    font-size: 1.02rem;
    line-height: 1;
}

.jumble-feedback.correct {
    background: transparent;
    border: none;
    color: #6ee7b7;
}

.jumble-feedback.wrong {
    background: transparent;
    border: none;
    color: #fca5a5;
}

.jumble-feedback strong {
    color: rgba(226, 232, 240, 0.95);
    margin-left: 8px;
    font-size: 0.92rem;
    font-weight: 600;
}

.jumble-result {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.jumble-result-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-3xl) var(--spacing-2xl);
    text-align: center;
    max-width: 520px;
    width: 100%;
}

.jumble-result-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-lg);
}

.jumble-result-card h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xl);
}

.jumble-result-score {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.jumble-result-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent-secondary);
}

.jumble-result-separator {
    font-size: 2rem;
    color: var(--text-muted);
    font-weight: 300;
}

.jumble-result-percentage {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-2xl);
    font-weight: 600;
}

.jumble-result-wrong {
    margin-bottom: var(--spacing-xl);
    text-align: left;
}

.jumble-result-wrong h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--bg-tertiary);
}

.jumble-wrong-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.jumble-wrong-item {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--error);
}

.jumble-wrong-def {
    color: var(--text-primary);
    font-size: 0.88rem;
    margin-bottom: 4px;
}

.jumble-wrong-word,
.jumble-wrong-hint {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

#jumble-play-again-btn {
    width: 100%;
    margin-top: var(--spacing-md);
}

@media (max-width: 640px) {
    .jumble-question-card {
        padding: var(--spacing-lg);
        min-height: 520px;
    }

    .jumble-definition {
        font-size: 1.02rem;
        padding: var(--spacing-md);
    }

    .jumble-slot {
        width: 28px;
        height: 38px;
        font-size: 0.98rem;
    }

    .jumble-word-group {
        gap: 6px;
    }

    .jumble-slot-space {
        width: 10px;
        flex-basis: 10px;
    }

    .jumble-actions .btn {
        min-width: 86px;
    }

    .jumble-feedback-zone {
        min-height: 120px;
    }

    .jumble-shortcuts-panel {
        font-size: 0.68rem;
        gap: 8px;
        padding: 6px 8px;
    }

    .jumble-shortcuts-wrap {
        top: auto;
        bottom: 4px;
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }

    .jumble-shortcuts-panel {
        max-width: 280px;
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        bottom: 34px;
        justify-content: flex-start;
    }

    .jumble-result-number {
        font-size: 2.5rem;
    }

}

@keyframes jumbleCaretBlink {
    0%, 40% {
        opacity: 1;
    }
    50%, 100% {
        opacity: 0;
    }
}

/* ===================================
   YouGlish Modal
   =================================== */

.youglish-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
}

.youglish-modal.hidden {
    display: none;
}

.youglish-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.youglish-modal-content {
    position: relative;
    width: 100%;
    max-width: 720px;
    background: var(--bg-card);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}

.youglish-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--bg-tertiary);
}

.youglish-modal-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.youglish-widget-wrapper {
    padding: var(--spacing-md);
    min-height: 200px;
}

.youglish-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-top: 1px solid var(--bg-tertiary);
    font-size: 0.75rem;
}

.youglish-powered {
    color: var(--text-muted);
}

.youglish-powered a {
    color: var(--accent-secondary);
    text-decoration: none;
}

.youglish-powered a:hover {
    text-decoration: underline;
}

.youglish-track-info {
    color: var(--text-muted);
    font-size: 0.75rem;
}

@media (max-width: 768px) {
    .youglish-modal {
        padding: var(--spacing-sm);
    }

    .youglish-modal-content {
        max-width: 100%;
    }
}

/* ===================================
   Sticky Notes Panel
   =================================== */

/* Floating Action Button */
.notes-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3) 0%, rgba(109, 40, 217, 0.35) 100%);
    border: 1px solid rgba(139, 92, 246, 0.35);
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35), 0 0 20px rgba(139, 92, 246, 0.2);
    z-index: 900;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    animation: fabPulse 3s ease-in-out infinite;
}

@keyframes fabPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(0,0,0,0.35), 0 0 20px rgba(139,92,246,0.2); }
    50% { box-shadow: 0 4px 20px rgba(0,0,0,0.35), 0 0 28px rgba(139,92,246,0.35); }
}

.notes-fab svg {
    width: 21px;
    height: 21px;
    stroke: rgba(220, 200, 255, 0.85);
    transition: all 0.3s ease;
}

.notes-fab:hover {
    transform: translateY(-2px) scale(1.05);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.4) 0%, rgba(109, 40, 217, 0.45) 100%);
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.4), 0 0 30px rgba(139, 92, 246, 0.3);
    animation: none;
}

.notes-fab:hover svg {
    stroke: #fff;
}

.notes-fab.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.35) 0%, rgba(109, 40, 217, 0.4) 100%);
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35), 0 0 22px rgba(139, 92, 246, 0.25);
    animation: none;
}

.notes-fab.active svg {
    stroke: #fff;
}

/* Panel */
.notes-panel {
    position: fixed;
    bottom: 88px;
    right: 24px;
    width: 360px;
    max-height: 500px;
    background: var(--bg-elevated);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    z-index: 900;
    display: flex;
    flex-direction: column;
    animation: notesPanelIn 0.25s ease;
    overflow: hidden;
}

@keyframes notesPanelIn {
    from { opacity: 0; transform: translateY(12px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Panel Header */
.notes-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--bg-tertiary);
    flex-shrink: 0;
}

.notes-panel-header h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.notes-panel-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.notes-add-btn {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border: none;
    padding: 4px 12px;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.notes-add-btn:hover {
    background: rgba(245, 158, 11, 0.2);
}

.notes-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color var(--transition-fast);
}

.notes-close-btn:hover {
    color: var(--text-primary);
}

/* Notes List */
.notes-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-sm);
    scrollbar-width: thin;
}

.notes-list::-webkit-scrollbar {
    width: 4px;
}

.notes-list::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

/* Note Card in List */
.note-card {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
    margin-bottom: 2px;
}

.note-card:hover {
    background: var(--bg-hover);
}

.note-card-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.note-card-preview {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.note-card-date {
    font-size: 0.625rem;
    color: var(--text-muted);
    opacity: 0.6;
    margin-top: 2px;
}

/* Note Color Indicators */
.note-card[data-color="yellow"] { border-left-color: #f59e0b; }
.note-card[data-color="blue"] { border-left-color: #3b82f6; }
.note-card[data-color="green"] { border-left-color: #22c55e; }
.note-card[data-color="pink"] { border-left-color: #ec4899; }
.note-card[data-color="purple"] { border-left-color: #8b5cf6; }

/* Empty State */
.notes-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl) var(--spacing-md);
    color: var(--text-muted);
    text-align: center;
}

.notes-empty-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
    opacity: 0.4;
}

.notes-empty p {
    font-size: 0.8125rem;
    margin: 0;
    opacity: 0.6;
}

.notes-see-all {
    text-align: center;
    padding: 10px;
    font-size: 0.8rem;
    color: var(--primary-color, #6c63ff);
    cursor: pointer;
    border-top: 1px solid var(--border-color, #2a2a4a);
    margin-top: 4px;
    transition: background 0.15s;
    border-radius: 0 0 8px 8px;
}

.notes-see-all:hover {
    background: rgba(108, 99, 255, 0.1);
}

/* Note Editor */
.notes-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.notes-editor-title {
    border: none;
    border-bottom: 1px solid var(--bg-tertiary);
    background: transparent;
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
    flex-shrink: 0;
}

.notes-editor-title::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.notes-editor-body {
    flex: 1;
    border: none;
    background: transparent;
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-family: inherit;
    line-height: 1.7;
    resize: none;
    outline: none;
    min-height: 200px;
}

.notes-editor-body::placeholder {
    color: var(--text-muted);
}

.notes-editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-top: 1px solid var(--bg-tertiary);
    flex-shrink: 0;
}

.notes-editor-status {
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-style: italic;
}

.notes-editor-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.notes-delete-btn {
    background: transparent !important;
    color: var(--text-muted) !important;
    border: none !important;
    font-size: 0.8rem;
    padding: 4px 8px !important;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.notes-delete-btn:hover {
    color: var(--error) !important;
    background: rgba(239, 68, 68, 0.1) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .notes-fab {
        bottom: 16px;
        right: 16px;
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }

    .notes-fab svg {
        width: 18px;
        height: 18px;
    }

    .notes-panel {
        bottom: 72px;
        right: 12px;
        left: 12px;
        width: auto;
        max-height: 60vh;
    }
}

/* =========================
   Notes Full Page
========================= */
.notes-page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    padding: 4px 0;
}

.note-page-card {
    background: var(--card-bg, #1a1a2e);
    border-radius: 12px;
    padding: 18px;
    cursor: pointer;
    transition: transform 0.18s, box-shadow 0.18s;
    border-left: 5px solid var(--note-color, #ff9800);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.note-page-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.25);
}

.note-page-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color, #e0e0ff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.note-page-card-preview {
    font-size: 0.85rem;
    color: var(--muted-text, #8888aa);
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    line-height: 1.5;
}

.note-page-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--muted-text, #666);
    margin-top: auto;
}

.note-page-card-date {
    opacity: 0.7;
}

.note-page-card-chars {
    opacity: 0.5;
    font-size: 0.7rem;
}

/* Notes Page Editor */
.notes-page-editor {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 800px;
    margin: 0 auto;
}

.notes-page-editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.notes-page-editor-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notes-page-save-status {
    font-size: 0.8rem;
    color: var(--muted-text, #888);
    font-style: italic;
}

.notes-page-delete-btn {
    color: #ff6b6b !important;
}

.notes-page-delete-btn:hover {
    background: rgba(255, 107, 107, 0.1) !important;
}

.notes-page-title-input {
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--border-color, #2a2a4a);
    color: var(--text-color, #e0e0ff);
    font-size: 1.4rem;
    font-weight: 700;
    padding: 8px 4px;
    outline: none;
    transition: border-color 0.2s;
}

.notes-page-title-input:focus {
    border-bottom-color: var(--primary-color, #6c63ff);
}

.notes-page-title-input::placeholder {
    color: var(--muted-text, #555);
}

/* Rich Text Toolbar */
.notes-rich-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: rgba(30, 28, 50, 0.7);
    border: 1px solid var(--border-color, #2a2a4a);
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    flex-wrap: wrap;
}

.nrt-btn {
    width: 30px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: rgba(200, 195, 220, 0.75);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s;
}

.nrt-btn:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.25);
    color: #e0e0ff;
}

.nrt-btn.active {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.35);
    color: #c4b5fd;
}

.nrt-color {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    padding: 0;
    position: relative;
}

.nrt-color::after {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--dot);
    box-shadow: 0 0 3px rgba(0,0,0,0.3);
}

.nrt-color:hover {
    border-color: var(--dot);
    background: rgba(255,255,255,0.05);
}

.nrt-sep {
    width: 1px;
    height: 18px;
    background: rgba(200, 195, 220, 0.12);
    margin: 0 4px;
    flex-shrink: 0;
}

.nrt-font-select {
    background: rgba(30, 28, 50, 0.6);
    border: 1px solid rgba(200, 195, 220, 0.15);
    border-radius: 6px;
    color: rgba(200, 195, 220, 0.75);
    font-size: 0.7rem;
    padding: 3px 4px;
    width: 62px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
}

.nrt-font-select:hover,
.nrt-font-select:focus {
    border-color: rgba(139, 92, 246, 0.35);
}

.nrt-font-select option {
    background: #1a1a2e;
    color: #e0e0ff;
}

/* Rich Editor Body */
.notes-page-body-input {
    background: var(--card-bg, #1a1a2e);
    border: 1px solid var(--border-color, #2a2a4a);
    border-radius: 0 0 12px 12px;
    color: var(--text-color, #e0e0ff);
    font-size: 1rem;
    line-height: 1.7;
    padding: 16px;
    min-height: 550px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
    overflow-y: auto;
    word-wrap: break-word;
}

.notes-page-body-input:focus {
    border-color: var(--primary-color, #6c63ff);
}

.notes-page-body-input:empty::before {
    content: attr(data-placeholder);
    color: var(--muted-text, #555);
    pointer-events: none;
}

.notes-page-body-input ul,
.notes-page-body-input ol {
    padding-left: 24px;
    margin: 4px 0;
}

.notes-page-body-input ol {
    list-style-type: decimal;
}

#notes-count {
    font-size: 0.8rem;
    color: var(--muted-text, #888);
    margin-left: 8px;
}

@media (max-width: 768px) {
    .notes-page-grid {
        grid-template-columns: 1fr;
    }

    .notes-page-body-input {
        min-height: 250px;
    }

    .notes-page-editor-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =========================
   Quick Panel Tabs
========================= */
.quick-panel-tabs {
    display: flex;
    gap: 2px;
    background: var(--bg-tertiary, #1a1a2e);
    border-radius: 8px;
    padding: 2px;
}

.quick-panel-tab {
    padding: 5px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted, #888);
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.quick-panel-tab:hover {
    color: var(--text-primary, #e0e0ff);
}

.quick-panel-tab.active {
    background: var(--primary-color, #6c63ff);
    color: #fff;
}

.quick-panel-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

/* Panel Todo List */
.panel-todo-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.panel-todo-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.12s;
    border-bottom: 1px solid var(--bg-tertiary, #1a1a2e);
}

.panel-todo-item:hover {
    background: var(--bg-tertiary, #1a1a2e);
}

.panel-todo-item.completed .panel-todo-text {
    text-decoration: line-through;
    opacity: 0.45;
}

.panel-todo-check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--text-muted, #666);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    cursor: pointer;
    background: transparent;
    padding: 0;
}

.panel-todo-check.checked {
    background: #059669;
    border-color: #059669;
    color: #fff;
    font-size: 0.6rem;
}

.panel-todo-text {
    flex: 1;
    font-size: 0.825rem;
    color: var(--text-primary, #e0e0ff);
    line-height: 1.3;
}

.panel-todo-priority {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.panel-todo-empty {
    padding: 24px 12px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted, #666);
    opacity: 0.6;
}

.panel-todo-see-all {
    text-align: center;
    padding: 10px;
    font-size: 0.8rem;
    color: var(--primary-color, #6c63ff);
    cursor: pointer;
    border-top: 1px solid var(--border-color, #2a2a4a);
    margin-top: 4px;
    transition: background 0.15s;
}

.panel-todo-see-all:hover {
    background: rgba(108, 99, 255, 0.1);
}

/* =========================
   To-Do Full Page
========================= */
.todo-filter-tabs {
    display: flex;
    gap: 2px;
    background: var(--bg-tertiary, #1a1a2e);
    border-radius: 8px;
    padding: 2px;
}

.todo-filter-btn {
    padding: 6px 16px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted, #888);
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.todo-filter-btn:hover {
    color: var(--text-primary, #e0e0ff);
}

.todo-filter-btn.active {
    background: var(--primary-color, #6c63ff);
    color: #fff;
}

.todo-add-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    margin-bottom: 8px;
}

.todo-add-bar input {
    flex: 1;
    padding: 10px 14px;
    font-size: 0.9375rem;
    border-radius: 10px;
    border: 1px solid var(--border-color, #2a2a4a);
    background: var(--card-bg, #1a1a2e);
    color: var(--text-color, #e0e0ff);
    outline: none;
    transition: border-color 0.2s;
}

.todo-add-bar input:focus {
    border-color: var(--primary-color, #6c63ff);
}

.todo-add-bar input::placeholder {
    color: var(--muted-text, #555);
}

.todo-add-priority {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #2a2a4a);
    background: var(--card-bg, #1a1a2e);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.15s;
}

.todo-add-priority:hover {
    border-color: var(--primary-color, #6c63ff);
}

.todo-priority-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.todo-priority-dot.priority-high { background: #ef4444; }
.todo-priority-dot.priority-medium { background: #f59e0b; }
.todo-priority-dot.priority-low { background: #3b82f6; }

/* Todo List Items */
.todos-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--card-bg, #1a1a2e);
    border-radius: 10px;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s, background 0.15s;
    border-left: 4px solid var(--todo-priority-color, #3b82f6);
    position: relative;
}

.todo-item:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

/* Drag handle */
.todo-drag-handle {
    cursor: grab;
    color: rgba(255,255,255,0.15);
    font-size: 0.85rem;
    padding: 4px 2px;
    flex-shrink: 0;
    user-select: none;
    transition: color 0.15s;
    line-height: 1;
    letter-spacing: 1px;
}

.todo-drag-handle:active {
    cursor: grabbing;
}

.todo-item:hover .todo-drag-handle {
    color: rgba(255,255,255,0.35);
}

/* Dragging states */
.todo-item.dragging {
    opacity: 0.35;
    transform: scale(0.96);
    background: rgba(139, 92, 246, 0.08);
}

.todo-drop-indicator {
    height: 3px;
    background: rgba(139, 92, 246, 0.7);
    border-radius: 3px;
    margin: -2px 0;
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
    transition: opacity 0.1s;
}

/* Edit inline */
.todo-item-edit-input {
    flex: 1;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 6px;
    color: var(--text-color, #e0e0ff);
    font-size: 0.9375rem;
    padding: 4px 10px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}

.todo-item-edit-input:focus {
    border-color: rgba(139, 92, 246, 0.6);
}

/* Edit button */
.todo-item-edit {
    background: transparent;
    border: none;
    color: var(--text-muted, #666);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 2px 4px;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
}

.todo-item:hover .todo-item-edit {
    opacity: 1;
}

.todo-item-edit:hover {
    color: rgba(139, 92, 246, 0.8);
}

.todo-item.completed {
    opacity: 0.5;
}

.todo-item.completed .todo-item-text {
    text-decoration: line-through;
}

.todo-item-check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--text-muted, #666);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    background: transparent;
    padding: 0;
    font-size: 0.7rem;
}

.todo-item-check.checked {
    background: #059669;
    border-color: #059669;
    color: #fff;
}

.todo-item-text {
    flex: 1;
    font-size: 0.9375rem;
    color: var(--text-color, #e0e0ff);
    line-height: 1.4;
}

.todo-item-date {
    font-size: 0.75rem;
    color: var(--muted-text, #666);
    white-space: nowrap;
}

.todo-item-delete {
    background: transparent;
    border: none;
    color: var(--text-muted, #666);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 4px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
}

.todo-item:hover .todo-item-delete {
    opacity: 1;
}

.todo-item-delete:hover {
    color: #ef4444;
}

.todos-done-footer {
    display: flex;
    justify-content: flex-end;
    padding: 8px 0;
    margin-top: 4px;
}

#todos-count {
    font-size: 0.8rem;
    color: var(--muted-text, #888);
    margin-left: 8px;
}

@media (max-width: 768px) {
    .todo-add-bar {
        flex-wrap: wrap;
    }

    .todo-add-bar input {
        min-width: 0;
    }

    .todo-filter-tabs {
        flex-wrap: wrap;
    }
}

/* =========================
   Writing Page
========================= */

.writing-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: var(--spacing-lg);
    height: calc(100vh - 160px);
    min-height: 400px;
}

/* Writing Sidebar (List) */
.writing-sidebar {
    background: var(--bg-elevated);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-lg);
    overflow-y: auto;
    padding: var(--spacing-xs);
}

.writing-list-count {
    font-size: 0.68rem;
    color: rgba(168, 130, 80, 0.55);
    letter-spacing: 0.5px;
    padding: 6px 10px 2px;
    font-weight: 600;
}

.writing-list-count:empty {
    display: none;
}

.writing-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.writing-list-empty {
    text-align: center;
    padding: 32px 12px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.8rem;
    font-style: italic;
}

.writing-list-item {
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}

.writing-list-item:hover {
    background: rgba(139, 92, 246, 0.08);
}

.writing-list-item.active {
    background: rgba(139, 92, 246, 0.15);
    border-left: 2.5px solid rgba(139, 92, 246, 0.5);
}

.writing-list-item-title {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.writing-list-item-preview {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.35);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.writing-list-item-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.25);
}

.writing-list-item-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.15);
    cursor: pointer;
    font-size: 0.7rem;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0;
}

.writing-list-item:hover .writing-list-item-delete {
    opacity: 1;
}

.writing-list-item-delete:hover {
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

/* Writing Editor */
.writing-editor {
    background: var(--bg-elevated);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.writing-editor-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: var(--spacing-lg);
}

.writing-title-input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    padding: 0 0 var(--spacing-sm) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: var(--spacing-md);
    outline: none;
    transition: border-color 0.2s;
}

.writing-title-input:focus {
    border-bottom-color: rgba(139, 92, 246, 0.3);
}

.writing-title-input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

.writing-body-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.8;
    padding: var(--spacing-sm) var(--spacing-md);
    outline: none;
    resize: none;
    font-family: 'Inter', sans-serif;
}

.writing-body-input::placeholder {
    color: rgba(255, 255, 255, 0.18);
    font-style: italic;
}

.writing-editor-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: var(--spacing-sm);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: var(--spacing-sm);
}

.writing-stats {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 0.3px;
}

.writing-saved-status {
    font-size: 0.68rem;
    color: rgba(139, 92, 246, 0.5);
    font-style: italic;
}

.writing-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: rgba(200, 180, 255, 0.55);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: auto;
}

.writing-download-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.4);
    color: rgba(200, 180, 255, 0.85);
}

/* Writing Empty State */
.writing-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: var(--spacing-2xl);
    text-align: center;
}

.writing-empty .empty-icon {
    margin-bottom: var(--spacing-md);
}

.writing-empty .empty-icon svg {
    width: 40px;
    height: 40px;
    stroke: rgba(139, 92, 246, 0.25);
}

.writing-empty h3 {
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.35);
    margin: 0 0 4px;
}

.writing-empty p {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.2);
    margin: 0;
}

/* ===== Topic Spinner ===== */
#writing-topic-btn {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.25);
    color: rgba(200, 180, 255, 0.8);
    transition: all 0.2s;
}

#writing-topic-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.4);
    color: rgba(220, 200, 255, 1);
}
.topic-spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: spinnerOverlayIn 0.25s ease;
}

.topic-spinner-overlay.hidden {
    display: none;
}

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

.topic-spinner-card {
    background: linear-gradient(135deg, #1a1035 0%, #0f172a 50%, #1e1145 100%);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 16px;
    padding: 28px;
    width: 500px;
    max-width: 92vw;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4), 0 0 24px rgba(139, 92, 246, 0.1);
    animation: spinnerCardIn 0.3s ease;
}

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

.topic-spinner-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(200, 180, 255, 0.7);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.topic-spinner-count {
    font-size: 0.65rem;
    font-weight: 400;
    color: rgba(200, 180, 255, 0.35);
    letter-spacing: 0.5px;
}

.topic-spinner-close {
    margin-left: auto;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    transition: color 0.15s;
}

.topic-spinner-close:hover {
    color: rgba(255, 255, 255, 0.7);
}

/* Spinner Window — the visible slot */
.topic-spinner-window {
    height: 100px;
    overflow: hidden;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(139, 92, 246, 0.15);
    position: relative;
}

.topic-spinner-window::before,
.topic-spinner-window::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 12px;
    z-index: 2;
    pointer-events: none;
}

.topic-spinner-window::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(10, 8, 20, 0.8), transparent);
}

.topic-spinner-window::after {
    bottom: 0;
    background: linear-gradient(to top, rgba(10, 8, 20, 0.8), transparent);
}

/* The reel that scrolls */
.topic-spinner-reel {
    transition: transform 0.1s linear;
}

.topic-spinner-item {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 28px;
    font-size: 0.8rem;
    color: rgba(220, 210, 240, 0.85);
    text-align: center;
    font-style: italic;
    letter-spacing: 0.2px;
    line-height: 1.5;
    word-break: break-word;
}

/* SPIN button */
.topic-spinner-spin-btn {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(139, 92, 246, 0.35));
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: rgba(200, 180, 255, 0.95);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 3px;
    padding: 12px 0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.topic-spinner-spin-btn:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(139, 92, 246, 0.5));
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.2);
    transform: translateY(-1px);
}

.topic-spinner-spin-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* Result after spin */
.topic-spinner-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    animation: spinnerResultIn 0.4s ease;
}

.topic-spinner-result.hidden {
    display: none;
}

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

.topic-spinner-selected {
    display: none;
}

.topic-spinner-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.topic-spinner-skip {
    color: rgba(239, 150, 100, 0.7) !important;
    border-color: rgba(239, 150, 100, 0.2) !important;
}

.topic-spinner-skip:hover {
    color: rgba(239, 150, 100, 1) !important;
    background: rgba(239, 150, 100, 0.08) !important;
}

/* Writing Responsive */
@media (max-width: 768px) {
    .writing-layout {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 0;
    }

    .writing-sidebar {
        max-height: 200px;
    }

    .writing-editor {
        min-height: 400px;
    }
}
