* { box-sizing: border-box; }
:root { font-family: Arial, Helvetica, sans-serif; color: #25282c; background: #e5e7e9; }
body { margin: 0; }
.screen { min-height: 100svh; padding: clamp(20px, 4vw, 64px); }
header { display: flex; align-items: center; gap: 12px; padding-bottom: 22px; border-bottom: 1px solid #bfc4ca; }
.brand { font-size: 19px; font-weight: 800; letter-spacing: .2em; }
.brand-icon { width: 28px; height: 28px; object-fit: contain; }
.button { padding: 10px 14px; border: 1px solid #bcc2c8; background: #e0e3e6; color: #424a53; font: inherit; font-size: 11px; font-weight: 700; letter-spacing: .08em; border-radius: 0; cursor: pointer; text-decoration: none; }
.button:hover { background: #fff; border-color: #424a53; }
.button:disabled { opacity: .6; cursor: default; }
.back { margin-left: auto; flex-shrink: 0; }
main { max-width: 1040px; margin: 30px auto 0; }
h1 { margin: 0 0 26px; text-align: center; font-size: clamp(22px, 2.5vw, 32px); letter-spacing: .07em; }
h2 { margin: 0 0 18px; font-size: 11px; letter-spacing: .12em; font-family: "Courier New", monospace; color: #424a53; }
.dashboard { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.box { background: #f5f6f7; border: 1px solid #bcc2c8; padding: 20px; min-width: 0; }
.profile { grid-column: span 5; align-self: start; }
.calendar { grid-column: span 7; }
.stats, .bests { grid-column: span 6; }
.trend { grid-column: span 7; }
.history { grid-column: span 5; }
form { display: flex; gap: 10px; }
input, select { border: 1px solid #bcc2c8; background: #fafbfc; color: #25282c; border-radius: 0; font: inherit; font-size: 12px; padding: 9px; min-width: 0; }
input { flex: 1; width: 100%; }
:focus-visible { outline: 2px solid #424a53; outline-offset: 3px; }
.status { font-size: 11px; color: #69717a; margin: 8px 0 0; min-height: 13px; }
.preferences { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid #d5d9de; font: 11px "Courier New", monospace; letter-spacing: .08em; }
.auto-save-control { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.auto-save-control input { flex: none; width: 16px; height: 16px; margin: 0; accent-color: #424a53; }
.total { margin: 0; font-size: 32px; font-weight: 700; }
.total.empty, .empty { color: #69717a; font-size: 12px; font-weight: 400; }
.data-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid #d5d9de; padding: 12px 0; font-size: 12px; }
.data-row:last-child { padding-bottom: 0; }
.game-name { font-weight: 700; font-size: 12px; }
.values { text-align: right; color: #424a53; font-size: 11px; line-height: 1.6; }
.values p { margin: 0; }
.section-heading { display: flex; justify-content: space-between; align-items: start; flex-wrap: wrap; gap: 8px; }
.filters { display: flex; gap: 6px; }
.filters select { font-size: 10px; padding: 6px; max-width: 135px; }
.plot { height: 190px; display: grid; place-items: center; margin-top: 10px; }
.plot svg { width: 100%; height: 100%; overflow: visible; }
.plot text { font: 10px Arial, sans-serif; fill: #69717a; }
.history-list { max-height: 210px; overflow: auto; }
.history-list time { display: block; color: #69717a; font-size: 10px; margin-top: 5px; }
#error { padding: 12px; border: 1px solid #b44b48; color: #873b39; font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
@media (max-width: 700px) {
  .screen { padding: 20px; }
  header { padding-bottom: 16px; gap: 8px; }
  main { margin-top: 22px; }
  .box { padding: 16px; }
  .profile { grid-column: span 8; }
  .plays { grid-column: span 4; }
  .trend, .history { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .screen { padding: 16px; }
  .brand { font-size: 14px; letter-spacing: .1em; }
  .brand-icon { width: 24px; height: 24px; }
  .back { font-size: 9px; padding: 9px 8px; }
  .profile, .plays, .stats, .bests { grid-column: 1 / -1; }
  .plays { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .plays h2 { margin: 0; }
  .total { font-size: 24px; }
}

.pro-test { grid-column: 1 / -1; }
.pro-test h3 { font-size: 12px; margin-top: 24px; }
.pro-test label, .virtual-note, .virtual-total { font-size: 11px; color: #69717a; }
.virtual-total strong { color: #424a53; margin-left: 12px; }
.pro-tables { overflow-x: auto; }
.pro-tables table { width: 100%; min-width: 390px; border-collapse: collapse; font-size: 11px; }
.pro-tables th, .pro-tables td { padding: 12px 6px; border-bottom: 1px solid #d5d9de; text-align: right; }
.pro-tables th:first-child, .pro-tables td:first-child { text-align: left; }

.battle { grid-column: 1 / -1; }
.battle h3 { font-size: 12px; margin-top: 24px; }
.battle label, .battle-record { font-size: 11px; color: #424a53; }
.battle-record { border-top: 1px solid #d5d9de; padding: 14px 0; }
.battle-record time { display: block; margin-top: 6px; color: #69717a; }
.battle-record p { margin: 6px 0; }
.battle-record summary { cursor: pointer; margin-top: 10px; }
.filters { flex-wrap: wrap; }

/* Calendar and records use the same rectangular cards as the game menu. */
.calendar-nav { display:flex; align-items:center; gap:10px; }
.calendar-nav .button { padding:4px 10px; min-height:32px; font-size:18px; }
#calendar-month { min-width:100px; text-align:center; font:12px "Courier New",monospace; }
.calendar-weekdays,.calendar-days { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:3px; }
.calendar-weekdays { margin:16px 0 6px; text-align:center; font:9px "Courier New",monospace; color:#69717a; }
.calendar-day { position:relative; min-height:38px; padding:6px 2px 12px; border:1px solid transparent; background:transparent; color:inherit; font:12px Arial,sans-serif; cursor:pointer; }
.calendar-day:hover { background:#e0e3e6; }
.calendar-day.today { border-color:#a8afb6; }
.calendar-day[aria-pressed="true"] { background:#424a53; color:#fff; }
.calendar-day.has-records::after { content:""; position:absolute; bottom:5px; left:calc(50% - 2px); width:4px; height:4px; background:currentColor; border-radius:50%; }
.calendar h3 { margin:18px 0 8px; font:11px "Courier New",monospace; letter-spacing:.06em; }
.day-results { max-height:180px; overflow:auto; }
.day-results .data-row { align-items:start; }
.day-results time { display:block; font-size:10px; margin-top:5px; color:#69717a; }
.records-menu { grid-column:1/-1; margin-top:14px; }
.records-menu>h2 { font-size:16px; letter-spacing:.08em; margin-bottom:16px; }
.record-buttons { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.practice-records { grid-column:1/-1; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.practice-records h3 { font-size:11px; letter-spacing:.1em; }
.practice-record details { margin:8px 0 16px; font-size:12px; }
@media(max-width:700px) { .practice-records { grid-template-columns:1fr; } }
.card { position:relative; display:flex; flex-direction:column; min-width:0; min-height:190px; padding:18px; text-align:left; background:#f5f6f7; border:1px solid #bcc2c8; border-radius:0; color:inherit; font:inherit; cursor:pointer; transition:background .18s,border-color .18s; }
.card:hover { background:#fff; border-color:#424a53; }
.card[aria-pressed="true"] { border-color:#424a53; box-shadow:inset 0 -3px #424a53; }
.card .number { font:11px "Courier New",monospace; color:#69717a; }
.card .icon { width:40px; height:40px; color:#b44b48; margin:18px 0; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.card.match .icon { color:#508451; }.card.cricket .icon { color:#3977b4; }.card.exam .icon { color:#c77b32; }
.card-title { margin:auto 0 10px; font-size:18px; font-weight:700; letter-spacing:.025em; }
.card-bottom { padding-top:10px; border-top:1px solid #d5d9de; width:100%; text-align:right; color:#69717a; }
.record-details { grid-column:1/-1; display:grid; grid-template-columns:repeat(12,minmax(0,1fr)); gap:14px; margin-top:12px; }
.selected-game { grid-column:1/-1; font-size:14px; margin:6px 0 0; }
@media(max-width:700px) { .profile,.calendar { grid-column:1/-1; } .record-buttons { gap:10px; } .card { padding:12px; min-height:158px; } .card-title { font-size:14px; } .card .icon { width:32px; height:32px; margin:12px 0; } }
@media(max-width:480px) { .record-buttons { grid-template-columns:repeat(2,minmax(0,1fr)); } .calendar-nav { gap:5px; } .card { min-height:140px; } }
@media(prefers-reduced-motion:reduce) { .card { transition:none; } }

/* Original COUNT-UP analysis layout, scoped to prevent other MY PAGE changes. */
.cu-analysis { grid-column:1/-1; width:min(760px,100%); margin:0 auto; color:#25282c; font-family:Meiryo,"メイリオ","Noto Sans JP",sans-serif; --page:#fafbfc; --panel:#f5f6f7; --soft:#e0e3e6; --line:#bcc2c8; --ink:#25282c; --muted:#69717a; }
.cu-analysis .panel { background:var(--panel); border:1px solid var(--line); border-radius:0; padding:12px; margin-bottom:10px; box-shadow:none; }
.cu-analysis .modeButtons { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.cu-analysis .title { font-size:11px; color:var(--ink); font-weight:900; letter-spacing:.12em; text-align:center; margin-bottom:6px; font-family:inherit; }
.cu-analysis select { width:100%; min-height:44px; border:1px solid var(--line); border-radius:0; background:var(--page); color:var(--ink); font-size:16px; font-weight:900; text-align:center; }
.cu-analysis button { min-height:44px; border:1px solid var(--line); border-radius:0; background:var(--page); color:var(--ink); font-size:14px; font-weight:900; box-shadow:none; cursor:pointer; font-family:inherit; }
.cu-analysis button:active { transform:translateY(1px); }
.cu-analysis .modeButtons button.selected { background:#424a53; color:#fff; border:1px solid #424a53; }
.cu-analysis .hidden { display:none!important; }
.cu-analysis .stat-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:8px; }
.cu-analysis .stat-card { border:1px solid var(--line); border-radius:0; padding:10px; text-align:center; }
.cu-analysis .stat-card span { display:block; min-height:32px; font-size:11px; font-weight:900; }
.cu-analysis .stat-card strong { font-size:22px; }
.cu-analysis .summary-line { text-align:center; font-weight:900; margin-bottom:10px; }
.cu-analysis .aggregate-controls { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:10px; }
.cu-analysis .aggregate-controls #cu-metricGroup { grid-column:1/-1; }
.cu-analysis .aggregate-controls input { width:100%; min-width:0; min-height:44px; padding:8px; color:var(--ink); background:var(--page); border:1px solid var(--line); border-radius:0; font-family:inherit; }
.cu-analysis .aggregate-controls select { min-width:0; font-size:13px; }
.cu-analysis .chart-wrap { position:relative; height:300px; border:1px solid var(--line); border-radius:0; padding:8px; background:var(--panel); }
.cu-analysis .chart-wrap canvas { width:100%; height:100%; }
.cu-analysis .legend { display:grid; grid-template-columns:repeat(2,1fr); gap:6px; margin-top:9px; font-size:11px; }
.cu-analysis .legend span:before { content:""; display:inline-block; width:12px; height:3px; margin-right:5px; vertical-align:middle; background:var(--color); }
.cu-analysis .history-list { display:grid; gap:8px; max-height:none; overflow:visible; }
.cu-analysis .history-item { border:1px solid var(--line); border-radius:0; padding:10px; }
.cu-analysis .history-head { display:flex; justify-content:space-between; gap:8px; align-items:center; }
.cu-analysis .history-head strong { font-size:13px; }
.cu-analysis .history-meta { font-size:11px; line-height:1.7; margin-top:6px; }
.cu-analysis .empty { text-align:center; font-size:13px; padding:12px; }
.cu-analysis.keypadAnalysis #cu-analysisGame { grid-column:1/-1; }
.cu-analysis .awardTable { width:100%; border-collapse:separate; border-spacing:0 6px; font-size:13px; }
.cu-analysis .awardTable th { color:var(--ink); font-size:11px; }
.cu-analysis .awardTable td { background:var(--page); border-top:1px solid var(--line); border-bottom:1px solid var(--line); padding:8px; text-align:center; font-weight:900; }
.cu-analysis .awardTable td:first-child { border-left:1px solid var(--line); text-align:left; }
.cu-analysis .awardTable td:last-child { border-right:1px solid var(--line); }
@media(min-width:600px) { .cu-analysis .stat-grid { grid-template-columns:repeat(4,1fr); } }
@media(max-width:540px) { .cu-analysis .panel { padding:10px; } .cu-analysis .chart-wrap { height:260px; } }

.cu-analysis { padding:12px; }
.cu-analysis .title { margin-top:.83em; }
@media(max-width:540px) { .cu-analysis { padding:6px; } }

.ga-chart svg { width:100%; height:100%; }
.ga-chart text { font:10px Meiryo,sans-serif; fill:#69717a; }
#ga-analysis .history-meta p { margin:6px 0; }
#ga-analysis details summary { cursor:pointer; }
