:root {
    --bg: #1a1a2e;
    --bg-card: #16213e;
    --bg-input: #0f1a2e;
    --accent: #e94560;
    --accent-hover: #d63851;
    --text: #eee;
    --text-muted: #8892a4;
    --owen: #4ecca3;
    --saul: #f0a500;
    --radius: 10px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.5;
    min-height: 100vh;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
}

main {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px 0;
}

/* Avatars */
.avatar {
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.avatar-sm {
    width: 24px;
    height: 24px;
}

.avatar-md {
    width: 36px;
    height: 36px;
}

.avatar-lg {
    width: 48px;
    height: 48px;
}

/* Header */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

header h1 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--accent);
}

header nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-badge {
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--bg-card);
}

.user-owen { color: var(--owen); }
.user-saul { color: var(--saul); }

.logout-form { display: flex; }

.logout-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
}

.logout-btn:hover { color: var(--text); }

/* Hero */
.hero {
    text-align: center;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tagline {
    font-size: 18px;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 4px;
}

.mission {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    max-width: 375px;
    margin: 0 auto;
}

/* Login */
.login-card {
    max-width: 340px;
    margin: 60px auto;
    text-align: center;
}

.login-subtitle {
    color: var(--text-muted);
    margin-bottom: 28px;
    font-size: 15px;
}

.login-form label {
    display: block;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-form input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.login-form input[type="password"]:focus {
    border-color: var(--accent);
}

.who-label {
    margin-top: 24px;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--text-muted);
}

.name-buttons {
    display: flex;
    gap: 12px;
}

.name-btn {
    flex: 1;
    padding: 14px;
    border: 2px solid;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    background: var(--bg-card);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.owen-btn {
    color: var(--owen);
    border-color: var(--owen);
}

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

.saul-btn {
    color: var(--saul);
    border-color: var(--saul);
}

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

.error {
    background: rgba(233, 69, 96, 0.15);
    color: var(--accent);
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 16px;
}

/* Countdown */
.countdown {
    text-align: center;
    padding: 8px 0;
}

.days-left {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 6px;
}

.countdown-sub {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.celebration .days-left {
    color: var(--accent);
    font-size: 42px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Calendar Grid */
.cal-grid {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    gap: 3px;
    max-width: 320px;
    margin: 0 auto;
}

.cal-day {
    aspect-ratio: 1;
    border-radius: 2px;
    background: var(--bg-card);
}

.cal-elapsed {
    background: var(--accent);
    opacity: 0.8;
}

.cal-today {
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent), 0 0 2px var(--accent);
}

.cal-future {
    background: var(--bg-card);
}

/* Streaks */
.streaks {
    display: flex;
    gap: 10px;
}

.streak-card {
    flex: 1;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.streak-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.streak-name {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.streak-count {
    font-size: 20px;
    font-weight: 800;
}

.streak-count.zero {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}

.both-logged {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--owen);
    background: rgba(78, 204, 163, 0.1);
    padding: 8px;
    border-radius: var(--radius);
}

/* Log form */
.log-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.already-logged {
    font-size: 13px;
    color: var(--text-muted);
}

.log-form label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.log-form textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
    min-height: 80px;
}

.log-form textarea:focus {
    border-color: var(--accent);
}

.log-btn {
    display: block;
    width: 100%;
    padding: 12px;
    margin-top: 8px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.log-btn:hover {
    background: var(--accent-hover);
}

/* Timeline */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 24px;
}

.day-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.day-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.entry {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 10px 12px;
    border-left: 3px solid transparent;
    display: flex;
    flex-direction: column;
}

.entry-owen { border-left-color: var(--owen); }
.entry-saul { border-left-color: var(--saul); }

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.entry-who {
    display: flex;
    align-items: center;
    gap: 6px;
}

.entry-user {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.entry-time {
    font-size: 12px;
    color: var(--text-muted);
}

.entry-body {
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
}

.empty-state {
    text-align: center;
    padding: 24px 0;
    color: var(--text-muted);
}

/* Focus visible for accessibility */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
