:root {
    --bg: #0f172a;
    --card: #1e293b;
    --accent: #d0ff89;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border: #334155;
    --sauna-color: #fb923c;
    --gym-color: #eef134;
}

body {
    font-family: 'Barlow', 'Noto Sans JP', sans-serif;
    background-color: var(--bg);
    color: var(--text-primary);
    margin: 0; 
    padding: 20px 15px;
    box-sizing: border-box;
}

.container { 
    max-width: 420px; 
    margin: 0 auto; 
}

header { 
    text-align: center; 
    margin-bottom: 30px; 
}

h1 { 
    font-family: 'Teko', sans-serif;
    font-size: 3.5rem; 
    font-weight: 700; 
    margin: 0; 
    letter-spacing: 1px;
    text-transform: uppercase;
}

.subtitle { 
    color: var(--text-secondary); 
    font-size: 0.9rem; 
}

.gym-tiles-grid {
    display: grid; 
    grid-template-columns: repeat(2, 1fr);
    gap: 12px; 
    margin-bottom: 24px;
}

.gym-tile {
    background: var(--card); 
    padding: 15px; 
    border-radius: 20px;
    border: 1px solid var(--border); 
    text-align: center;
}

.gym-tile .gym-name { 
    font-size: 0.75rem; 
    color: var(--text-secondary); 
    display: block; 
    margin-bottom: 5px;
}

.gym-tile .gym-level { 
    font-family: 'Teko', sans-serif;
    font-size: 3.2rem; 
    font-weight: 600; 
    line-height: 1.2;
    display: inline-block;
    vertical-align: middle;
}

.trend-arrow {
    font-size: 1.8rem;
    font-weight: 900;
    display: inline-block;
    vertical-align: middle;
    margin-left: 5px;
}

.level-unit {
    display: block;
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-weight: 700;
}

.gym-tile .next-info { 
    font-size: 0.65rem; 
    color: var(--text-secondary); 
    border-top: 1px solid var(--border); 
    margin-top: 8px; 
    padding-top: 8px; 
}

#advice-container {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}

.advice-card { border: 2.54px solid var(--border); border-radius: 20px; padding: 20px; margin-bottom: 15px; transition: border-color 0.5s ease; background: rgba(255, 255, 255, 0.03); box-shadow: none !important; }

/* ついでに中のタイトルも少し調整 */
.advice-card h3 {
    margin-top: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.advice-label {
    font-family: 'Teko', sans-serif;
    font-size: 0.8rem;
    color: var(--bg);
    background: var(--accent);
    display: inline-block;
    padding: 0 8px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.gym-advice { border-color: var(--gym-color); } 
.gym-advice .advice-label { background: var(--gym-color); }
.sauna-advice { border-color: var(--sauna-color); }
.sauna-advice .advice-label { background: var(--sauna-color); }

#gym-advice-text, #sauna-advice-text {
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--text-primary);
    line-height: 1.4;
}

#record-form { 
    background: var(--card); 
    padding: 20px; 
    border-radius: 20px; 
    margin-bottom: 16px; 
    border: 1px solid var(--border); 
}

.form-group-vertical { 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
}

.form-row { 
    display: flex; 
    gap: 10px; 
}

.input-wrapper { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    gap: 5px; 
}

.input-wrapper label { 
    font-size: 0.7rem; 
    color: var(--text-secondary); 
    font-weight: bold; 
}

#day-display { 
    font-weight: 900; 
    color: var(--accent); 
    font-size: 1rem; 
    margin-left: 5px; 
}

input, select { 
    padding: 12px; 
    border-radius: 10px; 
    border: 1px solid var(--border); 
    background: var(--bg); 
    color: white; 
    font-size: 1rem; 
    width: 100%; 
    box-sizing: border-box; 
    font-family: 'Barlow', sans-serif;
}

.rating-buttons { 
    display: flex; 
    gap: 6px; 
    margin: 10px 0; 
}

.rating-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rating-item input { display: none; }

.rating-item label { 
    width: 100%;
    aspect-ratio: 1; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    background: var(--bg); 
    border-radius: 10px; 
    cursor: pointer; 
    border: 1px solid var(--border); 
    font-family: 'Teko', sans-serif;
    font-size: 1.5rem;
}

.rating-item span {
    font-size: 0.6rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.rating-item input:checked + label { 
    background: var(--accent); 
    color: var(--bg); 
}

#save-btn { 
    width: 100%; 
    padding: 18px; 
    background: var(--accent); 
    color: var(--bg); 
    border: none; 
    border-radius: 15px; 
    font-family: 'Teko', sans-serif;
    font-weight: 700; 
    font-size: 1.5rem; 
    cursor: pointer; 
    margin-top: 15px;
}

