﻿:root {
    --bg: #0f172a;
    --surface: #1e293b;
    --text: #f8fafc;
    --subtext: #94a3b8;
    --accent: #ef4444; /* Red for pomodoro */
    --accent-glow: rgba(239, 68, 68, 0.4);
    font-family: 'Inter', system-ui, sans-serif;
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    background-color: var(--bg);
    color: var(--text);
    overflow: hidden; /* Native feel, prevent bounce */
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.app-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh; /* For mobile browser toolbars */
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

/* Sticky Header */
.app-header {
    position: sticky;
    top: 0;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.85); /* Glassmorphism */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10;
}

.logo {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.btn-share {
    background: var(--surface);
    color: var(--text);
    border: 1px solid #334155;
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.15s ease;
}

/* Scrollable Main Space */
.app-main {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.5rem;
}

.timer-surface {
    background: var(--surface);
    border-radius: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px 40px 20px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05);
}

.mode-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 35px;
    background: rgba(15, 23, 42, 0.5);
    padding: 6px;
    border-radius: 30px;
}

.mode-btn {
    background: transparent;
    border: none;
    color: var(--subtext);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

    .mode-btn.active {
        background: var(--surface);
        color: var(--text);
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }

.timer-display {
    position: relative;
    width: 260px;
    height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-ring-bg {
    fill: transparent;
    stroke: var(--bg);
    stroke-width: 10;
}

.progress-ring-fill {
    fill: transparent;
    stroke: var(--accent);
    stroke-width: 10;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    transition: stroke-dashoffset 0.1s linear, stroke 0.4s ease;
    filter: drop-shadow(0 0 12px var(--accent-glow));
}

.time-text {
    position: absolute;
    font-size: 4.5rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -2px;
    text-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.controls {
    margin-top: 40px;
    display: flex;
    align-items: center;
    gap: 20px;
}

button {
    cursor: pointer;
    outline: none;
    touch-action: manipulation;
}

.btn-primary, .btn-secondary {
    padding: 16px 48px;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 700;
    border: none;
    color: white;
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
}

.btn-primary {
    background: var(--accent);
    box-shadow: 0 10px 25px var(--accent-glow);
}

.btn-secondary {
    background: #334155;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--subtext);
    font-size: 1rem;
    font-weight: 600;
    padding: 10px;
    transition: transform 0.15s ease;
}

    /* Scale down clicks on all interactive buttons */
    .btn-primary:active, .btn-secondary:active, .btn-icon:active, .btn-share:active, .mode-btn:active {
        transform: scale(0.92);
    }

/* Sticky Footer */
.app-footer {
    position: sticky;
    bottom: 0;
    padding: 2rem;
    background: rgba(15, 23, 42, 0.85); /* Glassmorphism */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.name-input {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid #334155;
    color: var(--text);
    padding: 14px 20px;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 500;
    width: 100%;
    max-width: 300px;
    box-sizing: border-box;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

    .name-input:focus {
        outline: none;
        border-color: var(--accent);
        background: var(--surface);
        box-shadow: 0 0 0 3px var(--accent-glow);
    }

.players-tray {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--subtext);
    flex-wrap: wrap;
    gap: 8px;
    text-align: center;
}

.live-indicator {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
    animation: pulse 2s infinite;
}

.player-list {
    color: var(--text);
    font-weight: 500;
}

@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}
