@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-dark: #0f172a;
    --surface: #1e293b;
    --surface-hover: #334155;
    --primary: #10b981;
    --primary-hover: #059669;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --accent: #8b5cf6;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.view { display: none; width: 100%; max-width: 1400px; gap: 24px; }
.view.active { display: flex; }

/* ----------- AUTH ----------- */
#auth-view { justify-content: center; align-items: center; }
.auth-card {
    background-color: var(--surface);
    padding: 40px; border-radius: var(--radius);
    width: 400px; box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    text-align: center;
}
.logo { font-weight: 700; font-size: 2rem; margin-bottom: 8px; }
.logo span { color: var(--primary); }
.subtitle { color: var(--text-muted); margin-bottom: 32px; }

.input-group { text-align: left; margin-bottom: 16px; }
.input-group label { display: block; margin-bottom: 8px; font-size: 0.9rem; color: var(--text-muted); }

input[type="text"], input[type="password"], input[type="email"], input[type="number"], select {
    width: 100%; padding: 12px;
    background-color: #0f172a; border: 1px solid var(--border);
    border-radius: 8px; color: white; font-size: 1rem;
    outline: none; transition: 0.3s;
}
input:focus, select:focus { border-color: var(--primary); }

.btn {
    width: 100%; padding: 12px; border: none;
    border-radius: 8px; font-size: 1rem; font-weight: 600;
    cursor: pointer; transition: 0.3s; color: white;
}
.btn.small-btn { padding: 8px 12px; font-size: 0.85rem; }
.btn.large-btn { padding: 16px; font-size: 1.1rem; }

.primary-btn { background-color: var(--primary); }
.primary-btn:hover { background-color: var(--primary-hover); }
.danger-btn { background-color: var(--danger); }
.danger-btn:hover { background-color: var(--danger-hover); }
.success-btn { background-color: var(--primary); box-shadow: 0 0 15px rgba(16,185,129,0.5); }
.outline-btn { background-color: transparent; border: 1px solid var(--border); }
.outline-btn:hover { background-color: var(--surface-hover); }

.error-msg { color: var(--danger); margin-top: 16px; font-size: 0.9rem; min-height: 20px; }
.success-msg { color: var(--primary); margin-top: 16px; font-size: 0.9rem; min-height: 20px; }

.auth-toggle { display: flex; gap: 10px; margin-bottom: 24px; }
.toggle-btn {
    flex: 1; padding: 10px;
    background: transparent; color: var(--text-muted);
    border: 1px solid var(--border); border-radius: 8px;
    cursor: pointer; transition: 0.3s; font-weight: 600;
}
.toggle-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ----------- APP LAYOUT ----------- */
#app-view { display: none; align-items: stretch; }
#app-view.active {
    display: grid;
    grid-template-columns: 300px 1fr 340px;
}

