body {
    background: #e8eef3;
    font-family: 'Zen Maru Gothic', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 10px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    color: #333;
    min-height: 100dvh;
    box-sizing: border-box;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}
.back-btn {
    align-self: flex-start;
    text-decoration: none;
    color: #2e7d32;
    font-weight: bold;
    font-size: 0.85rem;
    margin: 0 0 8px 4px;
}
.game-container {
    background: #fff;
    padding: 10px 12px 14px;
    border-radius: 18px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 560px;
    text-align: center;
    box-sizing: border-box;
}
h1 { font-size: 1.15rem; color: #d84315; margin: 2px 0 2px; }
.proto-badge {
    display: inline-block; font-size: 0.7rem; color: #fff; background: #90a4ae;
    border-radius: 8px; padding: 1px 6px; vertical-align: middle; margin-left: 4px;
}
#message { font-size: 0.95rem; color: #444; margin: 4px 0 6px; min-height: 1.4em; }
#message.warn { color: #d84315; }
.hud {
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 8px;
    font-size: 0.78rem; color: #555; margin: 0 2px 6px;
}
.hud b { color: #222; font-size: 0.95rem; }
.canvas-wrap { position: relative; width: 100%; }
#circleCanvas {
    display: block; width: 100%; margin: 0 auto; border-radius: 14px;
    touch-action: none; -ms-touch-action: none;
    background: #fffdf6; cursor: crosshair;
    box-shadow: inset 0 0 0 2px #ffe0b2;
}
#draw-screen.hidden { display: none; }

/* ===== 飛ばし画面（横スコアメートル） ===== */
.flight-screen {
    margin: 4px 0 0;
    padding: 8px 6px 4px;
    border-radius: 14px;
    background: linear-gradient(180deg, #e3f2fd 0%, #fff8e1 100%);
    box-shadow: inset 0 0 0 2px #bbdefb;
}
.flight-screen.hidden { display: none; }
.flight-total {
    margin: 0 0 8px; font-size: 1.15rem; color: #1565c0;
}
.flight-total.hidden { display: none; }
.flight-total b { font-size: 1.55rem; color: #d84315; }
.meter-area {
    display: flex; flex-direction: column; gap: 10px;
    align-items: stretch; justify-content: flex-start;
}
.meter-track {
    position: relative;
    width: 100%;
    height: 52px;
    margin: 56px 4px 22px;
    box-sizing: border-box;
    border-radius: 18px;
    background: #eceff1;
    box-shadow: inset 0 0 0 3px #90a4ae;
    overflow: visible;
}
.meter-fill {
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 0%;
    height: 100%;
    border-radius: 15px 0 0 15px;
    background: linear-gradient(90deg, #66bb6a 0%, #43a047 55%, #2e7d32 100%);
    transition: none;
    pointer-events: none;
}
.meter-ticks {
    position: absolute; inset: 0;
    pointer-events: none;
}
.meter-ticks span {
    position: absolute; top: calc(100% + 6px);
    transform: translateX(-50%);
    font-size: 0.72rem; color: #546e7a; white-space: nowrap;
    line-height: 1;
}
.meter-ticks span[data-v="0"] { left: 0%; }
.meter-ticks span[data-v="100"] { left: 25%; }
.meter-ticks span[data-v="200"] { left: 50%; }
.meter-ticks span[data-v="300"] { left: 75%; }
.meter-ticks span[data-v="400"] { left: 100%; }
.meter-ticks span::after {
    content: '';
    position: absolute; left: 50%; bottom: calc(100% + 4px);
    width: 2px; height: 10px; background: #90a4ae;
    transform: translateX(-50%);
}
.shigeru-flyer {
    position: absolute; left: 0%; bottom: 100%;
    width: 64px; height: 64px;
    margin-bottom: 2px;
    display: flex; align-items: center; justify-content: center;
    font-size: 56px; line-height: 1;
    filter: drop-shadow(0 3px 4px rgba(0,0,0,0.25));
    will-change: left, transform;
    z-index: 2;
    pointer-events: none;
    user-select: none;
}
.flight-breakdown {
    list-style: none; margin: 4px 0 0; padding: 0;
    text-align: left; font-size: 0.88rem;
    display: flex; flex-direction: column; gap: 6px;
}
.flight-breakdown.hidden { display: none; }
.flight-breakdown li {
    display: flex; justify-content: space-between; gap: 8px;
    padding: 6px 10px; background: rgba(255,255,255,0.75);
    border-radius: 10px;
}
.flight-breakdown li b { color: #d84315; }
.flight-record { margin: 10px 0 4px; }
.flight-record.hidden { display: none; }
.flight-record-main {
    margin: 0; font-size: 1.35rem; color: #d84315;
}
.flight-record-main b { font-size: 1.7rem; }
.flight-record-sub {
    margin: 4px 0 0; font-size: 0.9rem; color: #555;
}
.flight-record-sub.best { color: #2e7d32; font-weight: bold; }

.result { margin: 10px 0 0; }
.result.hidden { display: none; }
.result .score { font-size: 1.55rem; color: #d84315; margin: 0; }
.result .score b { font-size: 2.05rem; }
.result .sub { font-size: 0.9rem; color: #555; margin: 4px 0 0; min-height: 1.2em; }
.result .sub.best { color: #2e7d32; }
.buttons { display: flex; gap: 10px; justify-content: center; margin-top: 10px; }
.main-btn {
    font-family: inherit; font-size: 1.1rem; font-weight: bold; border: none; border-radius: 30px;
    padding: 12px 22px; color: #fff; cursor: pointer; box-shadow: 0 4px 0 rgba(0,0,0,0.18);
    flex: 1; max-width: 220px; background: #ff7043;
}
.main-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,0.18); }
.main-btn.solo { flex: 1; max-width: 320px; font-size: 1.2em; }
.main-btn.fly { background: #43a047; }
.main-btn.hidden { display: none; }
.action-hint {
    margin: 6px 0 0; font-size: 0.78rem; color: #666; min-height: 1.1em;
}
.action-hint.hidden { display: none; }
.seo-text-box { margin-top: 24px; max-width: 560px; font-size: 0.85rem; color: #555; line-height: 1.7; padding: 0 8px; }
.seo-text-box h2 { font-size: 1rem; color: #333; }

@media (max-width: 380px) {
    .meter-track { height: 44px; margin-top: 50px; }
    .flight-breakdown { font-size: 0.8rem; }
    .shigeru-flyer { width: 56px; height: 56px; font-size: 48px; }
}
