/* ==========================================
   CSS VARIABLES & THEME
   ========================================== */
:root {
    /* Brand Colors - Warm, inviting palette */
    --color-primary: #e07a5f;
    --color-primary-dark: #c96850;
    --color-primary-light: #f4a88b;
    
    /* Sequence Colors - Distinct, memorable */
    --color-seq-1: #3d5a80;  /* Deep Blue */
    --color-seq-2: #98c1d9;  /* Sky Blue */
    --color-seq-3: #ee6c4d;  /* Coral */
    --color-seq-4: #293241;  /* Charcoal */
    
    /* Neutrals */
    --color-bg: #f8f7f4;
    --color-surface: #ffffff;
    --color-text: #2b2d42;
    --color-text-light: #8d99ae;
    --color-border: #e0ddd5;
    
    /* Interactive States */
    --color-selected: #ffd166;
    --color-success: #06d6a0;
    --color-error: #ef476f;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    
    /* Typography */
    --font-display: 'DM Serif Display', serif;
    --font-body: 'Work Sans', sans-serif;
    
    /* Borders & Shadows */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 2px 8px rgba(43, 45, 66, 0.08);
    --shadow-md: 0 4px 16px rgba(43, 45, 66, 0.12);
    --shadow-lg: 0 8px 24px rgba(43, 45, 66, 0.16);
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   RESET & BASE STYLES
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    -webkit-tap-highlight-color: transparent;
}

/* ==========================================
   CONTAINER & LAYOUT
   ========================================== */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--space-md);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================
   HEADER
   ========================================== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) 0;
    margin-bottom: var(--space-xl);
}

.header-left,
.header-right {
    flex: 1;
}

.header-center {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.logo {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 400;
    color: var(--color-primary);
    margin-bottom: 0.25rem;
    letter-spacing: 0.02em;
}

.puzzle-number {
    font-size: 0.875rem;
    color: var(--color-text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.icon-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--color-text);
    transition: all var(--transition-fast);
}

.icon-btn:hover {
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
}

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

.timer {
    text-align: right;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}

/* ==========================================
   GAME AREA
   ========================================== */
.game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

/* Game Message */
.game-message {
    text-align: center;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-light);
    padding: var(--space-md) 0;
    animation: fadeIn var(--transition-slow) ease-out;
    display: none;
}

.game-message.show {
    display: block;
}

.game-message.game-over {
    color: var(--color-text);
}

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

/* Completed Sequences - now rendered in the unified game grid */
.completed-group {
    /* Span all 4 columns of the game grid */
    grid-column: 1 / -1;

    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    box-shadow: var(--shadow-sm);
    /* animation: slideIn var(--transition-slow) ease-out; */ /* DISABLED - conflicts with tile fly animation */
    border: 2px solid transparent;
    overflow: visible;
    opacity: 0; /* Start hidden - will fade in after tile animation */
    transition: opacity 200ms ease-out;

    display: flex;
    flex-direction: column;
    justify-content: center;
}

.completed-group.visible {
    opacity: 1;
}

/* Difficulty-based coloring */
.completed-group.easy {
    background: linear-gradient(135deg, #a7f3d0 0%, #6ee7b7 100%);
    border-color: #6ee7b7;
}

.completed-group.medium {
    background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
    border-color: #fcd34d;
}

.completed-group.hard {
    background: linear-gradient(135deg, #fca5a5 0%, #f87171 100%);
    border-color: #f87171;
}

.completed-group.expert {
    background: linear-gradient(135deg, #c4b5fd 0%, #a78bfa 100%);
    border-color: #a78bfa;
}

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

.completed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;  /* Reduced from var(--space-sm) */
}

.completed-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--color-text);
}

/* Override title color for colored backgrounds */
.completed-group.easy .completed-title {
    color: #065f46;
    text-shadow: none;
    font-weight: 600;
}

.completed-group.medium .completed-title {
    color: #78350f;
    text-shadow: none;
    font-weight: 600;
}

.completed-group.hard .completed-title {
    color: #7f1d1d;
    text-shadow: none;
    font-weight: 600;
}

.completed-group.expert .completed-title {
    color: #4c1d95;
    text-shadow: none;
    font-weight: 600;
}

.completed-difficulty {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}

/* Difficulty badge colors */
.completed-group.easy .completed-difficulty {
    background: rgba(6, 95, 70, 0.2);
    color: #065f46;
    font-weight: 700;
}

