/* =========================================================================
   GLOBAL STYLES
   ========================================================================= */

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: #050505;
    color: white;
    font-family: system-ui, -apple-system, sans-serif;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

* {
    box-sizing: border-box;
}

#app-container {
    position: relative;
    width: 100%;
    height: 100%;
}

#sunset-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(30, 15, 0, 0.95);
    opacity: 0;
    pointer-events: none;
    z-index: 800;
    transition: opacity 1s linear;
}

/* =========================================================================
   NAVIGATION BAR
   ========================================================================= */

#nav-bar {
    position: fixed;
    bottom: 30px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 20px;
    z-index: 3000;
    padding-bottom: env(safe-area-inset-bottom);
    pointer-events: auto;
}

.nav-btn {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.nav-btn svg {
    width: 24px;
    height: 24px;
    fill: #888;
    transition: fill 0.3s;
    pointer-events: none;
}

.nav-btn.active {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.15) translateY(-5px);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.nav-btn.active svg {
    fill: white;
}

/* =========================================================================
   VIEWS & CANVAS
   ========================================================================= */

#view-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
}

/* =========================================================================
   HEADER
   ========================================================================= */

#header-area {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
}

#app-title {
    font-size: 14px;
    letter-spacing: 2px;
    color: #444;
    text-transform: uppercase;
    padding: 20px;
    cursor: pointer;
    user-select: none;
}

/* =========================================================================
   MODALS
   ========================================================================= */

.modal-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 360px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 25px;
    z-index: 6000;
    display: none;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
}

#timer-display {
    text-align: center;
    color: #4a90e2;
    font-size: 18px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
    font-weight: bold;
}

.setting-row {
    margin-bottom: 20px;
}

.setting-label {
    display: block;
    color: #888;
    margin-bottom: 8px;
    font-size: 14px;
}

.opt-btn {
    background: #333;
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    margin-right: 4px;
    font-size: 13px;
    margin-bottom: 5px;
}

.opt-btn.selected {
    background: #4a90e2;
}

.action-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    margin-top: 10px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    display: block;
    text-align: center;
    text-decoration: none;
}

.close-btn {
    background: #444;
    color: white;
    margin-bottom: 10px;
}

.pause-btn {
    background: #d35400;
    color: white;
    margin-bottom: 5px;
}

.resume-btn {
    background: #27ae60;
    color: white;
    margin-bottom: 5px;
}

.quit-btn {
    background: #c0392b;
    color: white;
    margin: 20px 0;
    border: 1px solid #e74c3c;
}



.update-confirm-btn {
    background: #4a90e2;
    color: white;
    margin-top: 0;
}

.donate-btn {
    background: #333;
    color: #f1c40f;
    border: none;
    margin-top: 5px;
    font-size: 13px;
    font-weight: normal;
    transition: background 0.2s;
}

.donate-btn:active {
    background: #444;
}

.modal-overlay h2 {
    font-size: 18px;
    color: white;
    margin-top: 0;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.modal-overlay p {
    font-size: 14px;
    color: #aaa;
    line-height: 1.5;
    margin-bottom: 12px;
}

.modal-subtitle {
    font-size: 13px;
    color: #666;
    margin-top: -8px;
    margin-bottom: 20px;
    font-style: italic;
}

/* =========================================================================
   START SCREEN
   ========================================================================= */

#start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #050505;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#info-btn {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid #444;
    color: #666;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: monospace;
    font-size: 16px;
    cursor: pointer;
}

#update-btn {
    position: absolute;
    top: 30px;
    left: 30px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid #444;
    color: #666;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

#update-btn svg {
    width: 14px;
    height: 14px;
    fill: #666;
}

.picker-section {
    margin: 20px 0;
    text-align: center;
    width: 90%;
    max-width: 400px;
}

.picker-label {
    color: #555;
    font-size: 11px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.start-opt-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.start-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #888;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 14px;
    min-width: 60px;
}

.start-btn.selected {
    background: #4a90e2;
    color: white;
    border-color: #4a90e2;
    box-shadow: 0 0 15px rgba(74, 144, 226, 0.4);
}

#begin-btn {
    margin-top: 30px;
    padding: 15px 50px;
    background: white;
    color: black;
    border-radius: 30px;
    font-weight: bold;
    letter-spacing: 1px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    transition: transform 0.1s;
}

#begin-btn:active {
    transform: scale(0.95);
}

/* =========================================================================
   ADMIN OVERLAY
   ========================================================================= */

#admin-overlay {
    position: fixed;
    top: 10px;
    left: 10px;
    width: 220px;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #c0392b;
    border-radius: 8px;
    padding: 12px;
    z-index: 10000;
    display: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
    font-size: 12px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #c0392b;
}

.admin-header span {
    color: #e74c3c;
    font-weight: bold;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.admin-close-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.admin-close-btn:hover {
    color: #fff;
}

.admin-section {
    margin-bottom: 12px;
}

.admin-section:last-child {
    margin-bottom: 0;
}

.admin-section h3 {
    font-size: 11px;
    color: #666;
    margin: 0 0 6px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-info {
    background: #111;
    border-radius: 4px;
    padding: 8px;
    font-family: monospace;
    font-size: 11px;
}

.admin-info p {
    margin: 4px 0;
    color: #888;
}

.admin-info span {
    color: #4a90e2;
}

.admin-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.admin-btn {
    background: #2a2a2a;
    border: 1px solid #444;
    color: #ccc;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.admin-btn:hover {
    background: #3a3a3a;
    border-color: #555;
}

.admin-btn:active {
    background: #4a4a4a;
}

.admin-btn.active {
    background: #e74c3c;
    border-color: #c0392b;
    color: white;
}

/* =========================================================================
   UTILITY CLASSES (moved from inline styles)
   ========================================================================= */

.mt-20 {
    margin-top: 20px;
}

.flex-row {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.flex-1 {
    flex: 1;
}

.mt-0 {
    margin-top: 0;
}

.mb-0 {
    margin-bottom: 0;
}

.warning-text {
    color: #e67e22;
}

.app-logo {
    font-weight: 300;
    color: #aaa;
    font-size: 24px;
    letter-spacing: 3px;
    margin-bottom: 20px;
}

.session-id {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #666;
    text-align: center;
    margin: 10px 0;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    word-break: break-all;
}

#nav-bar {
    display: none;
    opacity: 0;
    transition: opacity 2s;
}
