/* ========================================
   Analog Clock — Silver & Gold Theme
   ======================================== */
:root {
    --primary: #E5E7EB;
    --secondary: #F59E0B;
    --accent: #FDE68A;
    --bg: #111827;
    --bg-card: rgba(17, 24, 39, 0.85);
    --bg-hover: #1F2937;
    --border: rgba(229, 231, 235, 0.1);
    --border-hover: rgba(245, 158, 11, 0.3);
    --text: #F3F4F6;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    --radius: 12px;
    --font: 'Inter', -apple-system, sans-serif;
    --transition: 0.2s ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.app {
    max-width: 720px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.logo-icon {
    font-size: 1.3rem;
}

.logo h1 {
    font-size: 1.15rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.header-actions select {
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(17, 24, 39, 0.7);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.75rem;
    outline: none;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    background: transparent;
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--bg-hover);
}

/* Clock Section */
.clock-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.5rem;
}

canvas {
    max-width: 100%;
}

.digital-display {
    font-size: 1.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--primary);
    margin-top: 0.5rem;
    letter-spacing: 0.05em;
}

.date-display {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* Controls Row */
.controls-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.control-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem;
}

.control-card h3 {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.control-card select,
.control-card input[type="time"] {
    width: 100%;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(17, 24, 39, 0.7);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.8rem;
    outline: none;
}

.control-card select:focus,
.control-card input:focus {
    border-color: var(--secondary);
}

.sw-display {
    font-size: 1.1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--secondary);
    margin-bottom: 0.4rem;
}

.sw-btns,
.alarm-btns {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.3rem;
}

.alarm-status {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.laps {
    max-height: 80px;
    overflow-y: auto;
    margin-top: 0.3rem;
}

.lap-item {
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 0.1rem 0;
    font-variant-numeric: tabular-nums;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.6rem;
    border: none;
    border-radius: 6px;
    font-family: var(--font);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-sm {
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    color: #111827;
}

.btn-sm:hover {
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-hover);
}

.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 0.55rem 1rem;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 100;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.hidden {
    display: none !important;
}

@media (max-width: 600px) {
    .controls-row {
        grid-template-columns: 1fr;
    }

    canvas {
        width: 300px;
        height: 300px;
    }
}