.completed-group.medium .completed-difficulty {
    background: rgba(120, 53, 15, 0.2);
    color: #78350f;
    font-weight: 700;
}

.completed-group.hard .completed-difficulty {
    background: rgba(127, 29, 29, 0.2);
    color: #7f1d1d;
    font-weight: 700;
}

.completed-group.expert .completed-difficulty {
    background: rgba(76, 29, 149, 0.2);
    color: #4c1d95;
    font-weight: 700;
}

.completed-items {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    justify-content: space-evenly;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 0.25rem var(--space-md);  /* Reduced vertical padding to fit in one row height */
    position: relative;
}

/* Continuous connecting line behind all circles */
.completed-items::before {
    content: '';
    position: absolute;
    left: 10%;
    right: 10%;
    top: 50%;
    height: 2px;
    background: currentColor;
    opacity: 0.2;
    transform: translateY(-50%);
    z-index: 0;
}

.completed-item {
    position: relative;
    font-size: 0.75rem;
    color: var(--color-text-light);
    padding: var(--space-md);
    background: var(--color-bg);
    border-radius: 50%;
    width: 90px;
    height: 90px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.2;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: circlePulse 1.8s ease-in-out infinite;
    z-index: 1;
}

/* Sequential pulse for each circle */
.completed-item:nth-child(1) {
    animation-delay: 0s;
}

.completed-item:nth-child(2) {
    animation-delay: 0.45s;
}

.completed-item:nth-child(3) {
    animation-delay: 0.9s;
}

.completed-item:nth-child(4) {
    animation-delay: 1.35s;
}

/* Subtle circle pulse animation - maintains halo throughout */
@keyframes circlePulse {
    0%, 25%, 100% {
        transform: scale(1);
    }
    12.5% {
        transform: scale(1.04);
    }
}

/* Quick bounce animation for correct guess */
@keyframes successBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.08);
    }
}

/* Opaque items on colored backgrounds - completely hides line behind circles */
.completed-group.easy .completed-item {
    background: #d0f0e4;
    color: #065f46;
    font-weight: 600;
    box-shadow: 0 0 0 12px #a7f3d0;
}

.completed-group.medium .completed-item {
    background: #f7e9c8;
    color: #78350f;
    font-weight: 600;
    box-shadow: 0 0 0 12px #fde68a;
}

.completed-group.hard .completed-item {
    background: #f8d5d5;
    color: #7f1d1d;
    font-weight: 600;
    box-shadow: 0 0 0 12px #fca5a5;
}

.completed-group.expert .completed-item {
    background: #e5dbf5;
    color: #4c1d95;
    font-weight: 600;
    box-shadow: 0 0 0 12px #c4b5fd;
}

/* Instruction Message */
.instruction-message {
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-light);
    padding: var(--space-sm) 0;
    animation: fadeIn var(--transition-slow);
}

/* Unified Game Grid - holds both completed sequences and tiles */
.game-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    transition: opacity var(--transition-base);
}

.tile {
    box-sizing: border-box;
    aspect-ratio: 1;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    box-shadow: var(--shadow-sm);
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    overflow: visible;
}

.tile.success {
    animation: successBounce 150ms cubic-bezier(0.4, 0.0, 0.2, 1);
}

.tile.completing {
    /* Tiles that are flying to completed sequence */
    /* Override 'transition: all' to prevent unwanted transitions */
    transition: none !important;
    z-index: 100;
}

.tile.completing.ready-to-animate {
    /* Sharp, direct animation - as the crow flies */
    transition: transform 500ms cubic-bezier(0.4, 0.0, 0.2, 1) !important;
}

.tile.completing.transform-color {
    /* Apply bead colors at end of flight */
    transition: transform 700ms cubic-bezier(0.2, 0, 0, 1),
                background-color 200ms ease-out,
                color 200ms ease-out,
                box-shadow 200ms ease-out;
}

.tile.animating {
    /* Remaining tiles reorganizing - same timing as completing tiles */
    transition: transform 500ms cubic-bezier(0.4, 0.0, 0.2, 1);
}

.tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary-light);
}

.tile:active {
    transform: scale(0.98);
}

.tile.selected {
    background: var(--color-selected);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    z-index: 5;
}

.tile.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.tile-number {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--color-surface);
    z-index: 10;
}