.panel {
    background-color: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* ----------- SOL SIDEBAR ----------- */
.profile-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.avatar {
    width: 56px; height: 56px; flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    border-radius: 50%; display: flex; justify-content: center; align-items: center;
    font-size: 1.4rem; font-weight: bold;
}
.badge {
    background-color: rgba(139,92,246,0.2); color: var(--accent);
    padding: 3px 8px; border-radius: 4px; font-size: 0.72rem; font-weight: 600;
    margin-top: 4px; display: inline-block;
}

.streak-bar {
    display: flex; align-items: center;
    background-color: #0f172a; border-radius: 10px;
    padding: 14px 16px; margin-bottom: 20px; gap: 12px;
}
.streak-item { display: flex; align-items: center; gap: 10px; flex: 1; }
.streak-icon { font-size: 1.5rem; line-height: 1; }
.streak-num { font-size: 1.5rem; font-weight: 700; color: var(--text-main); line-height: 1; }
.streak-lbl { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.streak-divider { width: 1px; height: 36px; background-color: var(--border); flex-shrink: 0; }

h2, h3 { color: var(--text-main); margin-bottom: 12px; }
h3 { font-size: 1rem; color: var(--text-muted); margin-bottom: 8px; }

.status-section, .goal-section, .total-stats {
    background-color: #0f172a; padding: 16px; border-radius: 8px; margin-bottom: 16px;
}
.status-section input { margin-bottom: 12px; }
.goal-input-row { display: flex; gap: 8px; margin-bottom: 12px; }
.progress-bar-container {
    width: 100%; height: 8px; background-color: var(--surface);
    border-radius: 4px; overflow: hidden; margin-bottom: 8px;
}
.progress-bar { height: 100%; background-color: var(--primary); width: 0%; transition: width 0.5s ease; }

/* ----------- DERS HEDEFLERİ ----------- */
.subject-goals-section {
    background-color: #0f172a; padding: 16px; border-radius: 8px; margin-bottom: 16px;
}
.subject-goals-header {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.subject-goals-header h3 { margin-bottom: 0; }
.icon-btn {
    background: none; border: none; cursor: pointer;
    font-size: 1rem; padding: 4px; border-radius: 6px;
    transition: background 0.2s;
}
.icon-btn:hover { background: var(--surface-hover); }

.subject-goal-item { margin-bottom: 10px; }
.subject-goal-row {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 4px;
}
.subject-goal-name { font-size: 0.8rem; font-weight: 500; }
.subject-goal-val { font-size: 0.75rem; color: var(--text-muted); }
.subject-goal-bar {
    height: 5px; background-color: var(--surface);
    border-radius: 3px; overflow: hidden;
}
.subject-goal-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }

/* Goals modal inputs */
.goal-modal-item {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px; gap: 12px;
}
.goal-modal-item label { font-size: 0.9rem; flex: 1; }
.goal-modal-item input {
    width: 70px; padding: 8px; text-align: center;
    font-size: 0.9rem;
}

/* ----------- TIMER ----------- */
.main-content { align-items: center; justify-content: center; text-align: center; }
.main-header {
    width: 100%; text-align: left; margin-bottom: auto;
    display: flex; align-items: center; justify-content: space-between;
}
.timer-container { display: flex; flex-direction: column; align-items: center; gap: 40px; margin: auto; }

.timer-circle { position: relative; width: 250px; height: 250px; }
.progress-ring { transform: rotate(-90deg); display: block; }
.progress-ring__circle {
    stroke: var(--primary);
    stroke-dasharray: 722; stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke 0.3s;
}
.time-display {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3.8rem; font-weight: 700; letter-spacing: -2px;
    text-shadow: 0 0 20px rgba(16,185,129,0.4);
}
.timer-label {
    position: absolute; bottom: -30px; left: 0; right: 0;
    color: var(--text-muted); font-weight: 500; font-size: 0.9rem;
}
.timer-controls { width: 300px; display: flex; flex-direction: column; gap: 16px; }
.subject-select { font-size: 1rem; text-align: center; }

/* ----------- MÜZİK OYNATICI ----------- */
.music-widget { position: relative; }
.music-toggle-btn {
    background: var(--surface-hover); border: 1px solid var(--border);
    border-radius: 10px; padding: 8px 12px; cursor: pointer;
    font-size: 1.1rem; transition: 0.2s; color: white;
}
.music-toggle-btn:hover { background: var(--accent); border-color: var(--accent); }
.music-toggle-btn.playing { background: var(--accent); border-color: var(--accent); animation: pulse-music 2s infinite; }
@keyframes pulse-music {
    0%, 100% { box-shadow: 0 0 0 0 rgba(139,92,246,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(139,92,246,0); }
}

.music-panel {
    position: absolute; top: calc(100% + 10px); right: 0;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px; width: 220px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4); z-index: 100;
}
.music-panel-title { font-weight: 600; margin-bottom: 12px; font-size: 0.9rem; }
.music-tracks { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.track-btn {
    background: #0f172a; border: 1px solid var(--border);
    border-radius: 8px; padding: 8px 12px; cursor: pointer;
    color: var(--text-muted); font-size: 0.85rem; text-align: left;
    transition: 0.2s; width: 100%;
}
.track-btn:hover { border-color: var(--accent); color: var(--text-main); }
.track-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(139,92,246,0.1); }
.music-controls { display: flex; flex-direction: column; gap: 10px; }
.volume-row { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.volume-row input { flex: 1; accent-color: var(--accent); }

/* ----------- SAĞ SIDEBAR ----------- */
.right-sidebar { padding: 0; overflow: hidden; }
.tabs { display: flex; border-bottom: 1px solid var(--border); }
.tab {
    flex: 1; padding: 12px 4px; text-align: center;
    cursor: pointer; font-weight: 500; color: var(--text-muted);
    transition: 0.2s; font-size: 0.82rem;
}
.tab.active { color: var(--primary); border-bottom: 2px solid var(--primary); }
.live-dot {
    display: inline-block; width: 7px; height: 7px;
    background-color: var(--danger); border-radius: 50%; margin-left: 4px;
    box-shadow: 0 0 8px var(--danger); animation: blink 2s infinite;
}
@keyframes blink { 0% { opacity: 1; } 50% { opacity: 0.3; } 100% { opacity: 1; } }

.tab-content { display: none; padding: 16px; flex: 1; overflow-y: auto; }
.tab-content.active { display: block; }

.feed-item, .lb-item {
    background-color: rgba(15,23,42,0.6);
    padding: 12px; border-radius: 8px; margin-bottom: 10px;
    display: flex; gap: 12px; align-items: center;
}
.feed-item .feed-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background-color: var(--surface-hover);
    display: flex; justify-content: center; align-items: center;
    font-weight: bold; flex-shrink: 0;
}
.feed-info h4 { font-size: 0.9rem; margin-bottom: 3px; }
.feed-info p { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 2px; }
.feed-info .subject-tag { color: var(--accent); font-weight: 600; }

.lb-item { justify-content: space-between; }
.lb-rank { font-size: 1.1rem; font-weight: bold; color: var(--primary); width: 28px; flex-shrink: 0; }
.empty-state { text-align: center; color: var(--text-muted); margin-top: 24px; font-size: 0.9rem; }

/* ----------- ARKADAŞ SEKMESİ ----------- */
.friends-section-title {
    font-size: 0.78rem; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.08em;
    margin-bottom: 10px;
}
.user-card {
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(15,23,42,0.6); padding: 10px 12px;
    border-radius: 8px; margin-bottom: 8px; gap: 10px;
}
.user-card-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.user-card-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem; font-weight: bold; flex-shrink: 0;
}
.user-card-name { font-size: 0.85rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card-hours { font-size: 0.72rem; color: var(--text-muted); }
.follow-btn {
    padding: 5px 10px; border-radius: 6px; border: none;
    font-size: 0.75rem; font-weight: 600; cursor: pointer;
    transition: 0.2s; flex-shrink: 0;
}
.follow-btn.follow { background: var(--primary); color: white; }
.follow-btn.follow:hover { background: var(--primary-hover); }
.follow-btn.unfollow { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.follow-btn.unfollow:hover { border-color: var(--danger); color: var(--danger); }

/* ----------- GEÇMİŞ ----------- */
.history-item {
    background-color: rgba(15,23,42,0.6);
    padding: 12px; border-radius: 8px; margin-bottom: 10px;
    display: flex; align-items: center; gap: 12px;
}
.history-subject-icon { font-size: 1.6rem; width: 36px; text-align: center; flex-shrink: 0; }
.history-info { flex: 1; }
.history-subject { font-weight: 600; font-size: 0.9rem; margin-bottom: 3px; }
.history-meta { font-size: 0.75rem; color: var(--text-muted); }
.history-duration {
    font-size: 0.85rem; font-weight: 700; color: var(--primary);
    background: rgba(16,185,129,0.1); padding: 4px 8px; border-radius: 6px; flex-shrink: 0;
}

/* ----------- MODALLER ----------- */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15,23,42,0.92); backdrop-filter: blur(6px);
    display: flex; justify-content: center; align-items: center;
    z-index: 1000; padding: 16px;
}
.modal-overlay.hidden { display: none; }
.modal {
    background-color: var(--surface); padding: 40px; border-radius: var(--radius);
    text-align: center; width: 100%; max-width: 440px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5); border: 1px solid var(--border);
    max-height: 90vh; overflow-y: auto;
}
.modal h2 { font-size: 1.8rem; margin-bottom: 14px; }
.modal p { font-size: 1rem; color: var(--text-muted); margin-bottom: 28px; line-height: 1.6; }
.modal .time-display { position: relative; font-size: 2.8rem; margin-bottom: 20px; transform: none; left: auto; top: auto; }
.neon-text { color: var(--primary); text-shadow: 0 0 10px rgba(16,185,129,0.4); }
.warning-text { color: #f59e0b; text-shadow: 0 0 10px rgba(245,158,11,0.4); }
.hidden { display: none !important; }
.mt-4 { margin-top: 16px; }

/* ----------- TOAST ----------- */
.toast-container {
    position: fixed; bottom: 80px; right: 20px;
    display: flex; flex-direction: column; gap: 10px;
    z-index: 2000; pointer-events: none;
}
.toast {
    padding: 12px 18px; border-radius: 10px;
    font-size: 0.9rem; font-weight: 500; color: white;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    animation: toast-in 0.3s ease; max-width: 300px;
}
.toast-success { background-color: var(--primary); }
.toast-info { background-color: var(--accent); }
.toast-warning { background-color: #f59e0b; }
.toast-fade-out { animation: toast-out 0.4s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(16px); } }

/* ----------- MOBİL ALT NAV ----------- */
.mobile-bottom-nav {
    display: none; position: fixed; bottom: 0; left: 0; right: 0;
    height: 64px; background-color: var(--surface);
    border-top: 1px solid var(--border);
    justify-content: space-around; align-items: center; z-index: 500;
}
.mob-nav-btn {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: 8px 20px; border-radius: 8px;
    transition: 0.2s; font-size: 0.72rem; font-weight: 600;
}
.mob-nav-btn.active { color: var(--primary); }
.mob-nav-icon { font-size: 1.3rem; }

/* ----------- GÖREV LİSTESİ ----------- */
.task-section {
    background-color: #0f172a; padding: 16px; border-radius: 8px; margin-bottom: 16px;
}
.task-section-header {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer; margin-bottom: 12px;
}
.task-section-header h3 { margin-bottom: 0; flex: 1; }
.task-toggle-icon { color: var(--text-muted); font-size: 0.75rem; transition: 0.2s; }
.task-toggle-icon.closed { transform: rotate(-90deg); }
.task-badge {
    background: var(--primary); color: white; border-radius: 10px;
    padding: 1px 7px; font-size: 0.7rem; font-weight: 700;
}
.task-input-row { margin-bottom: 10px; }
.task-input-row input { padding: 9px 12px; font-size: 0.85rem; }
.task-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 0; border-bottom: 1px solid var(--border);
}
.task-item:last-child { border-bottom: none; }
.task-checkbox {
    width: 18px; height: 18px; accent-color: var(--primary);
    cursor: pointer; flex-shrink: 0;
}
.task-text {
    flex: 1; font-size: 0.85rem; cursor: pointer; word-break: break-word;
    transition: 0.2s;
}
.task-text.done { text-decoration: line-through; color: var(--text-muted); }
.task-delete-btn {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; font-size: 1rem; padding: 2px 4px;
    border-radius: 4px; flex-shrink: 0; transition: 0.2s;
    opacity: 0;
}
.task-item:hover .task-delete-btn { opacity: 1; }
.task-delete-btn:hover { color: var(--danger); background: rgba(239,68,68,0.1); }

