/* ── DESIGN TOKENS & SYSTEM VARIABLES ──────────────────────────────── */
:root {
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius-lg: 24px;
    --border-radius-md: 16px;
    --border-radius-sm: 12px;
    
    /* Global tooth / mouth default colors */
    --tooth-outer:   #ffffff;
    --tooth-chew:    #f2f7fb;
    --tooth-inner:   #e2ecf5;
    --tooth-shadow:  rgba(130, 160, 210, 0.16);
    --tooth-stroke:  rgba(100, 145, 200, 0.16);
    --tooth-gloss:   rgba(255,255,255,0.40);
    
    --gum-deep:      #2b0c16;
    --gum-base:      #7c223c;
    --gum-mid:       rgba(180, 60, 95, 0.6);
    --gum-edge:      rgba(230, 110, 145, 0.25);
    
    --cavity:        #f0f5fa; /* Light clean visual base as in the image */
    --gap-fill:      rgba(240, 245, 250, 0.94);
    --divider:       rgba(70, 100, 140, 0.15);
    --lbl-color:     #3c5a7a;
    
    --sensitive-color: #ff5e3a;
    --bracket-color:   #8e9eab;
}

/* 1. MINT FRESH THEME (Default) */
[data-theme="mint"] {
    --bg-gradient: linear-gradient(135deg, #020d09 0%, #062217 100%);
    --card-bg: rgba(10, 30, 24, 0.65);
    --card-border: rgba(0, 239, 170, 0.12);
    --text-primary: #e6f6f0;
    --text-dim: #7da595;
    --active: #00efaa;
    --active-glow: rgba(0, 239, 170, 0.5);
    --done-fill: rgba(0, 180, 120, 0.7);
    --wave-color: rgba(0, 239, 170, 0.14);
    --nav-bg: rgba(6, 20, 15, 0.85);
    --btn-primary-bg: linear-gradient(135deg, #00efaa 0%, #00b380 100%);
    --btn-primary-text: #011d14;
    
    --tooth-outer:   #ffffff;
    --tooth-chew:    #f3faf8;
    --tooth-inner:   #e5f7f2;
    --tooth-stroke:  rgba(0, 239, 170, 0.16);
    --tooth-shadow:  rgba(0, 239, 170, 0.1);
    --cavity:        #020b08;
    --gap-fill:      rgba(2, 11, 8, 0.94);
}

/* 2. MIDNIGHT SKY THEME */
[data-theme="midnight"] {
    --bg-gradient: linear-gradient(135deg, #020612 0%, #081736 100%);
    --card-bg: rgba(12, 22, 45, 0.65);
    --card-border: rgba(0, 122, 255, 0.15);
    --text-primary: #e2eafc;
    --text-dim: #7f95c3;
    --active: #007aff;
    --active-glow: rgba(0, 122, 255, 0.5);
    --done-fill: rgba(0, 90, 200, 0.75);
    --wave-color: rgba(0, 122, 255, 0.15);
    --nav-bg: rgba(6, 12, 28, 0.85);
    --btn-primary-bg: linear-gradient(135deg, #007aff 0%, #0056b3 100%);
    --btn-primary-text: #ffffff;
    
    --tooth-outer:   #ffffff;
    --tooth-chew:    #f2f6ff;
    --tooth-inner:   #e5efff;
    --tooth-stroke:  rgba(0, 122, 255, 0.16);
    --tooth-shadow:  rgba(0, 122, 255, 0.1);
    --cavity:        #020713;
    --gap-fill:      rgba(2, 7, 19, 0.94);
}

/* 3. BERRY SPLASH THEME */
[data-theme="berry"] {
    --bg-gradient: linear-gradient(135deg, #0a0105 0%, #250616 100%);
    --card-bg: rgba(35, 10, 22, 0.65);
    --card-border: rgba(255, 45, 85, 0.15);
    --text-primary: #faedf2;
    --text-dim: #ba8ea0;
    --active: #ff2d55;
    --active-glow: rgba(255, 45, 85, 0.5);
    --done-fill: rgba(190, 20, 50, 0.75);
    --wave-color: rgba(255, 45, 85, 0.15);
    --nav-bg: rgba(20, 5, 12, 0.85);
    --btn-primary-bg: linear-gradient(135deg, #ff2d55 0%, #cc1b3f 100%);
    --btn-primary-text: #ffffff;
    
    --tooth-outer:   #ffffff;
    --tooth-chew:    #fff2f5;
    --tooth-inner:   #ffe5eb;
    --tooth-stroke:  rgba(255, 45, 85, 0.16);
    --tooth-shadow:  rgba(255, 45, 85, 0.1);
    --cavity:        #0b0105;
    --gap-fill:      rgba(11, 1, 5, 0.94);
}

/* 4. OBSIDIAN GOLD THEME */
[data-theme="obsidian"] {
    --bg-gradient: linear-gradient(135deg, #080808 0%, #1a1a1a 100%);
    --card-bg: rgba(22, 22, 22, 0.75);
    --card-border: rgba(212, 175, 55, 0.18);
    --text-primary: #f4ebd0;
    --text-dim: #a89f87;
    --active: #d4af37;
    --active-glow: rgba(212, 175, 55, 0.5);
    --done-fill: rgba(160, 120, 20, 0.75);
    --wave-color: rgba(212, 175, 55, 0.12);
    --nav-bg: rgba(12, 12, 12, 0.9);
    --btn-primary-bg: linear-gradient(135deg, #d4af37 0%, #aa8410 100%);
    --btn-primary-text: #111111;
    
    --tooth-outer:   #ffffff;
    --tooth-chew:    #fffdf5;
    --tooth-inner:   #fff9e6;
    --tooth-stroke:  rgba(212, 175, 55, 0.18);
    --tooth-shadow:  rgba(212, 175, 55, 0.08);
    --cavity:        #080808;
    --gap-fill:      rgba(8, 8, 8, 0.94);
}

/* ── BASE RESETS ──────────────────────────────────────────────────── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    transition: background 0.5s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* Container limits width to mobile app style but centers perfectly */
.app-container {
    width: 100%;
    max-width: 520px;
    min-height: 100vh;
    padding: 20px 20px 100px 20px; /* Space for sticky nav */
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    z-index: 2;
}

/* Backing canvas for celebrations */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

/* ── HEADER STYLING ────────────────────────────────────────────────── */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 4px;
}

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

.logo-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 10px var(--active-glow));
    animation: floating-logo 3s ease-in-out infinite;
}

.brand h1 {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.8rem;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 0%, var(--text-dim) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand h1 span {
    color: var(--active);
    -webkit-text-fill-color: var(--active);
    font-weight: 900;
}

.header-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    backdrop-filter: blur(12px);
    transition: var(--transition);
}

.header-btn:hover {
    transform: scale(1.06);
    border-color: var(--active);
    color: var(--active);
    box-shadow: 0 0 12px var(--active-glow);
}

.header-btn:active {
    transform: scale(0.94);
}

.theme-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-btn:hover .theme-icon {
    transform: rotate(45deg);
}

/* ── GLASS CARDS ───────────────────────────────────────────────────── */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-lg);
    padding: 20px 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.08);
}

/* Text elements inside card headers */
.section-label {
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-dim);
    font-weight: 700;
    margin-bottom: 8px;
    padding-left: 4px;
}

/* ── TAB NAVIGATION ────────────────────────────────────────────────── */
.tab-content {
    display: none;
    flex-direction: column;
    gap: 20px;
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-content.active {
    display: flex;
}

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

.app-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 480px;
    height: 68px;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 34px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    z-index: 99;
    transition: var(--transition);
}

.nav-item {
    border: none;
    background: transparent;
    color: var(--text-dim);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 28px;
    transition: var(--transition);
}

.nav-icon {
    width: 22px;
    height: 22px;
    stroke-width: 2;
    transition: var(--transition);
}

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

.nav-item.active {
    color: var(--active);
    background: rgba(255, 255, 255, 0.03);
}

.nav-item.active .nav-icon {
    transform: translateY(-2px);
    filter: drop-shadow(0 0 6px var(--active-glow));
}

/* ── TAB 1: TIMER SCREEN ───────────────────────────────────────────── */

/* 1.1 Routine Cards */
.routine-selector-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.routine-cards {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 4px 12px 4px;
    scrollbar-width: none; /* Hide standard Firefox scrollbar */
}

.routine-cards::-webkit-scrollbar {
    display: none; /* Hide Chrome scrollbars */
}

.routine-card {
    flex: 0 0 160px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-md);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.routine-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.12);
}