/* Shake animation for incorrect guess */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.tile.error {
    animation: shake 0.5s ease-in-out;
    border-color: var(--color-error);
}

/* One Away animation - pulse to indicate close */
@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        border-color: var(--color-border);
    }
    50% { 
        transform: scale(1.05);
        border-color: #fbbf24; /* Amber - hint color */
        box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.2);
    }
}

.tile.one-away {
    animation: pulse 0.6s ease-in-out 2;
}

.game-message.one-away {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
}

/* Reordering animation - tiles slide to correct positions */
.tile.reordering {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

/* Success animation - tile flying to completed area */
@keyframes flyToCompleted {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    30% {
        transform: translateY(-80px) scale(0.95);
        opacity: 0.9;
    }
    60% {
        transform: translateY(-160px) scale(0.85);
        opacity: 0.7;
    }
    100% {
        transform: translateY(-240px) scale(0.7);
        opacity: 0;
    }
}

.tile.success {
    animation: flyToCompleted 0.8s ease-out forwards;
    z-index: 10;
    position: relative;
}

/* ==========================================
   CONTROLS
   ========================================== */
.controls {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: var(--space-sm);
}


.btn {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--color-primary-dark);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-primary:disabled {
    background: var(--color-border);
    color: var(--color-text-light);
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border: 2px solid var(--color-border);
}

.btn-secondary:hover {
    border-color: var(--color-primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

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

.btn svg {
    pointer-events: none;
}

.btn-block {
    width: 100%;
}

/* ==========================================
   MISTAKES COUNTER
   ========================================== */
.mistakes-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    padding: var(--space-md);
    font-weight: 500;
    color: var(--color-text-light);
}

.mistake-dots {
    display: flex;
    gap: var(--space-xs);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-border);
    transition: all var(--transition-base);
}

.dot.active {
    background: var(--color-primary);
}

.dot.used {
    background: var(--color-error);
}

/* ==========================================
   MODAL
   ========================================== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(43, 45, 66, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    z-index: 1000;
    animation: fadeIn var(--transition-base);
}

.modal.active {
    display: flex;
}

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

.modal-content {
    position: relative;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    animation: slideUp var(--transition-slow) ease-out;
}

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

.modal-content h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    margin-bottom: var(--space-lg);
    text-align: center;
    color: var(--color-text);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.modal-header h2 {
    margin: 0;
    text-align: left;
}

.close-btn {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--color-text-light);
    transition: all var(--transition-fast);
    z-index: 1;
}

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

/* Stats */
.stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.stat {
    text-align: center;
    padding: var(--space-md);
    background: var(--color-bg);
    border-radius: var(--radius-md);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    font-variant-numeric: tabular-nums;
}

/* Share Section */
.share-section {
    margin-bottom: var(--space-xl);
}

.share-grid {
    background: var(--color-bg);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    font-family: monospace;
    font-size: 1.25rem;
    line-height: 1.4;
    text-align: center;
    user-select: all;
    white-space: pre-wrap;
}

.emoji-grid {
    display: inline-block;
    text-align: left;
    white-space: pre-wrap;
}

.share-buttons {
    display: flex;
    gap: var(--space-sm);
}

.share-buttons .btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.next-puzzle {
    text-align: center;
    color: var(--color-text-light);
    font-size: 0.875rem;
}

.next-puzzle span {
    font-weight: 700;
    color: var(--color-primary);
    font-variant-numeric: tabular-nums;
}

/* Menu Sections */
.menu-section {
    margin-bottom: var(--space-xl);
}

.menu-section:first-child {
    margin-top: 0;
}

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

.menu-section h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    margin-bottom: var(--space-md);
    color: var(--color-text);
}

.instructions {
    list-style-position: inside;
    padding-left: 0;
}

.instructions li {
    margin-bottom: var(--space-sm);
    color: var(--color-text-light);
}

.menu-section p {
    margin-bottom: var(--space-sm);
    color: var(--color-text-light);
}

