.home-heading,.group-header,.history-heading{display:flex;justify-content:space-between;align-items:center;gap:16px}.home-heading{flex-wrap:wrap}.home-heading h1{font-size:24px}.start-screen{max-width:720px}.start-screen h2{font-size:15px;color:var(--muted);margin:26px 0 12px}.exports summary,.trend-details summary{cursor:pointer;min-height:44px;display:flex;align-items:center}.library-item{display:flex;align-items:center;justify-content:space-between;gap:16px;background:var(--paper);color:var(--ink);padding:20px;border-radius:12px;text-decoration:none;margin:10px 0;overflow-wrap:anywhere}.library-item strong{min-width:0}.library-item span{flex-shrink:0;color:var(--muted);font-size:14px}.signin-link,.subtle-link{color:var(--blue);font-size:14px;text-underline-offset:4px;display:inline-block;padding:10px 0}.eyebrow{font-size:12px;letter-spacing:.14em;color:var(--muted);margin:18px 0 6px}.group-header h1{overflow-wrap:anywhere;margin:0;line-height:1.45}.group-header>div{min-width:0}.group-header button{flex-shrink:0}.group-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:24px}.account-strip{display:flex;align-items:center;gap:16px;flex-wrap:wrap;color:var(--muted);font-size:13px;margin:16px 0 22px}.group-tabs{display:flex;gap:8px;padding:5px;background:#1d2229;border-radius:12px;margin:18px 0 28px}.group-tabs button{flex:1;color:var(--muted);background:transparent;font-weight:600}.group-tabs button[aria-current]{background:#303946;color:var(--ink)}.history-heading{margin-bottom:16px}.history-heading h2{margin:0}.inline-label{display:flex;align-items:center;gap:10px;margin:0;font-size:13px;color:var(--muted)}.inline-label select{width:auto;max-width:180px;padding:9px 12px;font-size:14px;margin:0}.session-card{display:block;width:100%;text-align:left;background:var(--paper);color:var(--ink);padding:22px;margin:12px 0;border-radius:14px}.session-card:hover{background:#252d37}.session-card-top{display:flex;justify-content:space-between;color:var(--muted);font-size:13px;gap:10px}.session-card-title{font-size:19px;display:block;margin:8px 0 20px;overflow-wrap:anywhere}.session-card-results{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.session-card-results>span{display:flex;flex-direction:column;gap:7px;min-width:0;font-size:13px}.session-card-results>span>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-card-results b{font-size:18px;font-variant-numeric:tabular-nums;font-weight:600}.stats-filters{display:flex;gap:16px;flex-wrap:wrap}.stats-filters label{margin:0;flex:1;min-width:135px}.stats-table-wrap{border-radius:14px;background:var(--paper);padding:18px 20px;margin-top:22px;overflow-x:auto}.stats-table{width:100%;border-collapse:collapse;font-size:16px;font-variant-numeric:tabular-nums}.stats-table caption{text-align:left;color:var(--muted);font-size:13px;padding:0 0 12px}.stats-table th{text-align:left}.stats-table td{text-align:right;white-space:nowrap}.stats-table thead th{font-size:12px;font-weight:500;color:var(--muted);padding:8px 0}.stats-table thead th:not(:first-child){text-align:right}.stats-table tbody tr+tr{border-top:1px solid #303740}.stats-table td,.stats-table tbody th{padding:10px 0}.stats-table th button{color:var(--ink);background:transparent;padding:0;text-align:left;max-width:160px;overflow-wrap:anywhere}.personal-panel{margin-top:26px;background:var(--paper);border-radius:14px;padding:22px}.personal-panel h3{font-size:15px;font-weight:500;margin:24px 0 12px}.personal-panel .history-heading{flex-wrap:wrap}#personal-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:24px 0}#personal-stats>div:not(.rank-distribution){display:flex;flex-direction:column;gap:8px}#personal-stats span{color:var(--muted);font-size:13px}#personal-stats strong{font-size:23px;font-weight:600;font-variant-numeric:tabular-nums}.rank-distribution{grid-column:1/-1;display:flex;gap:14px;justify-content:space-between;margin-top:8px;padding-top:16px;border-top:1px solid #303740}.rank-distribution b{font-weight:500;color:var(--ink)}.trend-svg{width:100%;height:auto;display:block}.trend-svg text{fill:#aab5c2;font-family:inherit;font-size:12px}.trend-details{color:var(--muted);font-size:13px}.metric-row{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:13px 0;margin:0;font-size:14px;border-top:1px solid #303740}.metric-row>*{min-width:0;overflow-wrap:anywhere}.metric-row strong{font-weight:500}.metric-row span:last-child{flex-shrink:0}.exports{margin-top:24px;color:var(--muted)}.exports button{margin:4px 6px 4px 0}.back-link{background:transparent;color:var(--blue);padding:4px 0;margin-bottom:8px;font-size:14px}#group-screen{padding-bottom:40px}#group-screen .form-error:empty{display:none}body{padding-top:env(safe-area-inset-top)}
@media(max-width:700px){.session-card{padding:18px 16px}.session-card-results{gap:6px}.session-card-results b{font-size:16px}.stats-table-wrap{padding:16px 12px}.stats-table{font-size:14px}.stats-table th button{max-width:100px}.personal-panel{padding:18px 16px}#personal-stats{grid-template-columns:repeat(2,1fr);gap:22px 14px}.rank-distribution{gap:6px;flex-wrap:wrap}.rank-distribution span{font-size:12px}.group-header h1{font-size:25px}.inline-label select{max-width:145px}.metric-row{font-size:13px}.home-heading h1{font-size:23px}}
.session-navigation{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:8px 0 12px}.session-navigation .back-link{margin:0}.session-navigation .secondary{font-size:14px}.create-players{border:0;padding:0;margin:24px 0}.create-players legend{font-size:16px;font-weight:600;margin-bottom:12px}.create-player-row{display:flex;align-items:center;gap:10px}.create-player-row label{flex:1;min-width:0}.create-player-row .icon-button{flex-shrink:0;margin-top:12px}.record-management{font-size:14px;color:var(--muted);margin:18px 0}.record-management summary{cursor:pointer;padding:12px 0}.record-management .account-strip{margin:0}.group-header .help{margin:8px 0 0}#start-screen #account-home{margin-top:22px}#create-form{padding-top:8px}.session-navigation+.table-tools{margin-top:0}
@media(max-width:360px){.session-navigation{gap:6px}.session-navigation .back-link,.session-navigation .secondary{font-size:13px}}
.home-screen{max-width:442px;margin:0 auto;padding:64px 26px 80px}.home-brand{display:flex;align-items:center;margin-bottom:54px}.home-brand img{display:block;width:218px;height:auto;max-width:100%}.home-menu{display:grid;gap:16px}.home-choice{display:flex;align-items:center;justify-content:space-between;gap:16px;width:100%;padding:25px 22px;border-radius:16px;background:#232a33;color:var(--ink);font-size:20px;font-weight:600;min-height:80px;text-align:left}.home-choice:first-child{background:#c5d9cb;color:#18251f}.home-choice svg{width:24px;height:24px;flex-shrink:0}.home-choice:hover{filter:brightness(1.06)}.home-recent-content{min-width:0}.home-recent-content strong{display:block;font-size:19px;line-height:1.5;font-weight:600}.home-recent-detail{display:block;font-size:14px;color:#b4bec9;line-height:1.8;margin-top:10px;font-weight:400;overflow-wrap:anywhere}.home-choice.sub-detail svg{width:20px;height:20px;color:#a4afb9}.home-choice.home-link{justify-content:flex-start;gap:13px;min-height:64px;padding:20px 22px;background:transparent;color:#c4ccd5;font-size:16px;font-weight:500}.home-choice.home-link svg{width:20px;height:20px;color:#aab5c0}.home-choice.home-link:hover{background:#1d2229}.home-screen .form-error:empty{display:none}body:has(#home-screen:not([hidden]))>.masthead{display:none}#start-screen[data-mode=create] #install-button{display:none}#start-screen>.back-link{display:inline-flex;align-items:center;min-height:44px;text-decoration:none}#session-dialog .create-players .help{margin-top:0}@media(max-width:360px){.home-screen{padding-left:22px;padding-right:22px}.home-choice{padding-left:18px;padding-right:18px}.home-recent-detail{font-size:13px}}
.uma-inputs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.uma-inputs label{min-width:0}.uma-inputs input{width:100%;padding:10px 6px;text-align:center;font-size:18px}#rules-summary dd{overflow-wrap:anywhere}#rule-oka{margin:0 0 22px}

.seat-caption{display:block;font-size:14px;color:var(--muted);margin-top:10px}.score-field select[data-seat]{font-size:14px}.rule-calculation-help,.rounding-details{font-size:14px;color:var(--muted);margin:16px 0;line-height:1.7}.rule-calculation-help summary,.rounding-details summary{cursor:pointer;padding:10px 0}.rounding-details:empty{display:none}

/* 記録画面の操作・見出し・成績の並びを一つの流れにまとめます。 */
#save-status:empty,body[data-screen="home"] #save-status{display:none}
.appbar-inner{max-width:904px;padding-top:22px;padding-bottom:22px}
#table-screen{max-width:904px;padding-bottom:48px}
.session-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 24px}
.session-toolbar .back-link{margin:0;color:var(--muted);font-size:14px;min-height:44px;text-align:left}
.session-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}
.quiet-button{display:inline-flex;align-items:center;justify-content:center;gap:5px;background:transparent;color:var(--ink);font-size:14px;line-height:1.5;padding:8px 12px;white-space:nowrap}
.quiet-button:hover{background:#252b33}.quiet-button svg{width:18px;height:18px;flex-shrink:0}
#table-screen .session-head{padding:0;margin:0 0 28px;align-items:flex-end}
#table-screen .session-head h1{font-size:30px;line-height:1.4}
#table-screen .date{font-size:14px;margin-bottom:8px}
#table-screen .members-button{padding:8px 0 8px 12px;min-height:44px}
#table-screen .tabs{position:static;width:100%;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));padding:4px;margin:0 0 24px;border:0;border-radius:12px;background:#20252c;backdrop-filter:none}
#table-screen .tabs button{flex-direction:row;gap:8px;font-size:14px;padding:11px 8px;border-radius:9px}
#table-screen .tabs button[aria-current]{background:#353d47;color:var(--ink);box-shadow:none}
#table-screen .tabs svg{width:18px;height:18px}
#table-screen .tabs span{white-space:nowrap}
@media(max-width:360px){#table-screen .tabs svg{display:none}}
#table-screen .summary-panel{margin:0;padding:24px;border-radius:14px}
#table-screen .summary-panel .section-title{margin:0 0 20px}
#table-screen .standings{grid-template-columns:repeat(var(--players-count,4),minmax(0,1fr));gap:20px}
#table-screen .standing{grid-template-rows:1fr auto;align-content:stretch}
#table-screen .record-title{margin:28px 0 14px}
#table-screen .empty{margin:0;padding:42px 20px;text-align:center;background:#1d2229}
#table-screen .form-error:empty{display:none}
.session-menu-items{display:grid;gap:8px;margin-top:24px}
.session-menu-items button{width:100%;text-align:left;color:var(--ink);background:#2a323c;padding:15px 16px;font-size:16px}
.session-menu-items button:hover{background:#353f4b}
@media(max-width:700px){
 .appbar-inner{padding:16px 20px}.brand .wordmark{width:144px}
 #table-screen{padding:0 20px 32px}.session-toolbar{margin-bottom:20px;gap:8px}
 .session-toolbar .back-link{font-size:13px}.session-actions{gap:0}.quiet-button{padding:8px;font-size:14px}
 #table-screen .session-head{margin-bottom:22px;gap:12px}#table-screen .session-head h1{font-size:26px}
 #table-screen .members-button{padding-left:0}#table-screen .members-button svg{display:none}
 #table-screen .summary-panel{padding:20px 16px}#table-screen .standings{grid-template-columns:repeat(var(--mobile-count,4),minmax(0,1fr));gap:18px 10px}
 #table-screen .value{font-size:clamp(18px,5.4vw,27px)}#table-screen .standing .name{font-size:14px}
 #table-screen .record-title{margin-top:24px}#table-screen .tabs{margin-bottom:20px}
}
@media(max-width:360px){.appbar-inner{padding-left:14px;padding-right:14px}#table-screen{padding-left:14px;padding-right:14px}.session-toolbar .back-link{font-size:12px}.quiet-button{padding:8px 6px}#table-screen .tabs button{gap:5px}#table-screen .record-title h2{font-size:14px}}
.home-set-label,.home-recent-content .home-set-label{display:inline-flex;align-items:center;gap:12px;min-width:0}.mahjong-table-icon{display:block;width:28px;height:28px;flex-shrink:0;background:currentColor;-webkit-mask:url("icon-mahjong-table.png") center/contain no-repeat;mask:url("icon-mahjong-table.png") center/contain no-repeat}

/* 4人時は同じ人の合計・半荘を縦に追える共通グリッドにします。 */
#table-screen.fixed-four-columns .summary-panel{padding:24px 16px}
#table-screen.fixed-four-columns .summary-panel .section-title{padding:0 8px}
#table-screen.fixed-four-columns .round{padding:18px 16px}
#table-screen.fixed-four-columns .standings,
#table-screen.fixed-four-columns .round-players{grid-template-columns:repeat(4,minmax(0,1fr));gap:0;padding:0}
#table-screen.fixed-four-columns .standing{grid-template-columns:minmax(0,1fr);grid-template-rows:1fr auto auto;padding:0 8px;text-align:center}
#table-screen.fixed-four-columns .standing .name{grid-row:1;line-height:1.5}
#table-screen.fixed-four-columns .standing .rank{display:block;grid-row:2;color:var(--muted);font-size:13px;line-height:1.5;margin-top:4px}
#table-screen.fixed-four-columns .standing .value{grid-row:3}
#table-screen.fixed-four-columns .round-player{padding:0 8px}
#table-screen.fixed-four-columns .place{display:block;color:var(--muted);font-size:13px;line-height:1.5;margin-top:4px}
#table-screen.fixed-four-columns .player-name{display:grid;grid-template-rows:1fr auto;justify-items:center;align-items:start;gap:0}
@media(max-width:700px){
 #table-screen.fixed-four-columns .summary-panel{padding:20px 8px}
 #table-screen.fixed-four-columns .round{padding:18px 8px}
 #table-screen.fixed-four-columns .standing,#table-screen.fixed-four-columns .round-player{padding:0 4px}
}

/* 固定4人の名前は共通見出しに集約し、読み上げ用の名前は各成績に残します。 */
.player-columns{position:sticky;top:env(safe-area-inset-top,0px);z-index:5;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));padding:14px 16px;background:var(--bg);box-shadow:0 1px 0 #303741;text-align:center}
.player-columns>span{padding:0 8px;min-width:0;overflow-wrap:anywhere;font-size:14px;line-height:1.5;font-weight:500}
#table-screen.fixed-four-columns .standing .name,
#table-screen.fixed-four-columns .round-player .player-label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
#table-screen.fixed-four-columns .standing{grid-template-rows:auto auto}
#table-screen.fixed-four-columns .standing .rank{grid-row:1;margin-top:0}
#table-screen.fixed-four-columns .standing .value{grid-row:2}
#table-screen.fixed-four-columns .player-name{grid-template-rows:auto}
#table-screen.fixed-four-columns .place{margin-top:0}
#table-screen.fixed-four-columns .summary-panel{margin-top:12px}
@media(max-width:700px){.player-columns{padding:12px 8px}.player-columns>span{padding:0 4px}}

.record-switch-button{display:block;max-width:100%;margin:16px 0 22px;padding:10px 14px;background:#232a33;color:var(--ink);font-size:15px;text-align:left;overflow-wrap:anywhere}
.manage-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 0;border-bottom:1px solid var(--line);margin:0}.manage-row>div,.manage-row>span:first-child{min-width:0;overflow-wrap:anywhere}.manage-row .help{display:block;margin:6px 0 0}.manage-row button{flex-shrink:0}.manage-check{display:flex;align-items:center;gap:10px;white-space:nowrap}.manage-check input{width:20px;min-height:20px;margin:0;accent-color:var(--accent)}
.session-menu-items .danger{color:var(--red)}

/* グループ導線：ホームの「いまのグループ」カード・切り替え一覧・参加フォーム */
.home-set-label{text-wrap:balance;overflow-wrap:anywhere}
.group-card{display:flex;align-items:center;justify-content:space-between;gap:14px;background:var(--paper);border-radius:14px;padding:18px 20px;margin:0 0 20px}
.group-card>div{min-width:0}
.group-card .eyebrow{margin:0 0 4px;letter-spacing:.06em}
.group-card strong{display:block;font-size:19px;line-height:1.5;font-weight:600;overflow-wrap:anywhere}
.group-card .meta{display:block;font-size:14px;color:#b4bec9;line-height:1.8;margin-top:4px}
.group-card .secondary{flex-shrink:0}
.join-form{background:var(--paper);border-radius:14px;padding:18px 20px}
.join-form label{margin-bottom:0}
.join-form .form-error:empty{display:none}
.join-form .primary{margin-top:12px;width:100%}
.group-row{padding:18px 20px;margin:10px 0}
.group-row .name{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:17px;font-weight:600}
.group-row .meta{display:block;color:var(--muted);font-size:14px;margin-top:4px;flex-shrink:1}
.badge{display:inline-block;font-size:12px;font-weight:600;padding:2px 9px;border-radius:999px;line-height:1.5}
.badge.now{background:#243029;color:var(--accent)}
.badge.view{border:1px solid #414c59;color:var(--muted)}
.group-row[aria-current]{outline:1px solid #829b8d}
.start-screen .secondary.block{width:100%;margin-top:16px}
.auto-badge{margin-left:8px;vertical-align:1px}.auto-badge[hidden]{display:none}