.routine-card.active {
    border-color: var(--active);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 12px var(--active-glow);
}

.routine-icon {
    font-size: 1.6rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.routine-info h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.routine-info p {
    font-size: 0.68rem;
    color: var(--text-dim);
    margin-top: 2px;
}

/* 1.2 The Wavy Timer Card */
.timer-card {
    height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    z-index: 1;
}

.timer-display-wrap {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
}

.timer-number {
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: 2.1rem;
    letter-spacing: -1px;
    color: #fff;
    z-index: 10;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.progress-ring-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-ring__circle {
    transition: stroke-dashoffset 0.35s;
    transform-origin: 50% 50%;
}

/* Liquid Foam Animation inside timer-card */
.liquid-bg {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 0%; /* Dynamic height calculated in JS */
    background: var(--wave-color);
    transition: height 1s cubic-bezier(0.1, 0.8, 0.3, 1);
    z-index: 0;
    pointer-events: none;
}

.wave {
    position: absolute;
    bottom: 100%;
    width: 200%;
    height: 20px;
    background: inherit;
    border-radius: 43%;
    transform: translateX(-25%);
}

.wave1 {
    animation: wave-anim 8s linear infinite;
    opacity: 0.8;
}

.wave2 {
    animation: wave-anim2 12s linear infinite;
    opacity: 0.5;
    border-radius: 40%;
}

@keyframes wave-anim {
    0% { transform: translateX(-25%) rotate(0deg); }
    100% { transform: translateX(-25%) rotate(360deg); }
}

@keyframes wave-anim2 {
    0% { transform: translateX(-25%) rotate(0deg); }
    100% { transform: translateX(-25%) rotate(-360deg); }
}

/* Foam bubbles rising */
.bubble {
    position: absolute;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    bottom: 0;
    animation: bubble-rise 4s ease-in infinite;
}

.bubble1 { width: 8px; height: 8px; left: 15%; animation-duration: 3s; animation-delay: 0.5s; }
.bubble2 { width: 12px; height: 12px; left: 55%; animation-duration: 4.2s; animation-delay: 1.5s; }
.bubble3 { width: 6px; height: 6px; left: 80%; animation-duration: 2.5s; animation-delay: 0.2s; }

@keyframes bubble-rise {
    0% { transform: translateY(0) scale(1); opacity: 0; }
    10% { opacity: 0.7; }
    90% { opacity: 0.4; }
    100% { transform: translateY(-120px) scale(0.6); opacity: 0; }
}

.routine-status-info {
    z-index: 10;
}

.surface-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    background: rgba(255,255,255,0.06);
    color: var(--active);
    border: 1px solid var(--card-border);
    text-transform: uppercase;
    margin-bottom: 6px;
    transition: var(--transition);
}

.routine-status-info h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.technique-tip {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-top: 4px;
}

/* 1.3 SVG Mouth Map Styling */
.mouth-card {
    padding: 16px 14px;
}

.mouth-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.mouth-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.info-tooltip {
    font-size: 0.68rem;
    color: var(--text-dim);
}

.mouth-wrap {
    padding: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
}

svg#svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: 350px;
}