.menu-section p strong {
    color: var(--color-text);
    font-weight: 600;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 480px) {
    /* Reduce overall padding */
    .container {
        padding: var(--space-sm);
    }
    
    /* Compact header */
    .header {
        padding: var(--space-sm) 0;
        margin-bottom: var(--space-sm);
    }
    
    .logo {
        font-size: 1.75rem;
    }
    
    .puzzle-number {
        font-size: 0.75rem;
    }
    
    /* Compact instruction message */
    .instruction-message {
        font-size: 0.875rem;
        padding: var(--space-sm) 0;
    }
    
    /* Compact completed sequences */
    .completed-group {
        padding: var(--space-sm);
        margin-bottom: var(--space-xs);
    }
    
    .completed-header {
        margin-bottom: var(--space-xs);
    }
    
    .completed-title {
        font-size: 0.875rem;
    }
    
    .completed-difficulty {
        font-size: 0.625rem;
        padding: 0.125rem 0.375rem;
    }
    
    .completed-items {
        gap: var(--space-xs);
        padding: var(--space-md) var(--space-sm);
    }

    .completed-item {
        font-size: 0.65rem;
        padding: var(--space-sm);
        width: 70px;
        height: 70px;
    }
    
    /* Compact tiles grid */
    .tiles-grid {
        gap: 0.375rem;
        margin-bottom: var(--space-sm);
    }
    
    .tile {
        font-size: 0.7rem;
        padding: 0.25rem;
        border-width: 1.5px;
    }
    
    .tile-number {
        width: 18px;
        height: 18px;
        font-size: 0.625rem;
        top: 2px;
        right: 2px;
    }
    
    /* KEEP CONTROLS HORIZONTAL - critical for mobile */
    .controls {
        grid-template-columns: auto auto 1fr;
        gap: var(--space-xs);
    }
    
    /* Compact buttons */
    .btn {
        padding: var(--space-sm) var(--space-sm);
        font-size: 0.875rem;
    }
    
    .btn svg {
        width: 16px;
        height: 16px;
    }
    
    /* Hide button text on mobile, keep icons */
    .btn-icon-text .btn-text {
        display: none;
    }
    
    /* Make mistake counter more compact */
    .mistakes {
        font-size: 0.75rem;
        padding: var(--space-xs) var(--space-sm);
    }
    
    .mistake-dot {
        width: 6px;
        height: 6px;
    }
    
    /* Compact modal for mobile */
    .modal {
        padding: var(--space-sm);
        align-items: flex-end; /* Position at bottom for easier dismissal */
    }
    
    .modal-content {
        padding: var(--space-md);
        max-height: 85vh; /* Don't take full screen */
        overflow-y: auto;
        margin-bottom: 0;
    }
    
    .modal-content h2 {
        font-size: 1.5rem;
        margin-bottom: var(--space-md);
    }
    
    .stats {
        gap: var(--space-sm);
        margin-bottom: var(--space-md);
    }
    
    .stat {
        padding: var(--space-sm);
    }
    
    .stat-label {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .share-section {
        margin-bottom: var(--space-md);
    }
    
    .share-grid {
        padding: var(--space-sm);
        font-size: 1rem;
        margin-bottom: var(--space-sm);
    }
    
    .share-buttons {
        gap: var(--space-xs);
    }
    
    .share-buttons .btn {
        font-size: 0.875rem;
        padding: var(--space-sm);
    }
}

/* Extra small screens (iPhone SE, etc.) */
@media (max-width: 375px) {
    .logo {
        font-size: 1.5rem;
    }

    .tile {
        font-size: 0.65rem;
    }

    .btn {
        font-size: 0.8rem;
        padding: 0.5rem 0.5rem;
    }

    /* Ultra-compact completed sequences for smallest devices */
    .completed-items {
        gap: 0.375rem;
        padding: var(--space-sm) var(--space-xs);
    }

    .completed-item {
        width: 60px;
        height: 60px;
        font-size: 0.6rem;
        padding: 0.375rem;
    }

    .completed-group.easy .completed-item {
        box-shadow: 0 0 0 8px #a7f3d0;
    }

    .completed-group.medium .completed-item {
        box-shadow: 0 0 0 8px #fde68a;
    }

    .completed-group.hard .completed-item {
        box-shadow: 0 0 0 8px #fca5a5;
    }

    .completed-group.expert .completed-item {
        box-shadow: 0 0 0 8px #c4b5fd;
    }
    
    /* Even more compact modal */
    .modal-content {
        padding: var(--space-sm);
        max-height: 80vh;
    }
    
    .modal-content h2 {
        font-size: 1.25rem;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .share-grid {
        font-size: 0.875rem;
    }
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */
.hidden {
    display: none !important;
}
