:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --font-main: 'Inter', 'Noto Sans JP', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.5;
    font-size: 16px;
    padding-bottom: 40px;
}

.app-container {
    max-width: 600px;
    /* Mobile focused but constrained on desktop */
    margin: 0 auto;
    padding: 1rem;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.app-header h1 {
    font-size: 1.25rem;
    font-weight: 800;
    background: linear-gradient(90deg, #60a5fa, #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#clock-display {
    font-family: monospace;
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.card h2,
.card h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-main);
    font-weight: 600;
}

.card h2 {
    font-size: 1.4rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-group-row {
    display: flex;
    gap: 1rem;
}

input,
select {
    width: 100%;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

input:focus,
select:focus {
    border-color: var(--primary);
}

/* Buttons */
button {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
    margin-top: 0.5rem;
}

button:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-secondary {
    background-color: var(--secondary);
    color: #064e3b;
}

.btn-warning {
    background-color: var(--warning);
    color: #451a03;
}

.btn-danger {
    background-color: var(--danger);
    color: white;
    margin-top: 2rem;
}

/* Status Grid */
.status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.status-card {
    background-color: var(--bg-card);
    padding: 1rem;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    border: 1px solid var(--border);
}

.status-card.highlight {
    grid-column: span 2;
    background: linear-gradient(135deg, var(--bg-card), #1e3a8a);
    border-color: var(--primary);
}

.status-card .label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-card .value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Progress Bar */
.progress-bar {
    height: 4px;
    background-color: var(--bg-dark);
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.progress-bar .fill {
    height: 100%;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

.progress-bar-cage {
    background-color: var(--warning);
}

/* Charts */
.chart-container {
    position: relative;
    height: 250px;
    width: 100%;
}

/* Utilities */
.hidden {
    display: none !important;
}

.card-header-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.result-item {
    background-color: var(--bg-dark);
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.result-item span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.result-item strong {
    font-size: 1.25rem;
    color: var(--text-main);
    margin-top: 0.25rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--secondary);
    color: #064e3b;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 100;
    animation: fadeUp 0.3s ease-out;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}