/* Tooth SVG specific classes */
.tooth-face {
    transition: fill 0.35s ease, stroke 0.35s ease;
    stroke: var(--tooth-stroke);
    stroke-width: 0.9px;
    cursor: pointer;
}

.tooth-face[data-surf="outer"] { fill: var(--tooth-outer); }
.tooth-face[data-surf="chew"]  { fill: var(--tooth-chew);  }
.tooth-face[data-surf="inner"] { fill: var(--tooth-inner); }

.tooth-shadow { fill: var(--tooth-shadow); opacity: 0.6; }
.tooth-gloss  { fill: var(--tooth-gloss); pointer-events: none; }

/* Interactive Hover state on tooth items */
.tooth-item {
    cursor: pointer;
    transition: var(--transition);
}

.tooth-item:hover {
    filter: brightness(1.08) saturate(1.05);
}

/* Interactive custom states: Sensitive and Bracket overlays */
.tooth-item.sensitive .tooth-face {
    fill: var(--sensitive-color) !important;
    stroke: rgba(255, 94, 58, 0.4) !important;
}

.tooth-item.bracket .tooth-bracket-overlay {
    stroke: var(--bracket-color);
    stroke-width: 1.6;
    fill: none;
}

/* Active fırçalama animation pulse */
@keyframes tooth-active-pulse {
    0%, 100% { filter: drop-shadow(0 0 2px var(--active-glow)); }
    50% { filter: drop-shadow(0 0 10px var(--active-glow)); }
}

