:root {
    --primary-color: #6366f1;
    --secondary-color: #4f46e5;
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 1rem;
}

/* ヘッダー・時計エリア */
header {
    text-align: center;
    margin-bottom: 2rem;
}

.clock-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.current-time-display {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    letter-spacing: -2px;
}

.time-adjustment {
    display: flex;
    justify-content: center;
    gap: 1rem;
    align-items: center;
}

.time-adjustment button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
}

/* ボタンエリア */
.button-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.btn {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 1.5rem 1rem;
    border-radius: var(--radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn:active {
    transform: scale(0.95);
    opacity: 0.8;
}

/* 階層ごとの配色 */
.level-0 {
    border-left: 8px solid #6366f1;
    /* Indigo */
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.1) 0%, var(--card-bg) 100%);
}

.level-1 {
    border-left: 8px solid #8b5cf6;
    /* Violet */
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.1) 0%, var(--card-bg) 100%);
}

.level-2 {
    border-left: 8px solid #d946ef;
    /* Fuchsia */
    background: linear-gradient(90deg, rgba(217, 70, 239, 0.1) 0%, var(--card-bg) 100%);
}

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

.btn-back {
    grid-column: span 2;
    background: rgba(255, 255, 255, 0.05);
}

/* 履歴エリア */
.history-section {
    margin-top: 2rem;
}

.history-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1rem;
}

.history-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.history-item:last-child {
    border-bottom: none;
}

.history-time {
    font-weight: 600;
    color: var(--text-muted);
}

.history-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.history-item:last-child {
    border-bottom: none;
}

.history-main {
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
}

.history-time-large {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary-color);
    font-family: monospace;
}

.history-code-large {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--success-color);
    font-family: monospace;
}

.history-sub {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ユーティリティ */
.hidden {
    display: none !important;
}

.nav-hint {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}