:root {
    --primary: #00d2ff;
    --secondary: #3a7bd5;
    --bg-dark: #050814;
    --text-light: #f0f4f8;
    --sub-text: #9ca3af;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    --sim-bg: #f0f2f5;
    --sim-card: #ffffff;
    --sim-text: #1e293b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Pretendard', sans-serif;
    touch-action: manipulation;
}

body {
    background-color: var(--sim-bg);
    color: var(--sim-text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header.site-nav {
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    background: rgba(5, 8, 20, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    font-size: 1.2rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}

.nav-tag {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.nav-tag:hover {
    background: var(--primary);
    color: var(--bg-dark);
}

main {
    flex: 1;
    padding: 140px 20px 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sim-header {
    max-width: 1100px;
    width: 100%;
    text-align: center;
    margin-bottom: 30px;
}
.sim-header h1 {
    font-size: 2.2rem;
    color: #0f172a;
    margin-bottom: 12px;
    font-weight: 800;
}
.sim-header p {
    font-size: 1.05rem;
    color: #64748b;
    line-height: 1.7;
    margin-top: 0;
    word-break: keep-all;
}
.ma-info {
    display: inline-block;
    margin-top: 15px;
    padding: 6px 18px;
    background-color: #e2e8f0;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #475569;
    font-weight: 600;
}

.sim-container {
    background: var(--sim-card);
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.08);
    display: flex;
    gap: 50px;
    max-width: 1100px;
    width: 100%;
    margin-bottom: 40px;
    align-items: flex-start; 
}

.clock-viewport {
    position: relative;
    width: 100%;
    max-width: 450px;
    aspect-ratio: 1 / 1; 
    border-radius: 50%;
    background: #f8fafc;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.05);
    overflow: hidden;
    cursor: grab;
    flex-shrink: 0;
    border: 2px solid #e2e8f0;
    margin: 0 auto;
    touch-action: none; 
    align-self: flex-start;
}
.clock-viewport:active { cursor: grabbing; }

#geo-svg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: block;
}

.geo-slice { 
    transition: opacity 0.2s; 
    cursor: pointer; 
    stroke: #fff; 
    stroke-width: 1.5px; 
    vector-effect: non-scaling-stroke; 
    stroke-linejoin: round; 
}

.marker-text { pointer-events: none; user-select: none; }
.marker-line { pointer-events: none; vector-effect: non-scaling-stroke; stroke-width: 2px; }

.clock-center {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 48%; 
    height: 48%; 
    background: rgba(255, 255, 255, 0.8); 
    border-radius: 50%; display: flex; flex-direction: column; justify-content: center;
    align-items: center; text-align: center; box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    z-index: 10; pointer-events: none; padding: 10px; box-sizing: border-box;
}
#info-title { font-size: 1.1rem; font-weight: 800; margin-bottom: 8px; color: #1e293b; line-height: 1.2; word-break: keep-all;}
#info-actual-time { font-size: 0.8rem; color: #dc2626; font-weight: 700; margin-bottom: 4px; }
#info-time { font-size: 0.8rem; color: #3b82f6; margin-bottom: 6px; font-weight: 700; }
#info-duration { font-size: 0.75rem; color: #64748b; line-height: 1.4; word-break: keep-all;}

.side-panel { flex: 1; display: flex; flex-direction: column; overflow: hidden; width: 100%;}
.controls { background: #f1f5f9; padding: 20px; border-radius: 16px; margin-bottom: 15px; border: 1px solid #e2e8f0; }
.controls label { display: flex; align-items: center; margin-bottom: 10px; cursor: pointer; font-weight: 600; font-size: 0.95rem; color: #334155; }
.controls input[type="radio"] { margin-right: 12px; transform: scale(1.1); }
#age-input-container { margin-top: 10px; padding-left: 28px; font-size: 0.9rem; color: #64748b; }
#age-input { width: 55px; padding: 4px; border: 1px solid #cbd5e1; border-radius: 6px; text-align: center; font-weight: bold; }

.legend-container { flex: 1; overflow-y: auto; padding-right: 10px; }
.legend-item { display: flex; align-items: center; padding: 8px 10px; margin-bottom: 4px; border-radius: 10px; cursor: pointer; transition: all 0.2s; border: 1px solid transparent; }
.color-box { width: 16px; height: 16px; border-radius: 4px; margin-right: 12px; flex-shrink: 0; }
.legend-text { flex: 1; font-size: 0.9rem; font-weight: 700; color: #334155; }
.legend-actual { font-size: 0.75rem; color: #94a3b8; font-weight: 500; margin-left: 5px; }
.legend-duration { font-weight: 700; color: #64748b; font-size: 0.8rem; text-align: right; min-width: 65px; }
.level-1 { padding-left: 25px; position: relative; }
.level-1::before { content: "└"; position: absolute; left: 10px; color: #94a3b8; }
.level-2 { padding-left: 45px; position: relative; }
.level-2::before { content: "└"; position: absolute; left: 30px; color: #cbd5e1; }

.table-section { 
    background: var(--sim-card); padding: 40px; border-radius: 24px; 
    box-shadow: 0 20px 40px rgba(0,0,0,0.05); max-width: 1100px; width: 100%; 
    box-sizing: border-box; overflow-x: auto; margin-bottom: 40px;
}
.table-section h2 { margin-top: 0; color: #0f172a; border-left: 6px solid var(--primary); padding-left: 15px; font-size: 1.5rem; margin-bottom: 25px; }
.ref-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.ref-card { background: #fff; padding: 24px; border-radius: 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.04); border: 1px solid #f1f5f9; }
.ref-card h3 { color: var(--secondary); margin-bottom: 12px; font-size: 1.1rem; display: flex; align-items: center; gap: 10px; }
.ref-card p { color: #475569; line-height: 1.65; font-size: 0.95rem; margin-bottom: 12px; word-break: keep-all; }

.geo-table { width: 100%; min-width: 600px; border-collapse: collapse; font-size: 0.9rem; }
.geo-table th, .geo-table td { border: 1px solid #e2e8f0; padding: 12px; text-align: center; }
.geo-table th { background-color: #f8fafc; font-weight: 700; color: #1e293b; }
.eng-sub { color: #CCCCCC; font-size: 0.75rem; display: block; margin-top: 2px; font-weight: 400; }
.age-cell { position: relative; vertical-align: bottom; border-bottom: 1px solid #cbd5e1 !important; width: 140px; }
.age-val { position: absolute; bottom: 0; left: 50%; transform: translate(-50%, 50%); background-color: white; padding: 0 6px; color: #dc2626; font-weight: 800; font-size: 0.85rem; z-index: 5; line-height: 1; }
.no-bottom-border { border-bottom: none !important; }

.site-footer {
    padding: 60px 5%;
    border-top: 1px solid var(--glass-border);
    text-align: center;
    background: #050814;
    color: var(--sub-text);
}
.contact-info { color: #fff; margin-bottom: 20px; font-size: 0.95rem; }
.contact-info a { color: var(--sub-text); text-decoration: none; margin-left: 10px; transition: color 0.3s; }
.contact-info a:hover { color: var(--primary); }
.footer-links { display: flex; justify-content: center; align-items: center; gap: 15px; flex-wrap: wrap; }
.footer-links a { color: var(--sub-text); text-decoration: none; font-size: 0.85rem; transition: color 0.3s; }
.footer-links a:hover { color: var(--primary); }
.footer-links span { color: var(--glass-border); font-size: 0.8rem; }

@media (max-width: 800px) {
    .sim-container { flex-direction: column; padding: 20px; gap: 30px; align-items: center; }
    .clock-viewport { max-width: 90vw; width: 90vw; height: 90vw; }
    .table-section { padding: 20px 10px; border-radius: 16px; }
    .table-section h2 { font-size: 1.25rem; margin-bottom: 15px; }
    .geo-table { min-width: 100%; font-size: 0.75rem; }
    .geo-table th, .geo-table td { padding: 8px 4px; word-break: keep-all; }
    .eng-sub { display: none; }
    .eon-cell { writing-mode: vertical-rl; text-orientation: upright; letter-spacing: 2px; padding: 10px 4px !important; white-space: nowrap; }
    .age-cell { width: auto; }
    .age-val { font-size: 0.7rem; padding: 2px 4px; }
}