.t-group.active {
    animation: tooth-active-pulse 1.6s ease-in-out infinite;
}

.t-group.active .tooth-face {
    fill: var(--active) !important;
    stroke: var(--active) !important;
}

.t-group.done .tooth-face {
    fill: var(--done-fill) !important;
    stroke: var(--done-fill) !important;
}

/* Thin styled central percentage text matching the image */
#pctText {
    font-weight: 300 !important;
    font-family: 'Outfit', sans-serif;
}

/* Underactive transparent gaps */
.gap-rect {
    fill: none; /* Removed rectangular overlay since upper/lower jaws are beautifully separated in the new design */
}

/* 1.4 Controls */
.brush-controls-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.actions-row {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 12px;
}

.btn {
    border: none;
    border-radius: var(--border-radius-md);
    padding: 16px;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 15px var(--active-glow);
}

.btn-primary:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25), 0 0 25px var(--active-glow);
    filter: brightness(1.05);
}

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

.btn-secondary:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.02);
}

.audio-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 10px !important;
}

.audio-btn {
    border: none;
    background: transparent;
    color: var(--text-dim);
    padding: 10px;
    border-radius: var(--border-radius-sm);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.audio-btn:hover {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
}

.audio-btn.active {
    color: var(--active);
    background: rgba(255,255,255,0.03);
}

.audio-btn .icon {
    width: 16px;
    height: 16px;
}

/* ── TAB 2: STATS SCREEN ───────────────────────────────────────────── */
.stats-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stat-highlight-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px 24px;
}

.streak-icon {
    font-size: 2.8rem;
    animation: fire-pulse 2s ease-in-out infinite;
}

@keyframes fire-pulse {
    0%, 100% { filter: drop-shadow(0 0 2px #ff8a00) scale(1); }
    50% { filter: drop-shadow(0 0 12px #ff3d00) scale(1.05); }
}

.stat-highlight-info h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.stat-highlight-info p {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-weight: 500;
    margin-top: 4px;
}

/* Chart */
.chart-card h3, .brush-head-card h3, .history-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.chart-container {
    height: 180px;
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 10px;
    margin-top: 10px;
}

.y-axis-labels {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: right;
    font-size: 0.65rem;
    color: var(--text-dim);
    padding-bottom: 22px; /* aligns with bars */
}

.chart-bars-wrap {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 100%;
    padding-bottom: 22px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    position: relative;
}

.chart-bar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: calc(100% / 7 - 6px);
    height: 100%;
    justify-content: flex-end;
    position: relative;
}

.chart-bar-fill {
    width: 100%;
    background: linear-gradient(180deg, var(--active) 0%, rgba(0, 239, 170, 0.1) 100%);
    border-radius: 6px 6px 0 0;
    height: 0; /* Dynamic via JS */
    transition: height 1s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(0, 239, 170, 0.15);
}

.chart-bar-col:hover .chart-bar-fill {
    filter: brightness(1.15);
    box-shadow: 0 0 15px var(--active-glow);
}

.chart-bar-lbl {
    position: absolute;
    bottom: -22px;
    font-size: 0.65rem;
    color: var(--text-dim);
    font-weight: 500;
}

/* Fırça Başlığı Takipçisi */
.brush-head-layout {
    display: flex;
    align-items: center;
    gap: 20px;
}

.brush-head-ring-wrap {
    position: relative;
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}

.brush-head-ring-wrap .progress-ring {
    transform: rotate(-90deg);
}

.ring-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: #fff;
}

.brush-head-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.brush-head-desc {
    font-size: 0.72rem;
    color: var(--text-dim);
    line-height: 1.4;
}

.brush-head-stat {
    font-size: 0.78rem;
    font-weight: 600;
}

.brush-head-stat strong {
    color: var(--active);
}

.btn-small {
    padding: 8px 14px;
    font-size: 0.75rem;
    border-radius: 8px;
    margin-top: 4px;
    align-self: flex-start;
}

/* History logs */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 160px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.history-item-desc {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-item-title {
    font-size: 0.78rem;
    font-weight: 700;
}

.history-item-date {
    font-size: 0.65rem;
    color: var(--text-dim);
}

.history-item-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--active);
}

.empty-list-msg {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-align: center;
    padding: 20px 0;
}

/* ── TAB 3: ROZETLER SCREEN ────────────────────────────────────────── */
.badges-header {
    margin-bottom: 10px;
}

.badges-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.badges-desc {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 4px;
}

.badges-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.badge-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    opacity: 0.5;
    filter: grayscale(1);
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.badge-card.unlocked {
    opacity: 1;
    filter: none;
    border-color: var(--active);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15), 0 0 10px rgba(0, 239, 170, 0.1);
}