.sub-btn { 
    background: none; 
    border: 1px dashed var(--border); 
    color: var(--text-secondary); 
    width: 100%; 
    padding: 10px; 
    border-radius: 10px; 
    cursor: pointer; 
}

.add-gym-form {
    display: flex;
    flex-direction: column; 
    gap: 10px;
    margin-top: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

#add-gym-btn {
    background: var(--accent);
    color: var(--bg);
    border: none;
    padding: 12px;
    border-radius: 10px;
    font-family: 'Teko', sans-serif;
}

.outline-btn { 
    width: 100%; 
    background: none; 
    border: 1px solid var(--accent); 
    color: var(--accent); 
    padding: 15px; 
    border-radius: 15px; 
    font-weight: bold; 
    cursor: pointer; 
}

.hidden { display: none; }
.divider { border: 0; border-top: 1px solid var(--border); margin: 30px 0; }

#all-data {
    margin-top: 20px;
    background: white;
    padding: 10px;
    border-radius: 12px;
}

.heatmap-scroll-area { overflow-x: auto; width: 100%; }
.heatmap-wrapper { display: flex; min-width: 480px; }
#time-labels { width: 50px; flex-shrink: 0; }
#heatmap { display: flex; flex: 1; }
.day-column { flex: 1; display: flex; flex-direction: column; }
.heatmap-cell {
    position: relative; 
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0.5px solid #f1f5f9;
    font-family: 'Barlow', sans-serif;
    font-weight: 700;
    font-size: 10px;
}

.low-data-alert {
    position: absolute; top: 1px; right: 1px;
    width: 10px; height: 10px;
    background: #FF8C00; color: white; border-radius: 50%;
    font-size: 7px; display: flex; align-items: center; justify-content: center;
}

.time-label-cell, .day-header { height: 32px; display: flex; align-items: center; justify-content: center; }
.time-label-cell { font-size: 9px; color: #64748b; justify-content: flex-end; padding-right: 8px; }
.day-header { font-weight: bold; font-size: 11px; background: #f1f5f9; color: #1e293b; }

footer { text-align: center; padding: 40px 0; color: var(--text-secondary); font-family: 'Teko', sans-serif; }




/* ジムのアドバイスカードにも枠線を追加 */
.gym-advice { 
    border-color: var(--accent); 
}

/* 画面表示時のふわっとした動き */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* タイルやカードに適用 */
.gym-tile, .advice-card, #record-form {
    animation: fadeInUp 0.5s ease-out forwards;
}

/* 押し心地（クリック時の反応） */
.gym-tile, #save-btn, .rating-item label, .outline-btn, .sub-btn {
    transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.gym-tile:active, #save-btn:active, .outline-btn:active, .rating-item label:active {
    transform: scale(0.96); /* 押した時に少し沈む */
}

/* ヒートマップの文字を少し太くして視認性アップ */
.heatmap-cell {
    font-weight: 800;
    font-size: 11px;
}

.gym-level {
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.level-update-flash {
    animation: levelFlash 0.4s ease-out;
}
@keyframes levelFlash {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); color: var(--accent); }
    100% { transform: scale(1); opacity: 1; }
}

/* style.css */
.trend-arrow {
    display: inline-block !important; /* 必須 */
    font-size: 1.8rem;
    font-weight: 900;
    vertical-align: middle;
    margin-left: 5px;
}

.trend-up {
    color: #f87171 !important;
    animation: arrowUp 0.8s infinite ease-in-out !important;
}

.trend-down {
    color: #60a5fa !important;
    animation: arrowDown 0.8s infinite ease-in-out !important;
}

@keyframes arrowUp {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); } /* 動きを大きくして確認しやすく */
}

@keyframes arrowDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* style.css に追加 */
#admin-panel, #all-data {
    transition: all 0.4s ease-in-out;
    overflow: hidden;
}

/* 閉じている時は不透明度を0に */
.hidden {
    display: block !important; /* display:noneを使わず制御 */
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    margin: 0;
    padding: 0;
}

/* 開いている時は高さを出す */
section:not(.hidden) {
    max-height: 1000px; /* 十分な高さ */
    opacity: 1;
}

.time-travel-container {
    margin: 10px 0 20px 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

#time-slider {
    width: 100%;
    margin-top: 10px;
    accent-color: var(--accent);
}

.report-guide {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.report-guide p {
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--accent);
}

.report-guide ul {
    list-style: none;
    padding: 0;
}

.report-guide li {
    margin-bottom: 4px;
    display: flex;
    align-items: center;
}

.report-guide li span {
    background: rgba(255, 255, 255, 0.1);
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    margin-right: 8px;
    font-weight: bold;
}