/* 3D edition: a fixed game stage, readable information panes, and real scroll viewports. */
:root { --ui-line: #425d4b; --ui-muted: #b1c3b4; --hand-gap: 6px; }
html { height: 100%; }
body { height: 100dvh; min-height: 0; overflow: hidden; display: flex; flex-direction: column; font-size: 14px; line-height: 1.5; color: #f0f0e4; }
button, select, summary { touch-action: manipulation; }
button, select { min-height: 34px; padding: 5px 10px; font-size: 13px; border-radius: 6px; }
button:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid #f3d38b; outline-offset: 3px; }
button:disabled { opacity: .65; }
#top { width: 100%; flex: 0 0 54px; min-height: 0; height: 54px; max-width: 1920px; padding: 5px 16px; gap: 12px; }
#top h1 { font-size: 18px; margin: 0; }
#top .brand { gap: 0; }
#top .brand .eyebrow { font-size: 8px; }
#top .helpActions { display: flex; gap: 6px; }
#top .helpActions button, #settings > summary { min-height: 34px; padding: 5px 10px; font-size: 12px; }
#top .edition { font-size: 10px; }
#status { flex: 0 0 36px; height: 36px; min-height: 0; width: 100%; max-width: 1920px; padding: 4px 16px; gap: 14px; font-size: 12px; }
#status .roundBadge { font-size: 17px; }#status .progressLabel b { font-size: 16px; }
#status .t.xs { width: 18px; height: 25px; }
main, body.debug main { flex: 1 1 0; min-height: 0; width: 100%; max-width: 1920px; margin: 0 auto; padding: 0 12px 10px; display: grid; grid-template-areas: "table info reference"; grid-template-columns: minmax(0, 1fr) clamp(228px,18vw,280px) clamp(320px,25vw,380px); grid-template-rows: minmax(0,1fr); gap: 12px; align-items: stretch; }
#tableCol { grid-area: table; min-width: 0; min-height: 0; margin: 0; display: flex; flex-direction: column; position: relative; container-type: inline-size; --hand-gap: clamp(3px,.5vw,8px); --hand-tile-width: min(clamp(45px,10.5dvh,88px),calc((100cqw - 8px - 7 * var(--hand-gap))/8)); --hand-cards-height: calc(var(--hand-tile-width)*1.4 + 62px); --hand-commands-height: 128px; }
#board { flex: 1 1 0; height: auto; min-height: 0; width: 100%; border-radius: 10px; }
#side { grid-area: info; min-width: 0; min-height: 0; width: 100%; margin: 0; display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,1fr) 108px 38px 38px; gap: 8px; overflow: visible; }
#contextSlot { grid-row: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; }
#contextSlot > section, #side > section, #side > details, #yakuSide > section { border: 1px solid var(--ui-line); border-radius: 8px; background: #152a22; box-shadow: none; flex: none; overflow: hidden; }
#side > #lastResult { grid-row: 2; min-height: 0; height: 108px; padding: 10px; }
#side > #logBox { grid-row: 3; }#side > #rules { grid-row: 4; }
#side summary { padding: 7px 11px; font-size: 13px; line-height: 22px; background: #1b3328; }
#side summary::after { content: '開く ↗'; float: right; color: #d5c28c; font-size: 11px; }
#side > details > .body { display: none; }
#side h2, #contextSlot h2, #yakuSide h2 { margin: 0; padding: 8px 11px; font-size: 14px; font-weight: 600; background: #192f25; border-bottom: 1px solid var(--ui-line); }
#turnDetails .previewYaku { padding: 10px; font-size: 13px; gap: 5px; }
#turnDetails .t.xs { width: 22px; height: 31px; }
#meldPanel .body { padding: 10px; }.meldEmpty { margin: 0; color: var(--ui-muted); font-size: 13px; line-height: 1.7; }
.publicMeldSeat { padding: 7px 0; border-bottom: 1px solid #395240; }.publicMeldSeat:last-child { border: 0; }
.publicMeldSeat > strong { display: block; margin-bottom: 5px; font-size: 12px; color: #d8dfca; }
.meldGroup { display: inline-flex; align-items: center; gap: 3px; border: 1px solid #6b8058; background: #263b2b; padding: 5px; border-radius: 5px; cursor: pointer; }
.meldGroup > .meldType { font-size: 12px; color: #e9d69c; padding-right: 4px; }
.meldGroup .t.xs { width: 25px; height: 35px; margin-bottom: 4px; }
#lastResult .eyebrow { font-size: 10px; }.lastDuel { gap: 6px; margin: 6px 0 4px; font-size: 13px; }.lastDuel strong { font-size: 22px; }
#lastResult .t.xs { width: 23px; height: 32px; }#lastResult > small { font-size: 11px; }.resultEmpty { font-size: 13px; min-height: 72px; gap: 8px; }
#yakuSide { grid-area: reference; min-height: 0; min-width: 0; width: auto; margin: 0; padding: 0; border: 0; display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: auto minmax(0,1fr); gap: 10px; overflow: visible; }
#scoreTable { grid-column: 1; grid-row: 1; }#yakuPanel { grid-column: 1; grid-row: 2; }
#yakuSide > section { zoom: 1; min-height: 0; }
#scoreTable .body { padding: 5px 8px; overflow-x: auto; }
#scoreTable table { font-size: 12px; table-layout: fixed; }
#scoreTable th, #scoreTable td { padding: 3px 2px; line-height: 18px; }
#scoreTable th:first-child { width: 65px; font-size: 11px; white-space: nowrap; }#scoreTable th:last-child { width: 34px; }
#scoreTable th small { font-size: 10px; }
#yakuPanel { display: grid; grid-template-rows: auto minmax(0,1fr); }
#yakuPanel h2 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
#yakuPanel h2 small { font-size: 11px; font-weight: 400; color: var(--ui-muted); }
#yakuPanel .body { padding: 6px 10px 14px; overflow: auto; min-height: 0; overscroll-behavior: contain; scrollbar-gutter: stable; }
#yakuPanel .yr { width: 100%; display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-rows: auto auto; gap: 5px 8px; padding: 9px 3px; min-height: 70px; border: 0; border-bottom: 1px solid #395240; border-radius: 0; background: transparent; text-align: left; font-size: 13px; white-space: normal; }
#yakuPanel .yr:hover, #yakuPanel .yr:focus-visible { background: #29432f; }
#yakuPanel .yn { grid-column: 1; font-size: 13px; font-weight: 600; white-space: normal; }
#yakuPanel .yp { grid-column: 2; color: #f1d08b; font-size: 14px; }
#yakuPanel .ye { grid-column: 1 / -1; grid-row: 2; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 0; padding-bottom: 3px; }
#yakuPanel .grp { display: inline-flex; gap: 1px; margin-right: 5px; }
#yakuPanel .t.xs { width: 22px; height: 31px; box-shadow: 1px 2px 0 #ad854d; }
#yakuPanel .yd { grid-column: 1 / -1; font-size: 12px; line-height: 1.5; color: #b9c9b7; }
#yakuPanel .ynote { font-size: 12px; margin-top: 10px; line-height: 1.6; }
#handPanel, #handPanel.overlay { flex: 0 0 calc(var(--hand-cards-height) + var(--hand-commands-height) + 6px); height: calc(var(--hand-cards-height) + var(--hand-commands-height) + 6px); min-height: 0; margin: 0; padding: 6px 0 0; position: relative; z-index: 2; border: 0; display: grid; grid-template-rows: var(--hand-cards-height) var(--hand-commands-height); }
#handPanel .cards { grid-row: 1; display: grid; grid-template-columns: repeat(8,var(--hand-tile-width)); gap: var(--hand-gap); justify-content: center; align-items: start; height: var(--hand-cards-height); min-height: 0; padding: 0 4px; margin: 0; }
#handPanel .cards .card { width: var(--hand-tile-width); max-width: none; height: var(--hand-cards-height); min-height: 0; padding: 0; display: flex; flex-direction: column; align-items: center; }
#handPanel .card .tag { flex: 0 0 16px; height: 16px; min-height: 16px; line-height: 16px; margin: 0 0 2px; padding: 0; font-size: 11px; }
#handPanel .cards .card > .t { height: calc(var(--hand-tile-width)*1.4); flex: none; }
#handPanel .cardOutcome { height: 42px; flex: 0 0 42px; margin-top: 4px; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
#handPanel .cardOutcome .jk { margin: 0; min-height: 21px; line-height: 21px; font-size: 14px; white-space: nowrap; text-shadow: none; }
#handPanel .cardOutcome .jk.gold { font-size: 12px; line-height: 21px; }.cardOutcome .betv, #handPanel .cardOutcome .yk { font-size: 10px; line-height: 12px; }
#handPanel .tileKey { position: absolute; top: 21px; right: 4px; font: 10px system-ui; padding: 0 3px; border-radius: 3px; background: #f8f0dacc; color: #71664d; pointer-events: none; }
#handPanel .card:disabled { opacity: .88; }
#handPanel .card:not(:disabled):hover, #handPanel .card:focus-visible { transform: translateY(-4px); }
#handPanel .card:not(:disabled):hover .t, #handPanel .card:focus-visible .t { transform: none; }
#handPanel .hinfo { grid-row: 2; height: var(--hand-commands-height); min-height: 0; max-height: none; margin: 0; padding: 5px 3px; overflow: visible; display: grid; grid-template-columns: minmax(95px,1fr) minmax(0,2.5fr) auto; grid-template-rows: 22px 43px 43px; gap: 4px 6px; align-content: start; align-items: center; border: 0; border-top: 1px solid #456044; }
#handPanel .hinfo > .hd { grid-column: 1 / -1; grid-row: 1; margin: 0; min-height: 22px; padding: 2px 5px; font-size: 12px; gap: 6px; }
#handPanel .hd > b { font-size: 12px; }#handPanel .handLegend { font-size: 10px; margin-left: auto; }
#handPanel .bar, #handPanel .prompt, #handPanel .wait { border: 0; margin: 0; padding: 2px 4px; gap: 5px; font-size: 12px; min-width: 0; }
#handPanel .betBar { grid-column: 1; grid-row: 2; display: flex; flex-wrap: nowrap; }
#handPanel .betBar > .dim { display: none; }
#handPanel .betBtn { min-height: 36px; padding: 5px 8px; font-size: 12px; }
#handPanel .bar:not(.betBar) { grid-column: 2 / -1; grid-row: 2; display: flex; flex-wrap: nowrap; }
#handPanel .bar .lbl { display: none; }
#handPanel .bar .fx { min-height: 36px; padding: 4px 6px; display: inline-flex; flex-direction: row; justify-content: center; gap: 5px; font-size: 12px; opacity: 1; }
#handPanel .bar .fx small { display: flex; gap: 2px; font-size: 11px; }#handPanel .bar .fx .t.xs { width: 15px; height: 21px; }
#handPanel .prompt { grid-column: 1 / -1; grid-row: 2; display: flex; align-items: center; flex-wrap: nowrap; }
#handPanel .prompt button, #handPanel .prompt button[data-call] { min-height: 36px; padding: 5px 8px; font-size: 13px; flex-direction: row; gap: 4px; }
#handPanel .prompt button small, #handPanel .prompt button[data-call] small { font-size: 11px; }
#handPanel .prompt > .t.xs { width: 27px; height: 38px; margin-bottom: 4px; }
#handPanel .hinfo:has(.prompt[data-call], .prompt [data-call]) > .betBar, #handPanel .hinfo:has(.prompt [data-call]) > .bar { grid-row: 3; }
#handPanel .handHints { grid-column: 3; grid-row: 3; margin: 0; padding: 0; border: 0; }
#handPanel .handHints summary { min-height: 34px; padding: 6px 8px; font-size: 12px; border: 1px solid #607750; border-radius: 5px; }
#handPanel .hintBody { display: none; }
#handPanel .meldsRow { grid-column: 1 / 3; grid-row: 3; padding: 0; font-size: 12px; display: flex; gap: 5px; align-items: center; }
#handPanel .meldsRow .meldGroup { padding: 3px; }.meldsRow .meldGroup .t.xs { width: 23px; height: 32px; }
#handPanel .wait { grid-column: 1 / -1; grid-row: 3; font-size: 11px; }.wait .t.xs { width: 20px; height: 28px; }
#handPanel .msg { grid-column: 1 / -1; grid-row: 2 / 4; padding: 4px 6px; font-size: 13px; }
#handPanel .finalPrompt { grid-row: 2 / 4; flex-wrap: wrap; align-content: center; }
#handPanel .finalPrompt > b { width: 100%; font-size: 14px; }
#handPanel .hinfo:has(.finalPrompt) > .wait { display: none; }
#handPanel:not(.overlay) .hinfo { grid-row: 1 / -1; height: 100%; display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; justify-content: center; gap: 10px; }
#handPanel .endTable { width: 100%; padding: 0 6px; }#handPanel .endTable table { font-size: 13px; }#handPanel .endTable td, #handPanel .endTable th { padding: 4px; }
#handPanel .endTable button { min-height: 28px; padding: 1px 4px; font-size: 12px; background: none; border-color: transparent; }
#board > #guide { position: absolute; left: 8px; bottom: 8px; z-index: 9; width: clamp(126px,23%,180px); height: 166px; display: grid; grid-template-rows: 14px 30px 66px 36px; padding: 9px; border: 1px solid #84945e; border-radius: 8px; background: #10291ff5; box-shadow: 0 5px 18px #0005; pointer-events: none; }
#board > #guide[data-active=true] { border-color: #f2cf80; box-shadow: 0 0 0 1px #f2cf8044,0 5px 18px #0005; }
#board > #guide .guideTop .eyebrow { color: #f5d793; font-size: 11px; letter-spacing: .06em; }
#board > #guide h2 { margin: 0; padding: 4px 0; font-size: 14px; line-height: 1.3; background: none; border: 0; }
#board > #guide .duelPreview { margin: 0; padding: 3px 0 8px; gap: 14px; }.duelPreview > div { gap: 4px; }
#board > #guide .duelPreview .t.s, #board > #guide .emptyTile { width: 32px; height: 45px; }
#board > #guide .targetTile .t.s { outline: 2px solid #e8c674; outline-offset: 1px; }
#board > #guide .duelPreview small { font-size: 10px; white-space: nowrap; }.duelVs { font-size: 20px; }
#board > #guide .previewOutcome { margin: 0; height: 36px; min-height: 0; padding: 3px 2px; font-size: 11px; line-height: 1.35; }
.tableLabel { left: 12px; top: 12px; font-size: 9px; }.tableLabel span { font-size: 6px; }
.cameraControls { right: 8px; bottom: 8px; }.cameraControls button { min-height: 28px; padding: 3px 8px; font-size: 11px; }
#inspectTable { border-right: 1px solid #647350; color: #efd38e; }
.seat, .seat.pos0 { padding: 6px 8px; width: 130px; }.seat.pos0 { width: 170px; bottom: 8px; }.seat.pos2 { top: 8px; }.seat.pos1 { right: 7px; }.seat.pos3 { left: 7px; }
.seat.pos1, .seat.pos3 { top: 25%; }
.seat .nm { font-size: 11px; }.seat .score .sc { font-size: 24px; }.seat .status { font-size: 10px; }.seat .playerMode { font-size: 9px; }
.seat .melds { margin-top: 5px; pointer-events: auto; }.seat .meldGroup { padding: 2px; gap: 1px; }.seat .meldType { font-size: 9px; }.seat .meldGroup .t.xs { width: 20px; height: 28px; }
.seat .seatFinal .t.xs { width: 20px; height: 28px; }.seat.pos0 .seatFinal .t.xs { width: 21px; height: 30px; }
.seat.revealed { max-width: 230px; }.seatFinal { margin-top: 5px; padding-top: 5px; }.seatYaku { margin-top: 4px; gap: 3px; }.seatYaku > span { font-size: 11px; }.seatYaku strong { font-size: 20px; }
#flHelp > h2 { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
#flHelp [data-collapse-fl-help] { min-height: 28px; padding: 2px 6px; font-size: 11px; }
.flHelpIntro { margin: 0; padding: 8px 11px; color: var(--ui-muted); font-size: 12px; line-height: 1.5; }
.flHelpList { display: grid; gap: 7px; padding: 0 8px 9px; }.flHelpItem { border: 1px solid #57724f; border-radius: 6px; padding: 8px; background: #203c2b; }
.flHelpHeading { display: flex; align-items: center; justify-content: space-between; gap: 5px; font-size: 14px; }.flHelpHeading > span { display: inline-flex; align-items: center; gap: 3px; }
.flHelpHeading .t.xs { width: 19px; height: 27px; }
.flHelpItem p { margin: 7px 0; font-size: 12px; line-height: 1.65; }.flHelpState { font-size: 11px; line-height: 1.5; color: #bcccb9; }.flHelpState.ready { color: #f9df9b; font-weight: 600; }
.flHelpItem.unavailable { color: #bbc6b8; border-color: #3f5641; background: #1a2d23; }.flHelpItem.current { border-color: #ffe298; background: #4a5332; box-shadow: 0 0 0 1px #ffe29877; }
body[data-effects-collapsed=true] #flHelp .flHelpIntro, body[data-effects-collapsed=true] #flHelp .flHelpList { display: none; }
body > #flHelp { position: fixed; right: 12px; top: 136px; width: min(310px,calc(100vw - 24px)); max-height: min(44dvh,370px); z-index: 30; overflow: auto; overscroll-behavior: contain; border: 1px solid #bba264; border-radius: 8px; background: #132d23fa; pointer-events: auto; box-shadow: 0 10px 30px #0007; }
body > #flHelp > h2 { position: sticky; top: 0; z-index: 1; background: #233c2b; }
body[data-panel=info] > #flHelp, body[data-panel=reference] > #flHelp { display: none !important; }
#handPanel.overlay .hinfo { margin-top: 0; }
#tutorialPanel { position: absolute; top: 8px; left: 8px; right: 8px; z-index: 25; max-height: 70%; overflow: auto; padding: 10px; margin: 0; }
#tutorialPanel h2 { font-size: 16px; }#tutorialCaption { font-size: 13px; line-height: 1.6; margin: 6px 0; }.tutorialExample { min-height: 0; margin: 5px 0; }.tutorialControls { gap: 6px; margin-top: 6px; }.tutorialControls button { min-height: 32px; font-size: 12px; padding: 4px 8px; }
.tutorialMode #board > #guide { display: none; }
#debugBar { position: absolute; top: 5px; left: 5px; right: 5px; z-index: 22; font-size: 11px; padding: 5px; gap: 5px; margin: 0; width: auto; }#debugBar button { font-size: 11px; min-height: 28px; padding: 3px 6px; }
/* デバッグ欄は左下(全員 CPU の観戦中は空いている手札の場所)に置き、デバッグの操作棒と卓を隠さない */
body.debug #leftSide { position: fixed; left: 12px; top: auto; bottom: 12px; max-height: 40vh; width: min(440px,40vw); z-index: 24; overflow: auto; }
.settingsBody { width: 290px; max-height: calc(100dvh - 68px); overflow: auto; overscroll-behavior: contain; font-size: 14px; }.playerSetting .mode button { min-height: 38px; }
#detailDialog { width: min(780px,calc(100vw - 28px)); height: min(820px,calc(100dvh - 36px)); max-width: none; max-height: none; padding: 0; border: 1px solid #a9a274; border-radius: 12px; color: #f0f0e4; background: #152b22; box-shadow: 0 20px 80px #000a; overflow: hidden; }
#detailDialog:not([open]) { display: none; }#detailDialog[open] { display: grid; grid-template-rows: auto minmax(0,1fr); }
#detailDialog[data-source=detail] { height: min(540px,calc(100dvh - 36px)); }
#detailDialog::backdrop { background: #06130ed4; backdrop-filter: blur(3px); }
#detailDialog > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid #53684a; background: #203b2b; }
#detailTitle { padding: 0; margin: 0; border: 0; background: none; font-size: 19px; }
#detailClose { min-height: 38px; font-size: 14px; }
#detailDialog .dialogBody { min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 18px 22px 28px; font-size: 15px; line-height: 1.8; }
#detailDialog .dialogBody .rr { display: grid; grid-template-columns: 110px minmax(0,1fr); gap: 12px; padding: 13px 0; border-bottom: 1px solid #40583f; }
#detailDialog .dialogBody .rk { font-size: 14px; color: #f1d997; }#detailDialog .dialogBody .rb { font-size: 15px; line-height: 1.9; }
#detailDialog .rsec { margin: 18px 0 8px; color: #f2d28b; font-size: 18px; font-weight: 600; }
#detailDialog .t.xs, #detailDialog .t.s { width: 28px; height: 39px; margin: 2px 1px 5px; vertical-align: middle; }
#detailDialog .dialogBody > div[data-log-id] { padding: 11px 0; border-bottom: 1px solid #36513e; }
#detailDialog .lt { display: inline-flex; vertical-align: middle; }
.roleExample, .meldExample { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 18px 0 26px; }
#detailDialog .roleExample .t.xs, #detailDialog .meldExample .t.xs { width: 60px; height: 84px; }
#detailDialog .roleExample .grp { display: inline-flex; gap: 3px; padding: 5px 8px; border: 1px solid #69805b; border-radius: 7px; }
.detailPoints { color: #f5d690; font-size: 28px; font-weight: 600; }.detailNote { color: #c3d0bd; font-size: 14px; }
.publicReview { padding: 14px 0; border-top: 1px solid #57704d; }.publicReview h3 { margin: 0 0 10px; font-size: 17px; }.publicReview h3 small { color: #d4c18b; font-size: 14px; margin-left: 10px; }.publicReview h4 { color: #bacaaf; margin: 12px 0 6px; font-size: 13px; }
.reviewRiver, .reviewMelds { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 8px; }.reviewTile { display: flex; flex-direction: column; align-items: center; padding: 4px; }.reviewTile.isTarget { border: 2px solid #efd18a; border-radius: 7px; }.reviewTile small { font-size: 11px; color: #f4d68f; }
#detailDialog .reviewTile .t.s, #detailDialog .reviewMelds .t.s { width: 34px; height: 48px; }.reviewMelds > div { display: flex; gap: 8px; align-items: center; padding: 8px; background: #253c2b; border-radius: 6px; }
.dialogBody .hintRow { gap: 10px; padding: 12px 0; }.dialogBody .hintBody p { font-size: 15px; }
#layoutTabs, #railTabs { display: none; }
* { scrollbar-width: auto; scrollbar-color: #9baf80 #14271e; }
@media (min-width: 1000px) and (max-width: 1279px) {
  main, body.debug main { grid-template-areas: "table railnav" "table rail"; grid-template-columns: minmax(0,1fr) 320px; grid-template-rows: 38px minmax(0,1fr); gap: 8px 12px; }
  #side, #yakuSide { grid-area: rail; }
  #railTabs { grid-area: railnav; display: flex; gap: 5px; }#railTabs button { flex: 1; font-size: 12px; }
  #railTabs button[aria-pressed=true] { border-color: #d3b66d; background: #3c5134; color: #f5e3b2; }
  body[data-rail=reference] #side, body[data-rail=info] #yakuSide { display: none; }
}
@media (max-height: 680px) {
  #top { flex-basis: 44px; height: 44px; }#status { flex-basis: 30px; height: 30px; }
  #side { grid-template-rows: minmax(0,1fr) 108px 36px 36px; gap: 6px; }#side > #lastResult { height: 108px; }
  #tableCol { --hand-commands-height: 128px; }
  .seat.pos1, .seat.pos3 { top: 8px; }
}
@media (max-width: 999px) {
  #top { padding: 4px 10px; gap: 8px; flex-wrap: nowrap; }#top .brand { flex: 1 1 auto; min-width: 0; }#top h1 { font-size: 16px; }#top .brand .eyebrow { display: none; }#top .spacer, .edition { display: none; }.pixelLink { font-size: 10px; padding: 3px; }#top .helpActions { margin: 0; }
  #status { padding-inline: 10px; }
  #layoutTabs { display: flex; flex: 0 0 38px; justify-content: center; gap: 5px; padding: 0 8px 6px; }#layoutTabs button { flex: 1; max-width: 260px; min-height: 32px; padding: 4px 8px; font-size: 12px; }#layoutTabs button[aria-selected=true] { background: #3d5138; border-color: #d6b775; color: #f6e4b7; }
  main, body.debug main { display: flex; flex-direction: column; padding: 0 8px 8px; gap: 0; }
  #tableCol, #side, #yakuSide { flex: 1 1 0; width: 100%; min-height: 0; margin: 0 auto; }
  #side, #yakuSide { max-width: 720px; }
  body[data-panel=table] #side, body[data-panel=table] #yakuSide, body[data-panel=info] #tableCol, body[data-panel=info] #yakuSide, body[data-panel=reference] #tableCol, body[data-panel=reference] #side { display: none; }
  #tableCol { --hand-commands-height: 136px; }
  #handPanel .hinfo { grid-template-rows: 22px 47px 47px; }
  #handPanel .myScore, #handPanel .handLegend { display: none; }
  #handPanel .bar .fx small { display: none; }
  #handPanel .prompt button, #handPanel .prompt button[data-call] { padding: 4px 6px; font-size: 12px; min-height: 38px; }
  #handPanel .finalPrompt { gap: 5px; }#handPanel .finalPrompt button { flex: 1; display: flex; flex-direction: column; padding: 5px; }
  #board > #guide { width: 112px; height: 150px; grid-template-rows: 12px 30px 56px 36px; padding: 7px; }#board > #guide h2 { font-size: 12px; }#board > #guide .guideTop .eyebrow { font-size: 9px; }#board > #guide .duelPreview { gap: 8px; }#board > #guide .duelPreview .t.s, #board > #guide .emptyTile { width: 26px; height: 37px; }#board > #guide .duelPreview small { font-size: 9px; }#board > #guide .previewOutcome { font-size: 10px; }
  .seat, .seat.pos0 { width: 110px; padding: 5px 6px; }.seat.pos0 { width: 156px; bottom: 39px; }.seat .nm { font-size: 10px; }.seat .score .sc { font-size: 21px; }
  .cameraControls button { min-height: 34px; }
  #handPanel .prompt button, #handPanel .prompt button[data-call], #handPanel .betBtn, #handPanel .bar .fx { min-height: 42px; }
  #handPanel .handHints summary { min-height: 38px; }
  #flHelp [data-collapse-fl-help] { min-height: 34px; }
}
@media (max-width: 520px) {
  #top { flex: 0 0 74px; height: 74px; flex-wrap: wrap; padding: 4px 9px; gap: 2px 6px; }#top .brand { flex: 1 1 calc(100% - 95px); }#top h1 { font-size: 15px; }#top .helpActions { margin-left: auto; }#top .helpActions button, #settings > summary { min-height: 32px; font-size: 12px; padding: 3px 7px; }
  #status { flex-basis: 32px; height: 32px; gap: 8px; font-size: 11px; }#status .roundBadge { font-size: 15px; }#status .progressLabel b { font-size: 14px; }
  #layoutTabs { flex-basis: 38px; }#layoutTabs button { font-size: 11px; }
  #handPanel .cards .tileKey { display: none; }#handPanel .cardOutcome .jk { font-size: 10px; }#handPanel .cardOutcome .jk.gold { font-size: 10px; }#handPanel .cardOutcome .yk { font-size: 9px; }#handPanel .card .tag { font-size: 10px; }
  #handPanel .hinfo { grid-template-columns: 95px minmax(0,1fr) auto; gap: 4px; padding-inline: 1px; }#handPanel .hd, #handPanel .hd > b { font-size: 11px; }#handPanel .betBtn { font-size: 11px; padding: 4px 6px; }#handPanel .bar .fx { font-size: 11px; padding: 4px 5px; gap: 2px; }#handPanel .handHints summary { font-size: 11px; padding: 5px; }#handPanel .prompt { gap: 4px; padding: 1px; font-size: 10px; }#handPanel .prompt button small { display: none; }#handPanel .prompt > .t.xs { width: 25px; height: 35px; }
  #handPanel .meldsRow > span:first-child { display: none; }.meldsRow .meldGroup .t.xs { width: 21px; height: 29px; }
  body > #flHelp { top: 138px; max-height: 40dvh; width: min(300px,calc(100vw - 24px)); }
  .seat.pos0 { left: 65%; width: 146px; bottom: 48px; }
  #detailDialog { width: calc(100vw - 16px); height: calc(100dvh - 24px); border-radius: 9px; }#detailDialog > header { padding: 9px 11px; }#detailTitle { font-size: 17px; }#detailDialog .dialogBody { padding: 12px 14px 22px; font-size: 14px; }#detailDialog .dialogBody .rr { grid-template-columns: 1fr; gap: 3px; }#detailDialog .dialogBody .rb { font-size: 14px; }#detailDialog .roleExample .t.xs, #detailDialog .meldExample .t.xs { width: 32px; height: 45px; }#detailDialog .roleExample .grp { padding: 3px; gap: 1px; }.roleExample { gap: 7px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* プレイヤー枠:状態バッジ(封じ・封印・予約・勝負)と、読み・溜め・棒の表示を大きく */
.seatBadges { position: absolute; top: -11px; right: 6px; display: flex; gap: 3px; z-index: 3; pointer-events: none; }
.seat.pos2 .seatBadges { top: auto; bottom: -11px; }
.sbadge { font-size: 12px; font-weight: 700; line-height: 18px; padding: 0 6px; border: 1px solid; border-radius: 3px; white-space: nowrap; box-shadow: 0 2px 6px #0007; }
.sbadge.debuff { background: #5c1f19; border-color: #e0786a; color: #ffdcd6; }
.sbadge.seal { background: #3b2f63; border-color: #a993e8; color: #ece6ff; }
.sbadge.reserve { background: #5e3b12; border-color: #e8a45a; color: #ffe4c4; }
.sbadge.bet { background: #5a4612; border-color: #f2cf80; color: #fff2cc; }
@media (min-width: 1000px) {
  .seat, .seat.pos0 { width: 158px; }.seat.pos0 { width: 196px; }
  .seat .status { font-size: 12px; flex-wrap: wrap; row-gap: 3px; min-height: 20px; }
  .seat .status .readTag { font-size: 12px; gap: 2px; }
  .seat .status .readTag .t.xs { width: 17px; height: 24px; }
  .seat .status .chargeTag { font-size: 13px; letter-spacing: 0; }
  .seat .status .stickCount { gap: 3px; }
  .seat .status .miniStick { width: 20px; height: 6px; }
  .seat .status .miniStick::after { width: 3px; height: 3px; margin: -1.5px 0 0 -1.5px; }
}
/* 勝負牌の枠(手牌の左)と捨て牌ボタン(手牌の右) */
.betDock, .riverCol { display: none; }
#handPanel.betDocked .betDock { position: absolute; left: 8px; top: 6px; z-index: 3; height: calc(var(--hand-cards-height) - 6px); display: flex; flex-direction: column; gap: 4px; padding: 6px 7px; border: 1px solid #b89a52; border-radius: 6px; background: #1a2a20f2; overflow: hidden; }
#handPanel.betDocked .hinfo > .betBar { display: none; }
.betDock .bdHead { display: flex; align-items: baseline; gap: 6px; font-size: 13px; color: #f5d793; }
.betDock .bdHead strong { font-size: 18px; color: #fff2cc; }.betDock .bdHead strong small { font-size: 11px; margin-left: 1px; }
.betDock .bdHead span { margin-left: auto; font-size: 10px; color: #b9c9b7; }
.betDock .bdList { flex: 1; display: flex; gap: 5px; min-height: 0; }
.betDock .bdPick { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 4px 2px; border: 1px solid #607750; border-radius: 5px; background: #24382b; color: #e8e2cf; cursor: pointer; }
.betDock .bdPick:hover, .betDock .bdPick:focus-visible { background: #33503b; border-color: #f2cf80; }
.betDock .bdPick .t.s { width: 30px; height: 42px; }
.betDock .bdPick span { font-size: 10px; line-height: 1.2; text-align: center; color: #b9c9b7; }
.betDock .bdPick span b { display: block; font-size: 14px; color: #e8e2cf; }
.betDock .bdPick span.plusv b { color: #8fe39a; }.betDock .bdPick span.minusv b { color: #ff9a8f; }
.betDock .bdNote { font-size: 10px; line-height: 1.3; color: #b9c9b7; }
#handPanel.riverDocked .riverBtn { position: absolute; right: 8px; top: 30px; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border: 1px solid #607750; border-radius: 6px; background: #1a2a20f2; color: #e8e2cf; font-size: 12px; cursor: pointer; }
#handPanel.riverDocked .riverBtn:hover, #handPanel.riverDocked .riverBtn:focus-visible { background: #33503b; border-color: #f2cf80; }
.riverBtn .rbTiles { display: flex; gap: 2px; }.riverBtn .rbTiles .t.xs { width: 20px; height: 28px; }
/* 捨て牌の一覧 */
.publicReview h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.publicReview .whereTag { font-size: 12px; padding: 1px 6px; border: 1px solid #b89a52; border-radius: 3px; color: #f5d793; }
.publicReview .readTag { font-size: 13px; }.publicReview .readTag .t.xs { width: 20px; height: 28px; }
.reviewTile.aiko { border-bottom: 3px solid #5fbf74; }
/* PC では手牌の左右に勝負牌の枠と捨て牌ボタンの場所(各 150px)を空けておく */
@media (min-width: 1000px) {
  #tableCol { --hand-tile-width: min(clamp(45px,10.5dvh,88px),calc((100cqw - 8px - 7 * var(--hand-gap) - 300px)/8)); }
}
/* 余白が狭いときの勝負牌の枠:牌を縦に並べる */
#handPanel.betDocked.compact .betDock { padding: 5px; gap: 3px; }
#handPanel.betDocked.compact .bdHead { flex-wrap: wrap; gap: 2px 4px; font-size: 12px; }
#handPanel.betDocked.compact .bdHead strong { font-size: 15px; }
#handPanel.betDocked.compact .bdHead span, #handPanel.betDocked.compact .bdNote { display: none; }
#handPanel.betDocked.compact .bdList { flex-direction: column; gap: 3px; }
#handPanel.betDocked.compact .bdPick { flex-direction: row; justify-content: flex-start; gap: 5px; padding: 2px 4px; }
#handPanel.betDocked.compact .bdPick .t.s { width: 22px; height: 31px; }
#handPanel.betDocked.compact .bdPick span { text-align: left; font-size: 9px; }
#handPanel.betDocked.compact .bdPick span b { font-size: 13px; }
#handPanel.betDocked.compact .bdPick { padding: 1px 4px; min-height: 0; }
#handPanel.betDocked.compact .bdPick .t.s { width: 19px; height: 26px; }
#handPanel.betDocked.compact .bdList { gap: 2px; }
/* 捨て牌の一覧は詰めて、4 人分が 1 画面に入るように */
#detailDialog .publicReview { padding: 8px 0; }
#detailDialog .publicReview h3 { margin: 0 0 6px; font-size: 15px; }
#detailDialog .publicReview h4 { margin: 6px 0 4px; font-size: 12px; }
#detailDialog .reviewRiver { gap: 4px; }#detailDialog .reviewTile { padding: 2px; }

/* 2026-10-30 手牌の左右の列:左 = 勝負の手(勝負牌 + フレミング)、右 = 捨て牌を見る + 鳴いた牌。下の操作欄は列のぶん内側に寄せる */
#handPanel.betDocked .betDock { bottom: 6px; height: auto; overflow-y: auto; }
#handPanel.betDocked .hinfo { margin-left: var(--dock-l); }
#handPanel.betDocked .hinfo > .bar:not(.betBar) { display: none; }
#handPanel.riverDocked .riverCol { position: absolute; right: 8px; top: 6px; bottom: 6px; z-index: 3; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
#handPanel.riverDocked .riverBtn { position: static; display: flex; width: auto; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border: 1px solid #607750; border-radius: 6px; background: #1a2a20f2; color: #e8e2cf; font-size: 12px; cursor: pointer; }
#handPanel.riverDocked .riverBtn:hover, #handPanel.riverDocked .riverBtn:focus-visible { background: #33503b; border-color: #f2cf80; }
#handPanel.riverDocked .hinfo { margin-right: var(--dock-r); }
#handPanel.riverDocked .hinfo .meldsRow { display: none; }
.riverCol .rcMelds { display: flex; flex-direction: column; gap: 4px; padding: 6px; border: 1px solid #456044; border-radius: 6px; background: #1a2a20f2; }
.riverCol .rcMelds > span { font-size: 11px; color: #b9c9b7; }
.riverCol .rcMelds .meldGroup { justify-content: center; }
.riverCol .rcMelds .meldGroup .t.xs { width: 22px; height: 31px; }
.betDock .fxHead { margin-top: 4px; padding-top: 5px; border-top: 1px solid #456044; }
.betDock .bdFx { display: flex; flex-direction: column; gap: 4px; }
.betDock .bdFxBtn { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 6px; padding: 4px 6px; border: 1px solid #b89a52; border-radius: 5px; background: #2c2a17; color: #f3e6bf; cursor: pointer; text-align: left; }
.betDock .bdFxBtn:hover, .betDock .bdFxBtn:focus-visible { background: #3d3a1f; border-color: #f2cf80; }
.betDock .bdFxBtn .fxName { font-size: 12px; font-weight: 700; }
.betDock .bdFxBtn b { font-size: 12px; color: #ffe39b; justify-self: end; }
.betDock .bdFxBtn small { grid-column: 1 / -1; display: flex; align-items: center; gap: 2px; font-size: 10px; color: #b9c9b7; }
.betDock .bdFxBtn .t.xs { width: 15px; height: 21px; }
#handPanel.betDocked.compact .betDock { overflow-y: auto; }
/* 最後のツモ:ボタンは 2 段目、待ちは 3 段目(鳴いた牌と重ならないように) */
#handPanel .hinfo > .finalPrompt { grid-row: 2; flex-wrap: nowrap; }
#handPanel .hinfo > .finalPrompt > b { width: auto; white-space: nowrap; }
#handPanel .hinfo:has(.finalPrompt) > .wait { display: block; grid-row: 3; grid-column: 1 / 3; }
#handPanel .hinfo:has(.finalPrompt) > .meldsRow { grid-row: 3; grid-column: 3; }
#handPanel .wait .t.xs { margin-right: 2px; vertical-align: middle; }

/* 勝負牌宣言:点棒の絵・説明・何が起きるか */
.betDock .bdTitle { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #f5d793; }
.betDock .bdTitle strong { margin-left: auto; font-size: 18px; color: #fff2cc; }.betDock .bdTitle strong small { font-size: 11px; margin-left: 1px; }
.betDock .bdTitle.off { color: #9aa89a; }.betDock .bdTitle.off .dockStick { opacity: .35; }
.dockStick { position: relative; flex: none; display: inline-block; width: 30px; height: 7px; background: #f2ecdc; border: 1px solid #1d1a12; border-radius: 2px; box-shadow: 0 1px 2px #0006; }
.dockStick::after { content: ""; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: #c0302a; }
.betDock .bdDesc { font-size: 11px; line-height: 1.4; color: #e8e2cf; }
.betDock .bdDesc .dim { color: #9fb09c; font-size: 10px; }
.betDock .bdOutcome { display: flex; flex-direction: column; gap: 2px; padding: 4px 5px; border: 1px solid #456044; border-radius: 4px; background: #13211a; font-size: 10.5px; line-height: 1.35; color: #d8d2bf; }
.betDock .bdOutcome .dim { color: #9fb09c; }
.betDock .bdOutcome b { font-weight: 700; }
#handPanel.betDocked.compact .bdTitle { flex-wrap: wrap; gap: 3px 5px; font-size: 12px; }
#handPanel.betDocked.compact .bdTitle strong { font-size: 15px; }
#handPanel.betDocked.compact .bdDesc { font-size: 10px; }
#handPanel.betDocked.compact .bdOutcome { font-size: 9.5px; padding: 3px 4px; }

.betDock .bdList { flex: none; }
#handPanel.betDocked.compact .betDock .long { display: none; }
#handPanel.betDocked.compact .bdPick { min-height: 30px; }

/* 見込みの説明は 1 回だけ上に出し、牌ごとには % だけ(文字が重ならないように) */
.betDock .bdCap { font-size: 10px; color: #9fb09c; margin-bottom: -1px; }
.betDock .bdPick span { white-space: nowrap; }

/* オンライン対戦 */
#onlineBadge { margin-left: 10px; padding: 2px 8px; border: 1px solid #b89a52; border-radius: 4px; font-size: 12px; color: #f5d793; }
body.online #restart, body.online #playerSettings, body.online #dbgToggle, body.online #len { display: none; }
#overlay .lobbyBox { width: min(460px, 94vw); }
#overlay .lobbyBox h2 { font-size: 20px; }
.olName { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.olName input { flex: 1; padding: 4px 6px; }
.olSeats { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 10px; }
.olSeat { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid #456044; border-radius: 4px; background: #1a2a20; }
.olWind { width: 22px; text-align: center; color: #f5d793; font-weight: 700; }
.olSeat button { margin-left: auto; }
.olYou, .olHost { font-size: 11px; padding: 0 5px; border: 1px solid #b89a52; border-radius: 3px; color: #f5d793; }
.olLink { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.olLink input { flex: 1; min-width: 0; padding: 4px 6px; font-size: 12px; }
.olLink a { color: #f5d793; font-size: 12px; white-space: nowrap; }
#watchPanel { position: fixed; left: 50%; top: 60px; transform: translateX(-50%); z-index: 40; display: flex; gap: 6px; align-items: center; padding: 6px 10px; border: 1px solid #b89a52; border-radius: 6px; background: #13211af2; color: #e8e2cf; font-size: 13px; }
#watchPanel[hidden] { display: none; }

#onlineBadge .olLeave { margin-left: 8px; padding: 1px 8px; font-size: 11px; }
#overlay .ft a.button { display: inline-block; padding: 6px 12px; border: 1px solid #b89a52; border-radius: 4px; color: #1b1608; background: #f2cf80; text-decoration: none; }

/* 混雑のお知らせ */
.olWait { margin: 8px 0; padding: 8px 10px; border: 1px solid #e8a45a; border-radius: 4px; background: #2e2412; color: #ffe4c4; font-size: 13px; line-height: 1.5; }
.olWait.daily { border-color: #e0786a; background: #2e1612; color: #ffdcd6; }
.olWait p { margin: 4px 0 0; }
.olWait .button { display: inline-block; margin-left: 6px; padding: 2px 10px; border: 1px solid #b89a52; border-radius: 4px; color: #1b1608; background: #f2cf80; text-decoration: none; }
#netmsg { display: block; margin-top: 4px; font-size: 12px; color: #b9c9b7; }