.badge-icon {
    font-size: 2.2rem;
    padding: 6px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.badge-card.unlocked .badge-icon {
    filter: drop-shadow(0 0 6px var(--active-glow));
    animation: micro-float 3s ease-in-out infinite;
}

@keyframes micro-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.badge-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
}

.badge-desc {
    font-size: 0.65rem;
    color: var(--text-dim);
    line-height: 1.3;
}

/* ── TAB 4: SETTINGS SCREEN ────────────────────────────────────────── */
.settings-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.settings-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.settings-desc {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* Themes grid selector */
.theme-selector-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.theme-option {
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-sm);
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    background: rgba(255,255,255,0.01);
    transition: var(--transition);
}

.theme-option:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.theme-option.active {
    border-color: var(--active);
    background: rgba(255,255,255,0.03);
    box-shadow: 0 0 10px rgba(0, 239, 170, 0.1);
}

.theme-preview {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.15);
    flex-shrink: 0;
}

.theme-option span {
    font-size: 0.75rem;
    font-weight: 600;
}

/* Sliders and drop downs */
.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

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

.setting-label h4 {
    font-size: 0.8rem;
    font-weight: 700;
}

.setting-label p {
    font-size: 0.68rem;
    color: var(--text-dim);
    margin-top: 2px;
}

.settings-select {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 6px 10px;
    font-size: 0.75rem;
    outline: none;
    cursor: pointer;
    font-weight: 600;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.slider-container input[type="range"] {
    -webkit-appearance: none;
    width: 100px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.1);
    outline: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--active);
    cursor: pointer;
    transition: var(--transition);
}

.slider-container span {
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 30px;
    text-align: right;
}

/* Danger settings */
.danger-card {
    border-color: rgba(255, 45, 85, 0.25) !important;
}

.danger-card h3 {
    color: #ff3b30;
}

.danger-card p {
    font-size: 0.72rem;
    color: var(--text-dim);
    line-height: 1.4;
    margin-bottom: 12px;
}

.btn-danger {
    background: rgba(255, 45, 85, 0.15);
    color: #ff453a;
    border: 1px solid rgba(255, 45, 85, 0.3);
    padding: 12px;
}

.btn-danger:hover {
    background: #ff453a;
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 45, 85, 0.3);
}

/* ── ANIMATIONS ────────────────────────────────────────────────────── */
@keyframes floating-logo {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-4px) rotate(5deg); }
}

/* Desktop layout adaptations if screen is large enough */
@media (min-width: 992px) {
    body {
        align-items: center;
        padding: 40px 0;
    }
    
    .app-container {
        max-width: 860px;
        padding-bottom: 40px;
        display: grid;
        grid-template-columns: 240px 1fr;
        gap: 30px;
    }
    
    .app-header {
        grid-column: 1 / -1;
    }
    
    .app-nav {
        position: static;
        transform: none;
        width: 100%;
        height: auto;
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 20px;
        border-radius: var(--border-radius-lg);
    }
    
    .nav-item {
        flex-direction: row;
        justify-content: flex-start;
        padding: 14px 20px;
        font-size: 0.85rem;
        gap: 12px;
    }
    
    .nav-item.active {
        background: rgba(255,255,255,0.04);
    }
    
    .app-main {
        min-height: auto;
    }
}