/* ----------- ODA BUTONU ----------- */
.room-header-btn {
    background: var(--surface-hover); border: 1px solid var(--border);
    border-radius: 10px; padding: 8px 12px; cursor: pointer;
    font-size: 0.85rem; font-weight: 600; color: var(--text-main);
    transition: 0.2s; white-space: nowrap;
}
.room-header-btn:hover { background: #3b82f6; border-color: #3b82f6; }
.room-header-btn.in-room { background: #3b82f6; border-color: #3b82f6; animation: pulse-room 2s infinite; }
@keyframes pulse-room {
    0%,100% { box-shadow: 0 0 0 0 rgba(59,130,246,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(59,130,246,0); }
}

/* ----------- GRUP ODALARI OVERLAY ----------- */
.room-overlay {
    position: fixed; inset: 0;
    background: rgba(15,23,42,0.85); backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    z-index: 900; padding: 20px;
}
.room-panel {
    background: var(--surface); border-radius: var(--radius);
    width: 100%; max-width: 560px; max-height: 90vh;
    overflow-y: auto; border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.room-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px; border-bottom: 1px solid var(--border);
    position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.room-panel-header h2 { margin: 0; font-size: 1.3rem; }

/* Oda içerik alanı */
.room-body { padding: 20px 24px; }
.room-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.room-tab {
    flex: 1; padding: 10px; border-radius: 8px; border: 1px solid var(--border);
    background: transparent; color: var(--text-muted); cursor: pointer;
    font-size: 0.85rem; font-weight: 600; transition: 0.2s;
}
.room-tab.active { background: #3b82f6; border-color: #3b82f6; color: white; }
.room-form-group { margin-bottom: 14px; }
.room-form-group label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 6px; }
.room-form-group input, .room-form-group select {
    padding: 10px 12px; font-size: 0.9rem;
}
.room-code-display {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    background: #0f172a; border-radius: 10px; padding: 16px;
    margin: 16px 0;
}
.room-code {
    font-size: 2rem; font-weight: 800; letter-spacing: 6px;
    color: #3b82f6; font-family: monospace;
}
.copy-btn {
    background: var(--surface-hover); border: 1px solid var(--border);
    border-radius: 8px; padding: 8px 12px; cursor: pointer;
    font-size: 0.8rem; color: var(--text-main); transition: 0.2s;
}
.copy-btn:hover { background: var(--primary); border-color: var(--primary); }
.room-info-card {
    background: #0f172a; border-radius: 10px; padding: 16px; margin-bottom: 16px;
}
.room-info-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.room-info-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 12px; }
.room-members-title {
    font-size: 0.75rem; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px;
}
.room-member-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 0; border-bottom: 1px solid var(--border);
}
.room-member-item:last-child { border-bottom: none; }
.room-member-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #3b82f6);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: bold; flex-shrink: 0;
}
.room-member-name { flex: 1; font-size: 0.85rem; }
.room-member-status { font-size: 0.75rem; }
.room-member-status.studying { color: var(--primary); }
.room-member-status.idle { color: var(--text-muted); }
.room-danger-btn {
    background: transparent; border: 1px solid var(--danger);
    color: var(--danger); border-radius: 8px; padding: 10px 16px;
    cursor: pointer; font-size: 0.85rem; font-weight: 600;
    transition: 0.2s; width: 100%; margin-top: 12px;
}
.room-danger-btn:hover { background: var(--danger); color: white; }
.room-empty { text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 0.9rem; }

/* ----------- TABLET ----------- */
@media (max-width: 1080px) {
    #app-view.active { grid-template-columns: 260px 1fr 300px; gap: 16px; }
}
@media (max-width: 900px) {
    #app-view.active { grid-template-columns: 240px 1fr; grid-template-rows: 1fr auto; }
    .right-sidebar { grid-column: 1 / -1; flex-direction: column; max-height: 380px; }
}

/* ----------- MOBİL ----------- */
@media (max-width: 768px) {
    body { padding: 0; align-items: flex-start; min-height: 100dvh; }

    #auth-view { padding: 16px; align-items: flex-start; padding-top: 40px; }
    .auth-card { width: 100%; max-width: 100%; padding: 28px 20px; border-radius: var(--radius); box-shadow: none; }

    #app-view.active { display: block; padding-bottom: 68px; min-height: 100dvh; max-width: 100%; gap: 0; }

    .panel { border-radius: 0; min-height: calc(100dvh - 68px); width: 100%; }

    .sidebar { display: none; }
    .sidebar.mob-active { display: flex !important; }
    .right-sidebar { display: none; max-height: unset; }
    .right-sidebar.mob-active { display: flex !important; flex-direction: column; }
    .main-content.mob-hidden { display: none !important; }

    .timer-circle { width: 210px; height: 210px; }
    .progress-ring { width: 210px !important; height: 210px !important; }
    .time-display { font-size: 3rem; }
    .timer-controls { width: 100%; max-width: 280px; }
    .timer-label { font-size: 0.82rem; }
    .timer-container { gap: 28px; }
    .main-content { padding: 20px 16px; }
    .main-header { margin-bottom: 16px; }
    .main-header h2 { font-size: 1.1rem; }
    .sidebar { padding: 20px 16px; }
    .tab-content { padding: 12px; }
    .tab { font-size: 0.72rem; padding: 10px 2px; }
    .modal { padding: 28px 20px; }
    .modal h2 { font-size: 1.5rem; }
    .toast-container { bottom: 76px; right: 12px; left: 12px; }
    .toast { max-width: 100%; }
    .mobile-bottom-nav { display: flex; }
    .streak-num { font-size: 1.3rem; }

    .music-panel { right: auto; left: 0; width: 200px; }
    .music-toggle-btn { padding: 6px 10px; font-size: 1rem; }
}

@media (max-width: 380px) {
    .time-display { font-size: 2.6rem; }
    .timer-circle { width: 180px; height: 180px; }
    .progress-ring { width: 180px !important; height: 180px !important; }
    .btn.large-btn { padding: 14px; font-size: 1rem; }
    .logo { font-size: 1.7rem; }
}
