:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --accent-circle: #f43f5e;
    --accent-grand: #f59e0b;
    --danger-color: #ef4444;
    --safety-color: #22d3ee;
    --perfect-color: #63db5f; /* 完璧安置の色（緑系） */
    --reset-color: #64748b;
    --active-bg: #450a0a;
    --se-on-color: #10b981;
}

body {
    font-family: 'Hiragino Kaku Gothic ProN', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100dvh;
    overflow: hidden;
    transition: background-color 0.3s ease;
}

body.is-active { background-color: var(--active-bg); }

.container {
    width: 100%;
    max-width: 480px;
    height: 100dvh;
    background: var(--card-bg);
    padding: 10px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.app-header {
    font-size: 0.8rem;
    font-weight: bold;
    color: #94a3b8;
    text-align: center;
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.status-badge {
    align-self: center;
    padding: 2px 12px;
    border-radius: 50px;
    font-size: 0.7rem;
    background: #334155;
}

.status-circle { background: var(--accent-circle); box-shadow: 0 0 10px var(--accent-circle); }
.status-grand { background: var(--accent-grand); box-shadow: 0 0 10px var(--accent-grand); }

.timer-display {
    font-size: clamp(4rem, 15vw, 5.5rem);
    font-weight: 900;
    font-family: 'Segoe UI', sans-serif;
    text-align: center;
    color: #4ade80;
    line-height: 1.0;
    margin-top: 5px;
}

.info-layout {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 10px 0;
}

.label-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 22px 10px; /* 高さ方向の厚み */
    border-radius: 12px;
    background: #334155;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.1); /* デフォルトの縁 */
}

.label-main { 
    font-size: 1.7rem; /* READYの文字サイズ */
    font-weight: 900; 
}

.column-label { 
    font-size: 0.8rem; /* GIMMICKの文字サイズ */
    opacity: 0.7; 
}

/* --- 縁を消す修正を行ったギミック背景 --- */
.bg-rainbow { 
    background: linear-gradient(90deg, #8B0000 0%, #FF4500 35%, #FFD700 70%, #32CD32 100%); /* 虹色グラデーション */
    border: none; /* 縁を消す */
}

.bg-yellow { 
    background: #FFFB00; color: #000 !important; box-shadow: 0 0 25px #FFF700; /* 黄色い発光 */
    border: none; /* 縁を消す */
}
.bg-yellow * { color: #000; }
/* -------------------------------------- */

.zones-column { display: grid; grid-template-columns: 1fr; gap: 4px; }
.zone-box { padding: 6px 12px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; background: rgba(255,255,255,0.05); }
.zone-label { font-size: 0.7rem; font-weight: bold; }
.zone-content { font-size: 1.0rem; font-weight: 800; }

.danger-zone { border-left: 4px solid var(--danger-color); }
.safety-zone { border-left: 4px solid var(--safety-color); }
.perfect-safety-zone { border-left: 4px solid var(--perfect-color); }

.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr auto auto; /* RESETとSEスイッチを最下部に */
    gap: 8px;
    flex-grow: 0.7;
    margin-top: 5px;
}

button {
    border: none;
    border-radius: 16px;
    font-weight: 900;
    color: white;
    cursor: pointer;
    transition: all 0.1s;
    -webkit-tap-highlight-color: transparent;
}

.btn-circle, .btn-grand {
    height: 100%;
    font-size: 1.2rem;
    box-shadow: 0 6px 0 rgba(0,0,0,0.4);
}

.btn-circle { background: linear-gradient(135deg, #f43f5e, #881337); }
.btn-grand { background: linear-gradient(135deg, #f59e0b, #92400e); }

.btn-reset {
    grid-column: span 2;
    height: 80px; /* 大きなRESETボタン */
    background: #475569;
    font-size: 1.1rem;
    box-shadow: 0 4px 0 rgba(0,0,0,0.3);
}

.btn-se-toggle {
    grid-column: span 2;
    height: 40px;
    background: var(--se-on-color); /* ON時のグリーン */
    font-size: 0.8rem;
    border-radius: 10px;
    box-shadow: 0 2px 0 rgba(0,0,0,0.3);
    border: 2px solid rgba(255,255,255,0.1);
}

.se-off {
    background: #1e293b;
    color: #64748b;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5); /* OFF時の沈み込み */
    border-color: transparent;
}

button:active { transform: translateY(4px); box-shadow: none; }

.is-active .timer-display { color: #fff; animation: flash 0.5s infinite alternate; }
@keyframes flash { from { opacity: 1; } to { opacity: 0.5; } }