:root {
    --bg: #ffffff;
    --text-main: #000000;
    --text-sub: #dddddd;
    --accent: #ff3b30;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #000000;
        --text-main: #ffffff;
        --text-sub: #222222;
    }
}

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

body {
    background-color: var(--bg);
    color: var(--text-main);
    font-family: -apple-system, sans-serif;
    margin: 0;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (orientation: landscape) {
    body { flex-direction: row !important; align-items: center; }
    .header { flex: 0 0 18% !important; border-right: 1px solid var(--text-sub); }
    .compass-area { flex: 1; padding: 10px !important; }
    .viewport { width: 75vh !important; height: 75vh !important; }
}

.header {
    flex: 0 0 18%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}
.degree { font-size: clamp(3rem, 10vh, 5rem); font-weight: 200; }

.compass-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.viewport {
    position: relative;
    width: 86vmin;
    height: 86vmin;
    max-width: 600px;
    max-height: 600px;
}

.pointer {
    position: absolute;
    top: -15px; left: 50%;
    width: 2px; height: 45px;
    background: var(--accent);
    transform: translateX(-50%);
    z-index: 100;
}

#disk {
    position: relative;
    width: 100%; height: 100%;
    border-radius: 50%;
    will-change: transform;
}

.guide-ring {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid var(--text-sub);
    pointer-events: none;
}

.item {
    position: absolute;
    top: 50%; left: 50%;
    transform-origin: center center;
    display: flex; align-items: center; justify-content: center;
    white-space: nowrap;
    transition: color 0.15s, transform 0.1s;
}

.active { color: var(--accent) !important; font-weight: bold; }

.label-8 { font-size: clamp(14px, 4vmin, 20px); font-weight: 800; }
.label-bgua-txt { font-size: clamp(11px, 3.2vmin, 16px); }
.label-bgua-sym { font-size: clamp(20px, 4.5vmin, 28px); font-family: serif; }
.label-24 { font-size: clamp(8px, 3vmin, 12px); }
.label-deg { font-size: 8px; opacity: 0.5; }

.tick { width: 1px; background: var(--text-sub); height: 5px; }
.tick-m { width: 1.5px; background: var(--text-main); height: 10px; }

.taiji {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 22%; height: 22%;
    z-index: 5;
    cursor: pointer;
}

.taiji.working {
    animation: rotate-taiji 10s linear infinite;
}

@keyframes rotate-taiji {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}
