/* Paper, cel-shaded lacquer, amber wood and jade belong to the same room. */
:root {
  --paper-warm:#f8f2de;
  --paper-shadow:#e8dcc0;
  --pine-ink:#203c39;
  --pine-mid:#36675d;
  --wood-line:#86634e;
  --ui-header:62px;
}
#layoutPicker {
  width:min(480px,calc(100vw - 24px));padding:clamp(16px,3vw,28px);border:2px solid #967955;
  border-radius:16px;background:#fff5dc;color:#2c4e42;box-shadow:0 12px 42px #18352d82;
}
#layoutPicker::backdrop {background:#16372ec4}
#layoutPicker h2 {font:700 clamp(22px,3vw,28px)/1.3 var(--serif);margin:0 0 18px}
.layout-choices {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.layout-choices button {
  padding:16px 5px;min-height:112px;display:grid;justify-items:center;align-content:center;gap:7px;
  background:#f8edd0;color:#325547;border:1px solid #b7a17e;border-bottom:3px solid #aa9065;border-radius:9px;
}
.layout-choices button:focus-visible {outline:3px solid #417866;outline-offset:2px}
.layout-choices strong {font-size:18px}.layout-choices span {font-size:12px}
.layout-choices i {display:block;color:#497d68;border:2px solid currentColor;background:#d5e3c8}
[data-layout-choice="desktop"] i {width:32px;height:21px;border-radius:3px;margin:0 0 6px;position:relative}
[data-layout-choice="desktop"] i::after {content:"";position:absolute;width:17px;height:3px;background:currentColor;left:6px;bottom:-7px}
[data-layout-choice="mobile"] i {width:17px;height:27px;border-radius:4px;border-bottom-width:5px}
#netLayoutSwitch {margin-left:auto;background:transparent;border:1px solid #a7aa8d;color:#34584b}
.club-header #layoutSwitch {white-space:nowrap}
body {
  color:var(--pine-ink);
  background:linear-gradient(142deg,#fff8e3 0%,#f6edd7 42%,#dfddc9 100%);
  min-height:100vh; min-height:100svh;
}
.club-header,.club-main {width:100%;max-width:none;padding-inline:clamp(4px,.6vw,14px)}
.club-header {height:var(--ui-header);min-height:0;border-bottom:1px solid #ae957269;position:relative;z-index:12}
.club-heading {gap:10px}
.club-heading h1 {font-size:clamp(21px,2.1vw,29px);color:var(--pine-ink);letter-spacing:.07em}
.club-heading small {margin-top:3px;color:#53655a;letter-spacing:.1em;font-size:10px}
.club-seal {
  height:38px;width:36px;color:#fff1d2;border:1px solid #693c35;border-radius:8px;
  background:linear-gradient(140deg,#d27d5c 10%,#ad5544 11%,#ad5544 71%,#964536 72%);
  box-shadow:inset 0 0 0 2px #b45c49,inset 0 0 0 3px #edb985,0 2px 0 #9b7858;
  font-size:25px;
}
.club-header nav button,.club-header .tools-trigger,.sessionline .new-round,#coachBtn {
  background:#fff9e8;color:#34544b;border:1px solid #b8aa88;border-radius:7px;
  padding:6px 12px;min-height:35px;font-size:14px;font-weight:600;box-shadow:0 2px 0 #cabb9b;
}
.club-header nav button:hover,.club-header .tools-trigger:hover,.sessionline .new-round:hover,#coachBtn:hover {
  color:#263e37;background:#f4e5bd;border-color:#9e825e;
}
.club-header #appearanceBtn {color:#335e50;border-color:#9d9778}
.club-header .tools-trigger {display:none}
html[data-ui-mode="desktop"] {
  --ui-header:clamp(51px,6.2dvh,97px);
  --pc-control:clamp(35px,4.4dvh,78px);
  --pc-text:clamp(14px,1.7dvh,30px);
  --pc-tile:clamp(27px,min(4.3vw,7.7dvh),147px);
}
html[data-ui-mode="desktop"] .club-header nav button,
html[data-ui-mode="desktop"] .sessionline button {font-size:var(--pc-text);min-height:var(--pc-control)}
html[data-ui-mode="desktop"] .sessionline {min-height:calc(var(--pc-control) + 8px)}
html[data-ui-mode="desktop"] .club-main {height:calc(100dvh - var(--header-height,var(--ui-header)))}
html[data-ui-mode="desktop"] .rack .youline strong {font-size:clamp(15px,2dvh,36px)}
html[data-ui-mode="desktop"] .rack #status,html[data-ui-mode="desktop"] #zoomHand {font-size:var(--pc-text)}
html[data-ui-mode="desktop"] #pocket {--size:var(--pc-tile)}
html[data-ui-mode="desktop"] .rack .actions .discard-button {
  min-height:clamp(46px,6dvh,107px);min-width:clamp(140px,11vw,340px);font-size:clamp(17px,2dvh,36px);
}
@media (max-width:820px) {
  html[data-ui-mode="desktop"] .club-header {height:auto;min-height:var(--ui-header);flex-wrap:wrap;justify-content:center}
  html[data-ui-mode="desktop"] .club-header nav {justify-content:center;max-width:none}
  html[data-ui-mode="desktop"] .club-header nav button {min-height:30px;font-size:11px;padding:3px 7px}
  html[data-ui-mode="desktop"] .table-frame .rack {grid-template-columns:minmax(0,1fr);grid-template-areas:"info" "meld" "actions" "notice"}
  html[data-ui-mode="desktop"] .rack .actions {justify-self:center}
}
.club-main {padding-bottom:4px;display:flex;flex-direction:column;height:calc(100vh - var(--ui-header));height:calc(100dvh - var(--ui-header));min-height:440px}
.sessionline {flex:none;min-height:46px;color:#59695c;gap:12px}
.sessionline b {color:#34594e;font-weight:650}.sessionline i {background:#55816b;box-shadow:none}
.sessionline .separator {color:#9a957c}
.view-switch {background:#e7dfc9;border:1px solid #b2a387;border-radius:8px;padding:2px}
.view-switch button {color:#495e53;font-size:13px;min-height:27px;padding:3px 10px;border-radius:5px}
.view-switch button[aria-pressed="true"] {color:#fff7da;background:#416e60;box-shadow:inset 0 1px #71927b}
#coachBtn[aria-expanded="true"] {background:#375f53;color:#fff4d2}
.room-layout {
  flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1fr);align-items:stretch;
}
.table-frame {display:flex;flex-direction:column;min-height:0;min-width:0;background:none;border:0;border-radius:11px;padding:0;box-shadow:0 2px 0 #b6a183}
.room-view {
  flex:1 1 0;height:auto;min-height:260px;aspect-ratio:auto;width:100%;
  border:1px solid #816c55;border-radius:11px 11px 0 0;box-shadow:none;
}
.room-view .cut-info {background:#294b41e5;color:#fff2d1;padding:5px 8px;border-radius:6px;line-height:1.2}
.room-view #opening {padding:3px 6px;border-radius:6px;background:#263b32db;color:#fff1cf}
.room-view #opening button {min-height:31px;padding:3px 8px;font-size:13px}
.table-frame .rack {
  flex:none;display:grid;grid-template-columns:minmax(0,1fr) auto;
  grid-template-areas:"info info" "meld actions" "notice notice";column-gap:14px;align-items:center;
  padding:8px clamp(12px,2vw,28px) 9px;border:1px solid #76553f;border-top:3px solid #c19667;
  border-radius:0 0 11px 11px;
  background:linear-gradient(113deg,#365f54 0%,#2e544b 42%,#284940 100%);
  box-shadow:inset 0 1px #e6bf83,inset 0 -2px #203b34;
}
.rack-top {grid-area:info;gap:10px;min-height:28px;flex-wrap:nowrap}
.rack-top .youline {margin:0;flex:none}
.rack .youline span {color:#d9e3ce}
.rack .youline strong {color:#fff2cc}
.rack #status {color:#f4efd7;font-size:14px;line-height:1.35}
#zoomHand {color:#eceddb;border-color:#82a18b;border-radius:5px;min-height:28px;font-size:13px;padding:3px 9px}
#zoomHand[aria-expanded="true"] {background:#e8e1c4;color:#304c41;border-color:#b7b394}
.rack #handDetail {grid-area:meld;border:0;min-width:0;margin-top:0}
.rack #claimNotice {grid-area:notice;margin:0}
.rack #claimNotice.visible {margin:4px auto 0;padding:3px 9px}
.rack .actions {grid-area:actions;min-width:0;justify-content:center;gap:5px;margin:0;max-width:260px;flex-wrap:wrap}
.rack .actions:empty {display:none}
.rack #handDetail[hidden]~.actions {grid-column:1/-1;justify-self:center}
.rack .actions button {background:#f1ead5;color:#324c43;border:1px solid #bdae89;border-bottom:3px solid #9a9c7e;min-height:40px}
.rack .actions .primary {
  color:#3f3928;background:linear-gradient(#ffdf9c,#efd193 58%,#e8ba77 59%);
  border:1px solid #e7c38c;border-bottom:3px solid #a6794e;box-shadow:inset 0 1px #fff1bc,0 2px 0 #203c36;
}
.rack .actions .primary:disabled {color:#d4dece;background:#416054;border:1px solid #738c79;box-shadow:none;opacity:1}
.rack .actions .discard-button {min-height:48px;min-width:148px;border-radius:9px;font-size:17px;font-weight:700}
#pocket {--size:clamp(35px,4.1vw,62px);height:auto;padding:13px 1px 5px;gap:clamp(2px,.25vw,5px);justify-content:center}
#pocket .tile-art {filter:none}
html #pocket button.tile {--depth:7px;border-radius:6px;aspect-ratio:.78;box-shadow:inset 1px 1px 0 #fffdf2,0 1px 0 #314238,1px 3px 0 #17372e71}
html #pocket button.tile.selected {
  outline:2px solid #ffdc89;outline-offset:1px;transform:translateY(-6px);
  box-shadow:0 4px 0 #253a2f,inset 0 1px #fffcea;
}
.draw-label,.claim-tag {z-index:2;line-height:13px;font-weight:600}
button,summary {touch-action:manipulation;-webkit-tap-highlight-color:transparent}
html #pocket button.tile,html .room-view #hand button.tile {touch-action:none}
[data-tiles="jade"] {
  --tile-face:linear-gradient(142deg,#fffdf1 0%,#fbf5df 63%,#eee4c4 64%,#f5ecd0 100%);
  --tile-band:linear-gradient(#d7dabd 0 19%,#91b8a2 20% 36%,#538777 37% 83%,#397161 84%);
  --tile-back:linear-gradient(135deg,#80ac8e 0 15%,#599077 16% 71%,#3c7667 72%);
}
[data-tiles="bamboo"] {
  --tile-face:linear-gradient(142deg,#fff1ca 0 65%,#f1dcaf 66%);
  --tile-band:linear-gradient(#f7da9b 0 25%,#c69759 26% 72%,#9b693f 73%);
  --tile-back:repeating-linear-gradient(96deg,#d6a35e 0 7px,#c79352 8px 9px,#e1b275 10px 15px);
}
[data-tiles="ice"] {
  --tile-face:linear-gradient(135deg,#fcfffa 0 45%,#e1f4ee 46% 70%,#cfeae7 71%);
  --tile-band:linear-gradient(#d5f5f3 0 22%,#8ed3db 23% 56%,#51a9bb 57% 83%,#40869e 84%);
  --tile-back:linear-gradient(135deg,#b3e9e8 0 16%,#74bdcb 17% 62%,#559dae 63%);
}
[data-surface="felt"] {--surface-base:#437e68;--surface-texture:linear-gradient(135deg,#538d73,#417960 65%,#3c745f)}
[data-surface="linen"] {--surface-base:#4d788b;--surface-texture:repeating-linear-gradient(35deg,#588798 0 3px,#537e90 4px 5px)}
[data-surface="leather"] {--surface-base:#aa795a;--surface-texture:linear-gradient(120deg,#bc8b65,#a67654 64%,#976a4d)}
.material-stage,.cloth-chip {background-image:var(--surface-texture);background-size:cover;border-color:#8f7a58}
.material-stage {border:5px solid #9a7557;box-shadow:inset 0 0 0 2px #d7b87c}
.club-aside:not([hidden]) {color:#e6ebd7;border-color:#927657;background:#2f5148;box-shadow:0 7px 22px #263c3245}
.club-aside .coach-photo {height:62px;min-height:0;background:linear-gradient(117deg,#387664 0 73%,#467f69 73% 86%,#548a70 86%);border-bottom:2px solid #c6ac74}
.club-aside .coach-photo h2 {left:16px;bottom:12px;color:#fff1cd;font-size:23px;text-shadow:none}
.coach-body {background:#f8efda}.journal {background:#34564b}
dialog,#appearance {background:linear-gradient(138deg,#fff8e9,#efe7cf);color:#2e4b40;border:1px solid #a89775}
dialog::backdrop {background:#142f29a6}
  html[data-ui-mode="mobile"] .club-header.tools-ready .tools-trigger {display:inline-flex;align-items:center;gap:7px;justify-content:center;min-height:40px}
  html[data-ui-mode="mobile"] .tools-trigger::before {
    content:"";width:13px;height:10px;
    background:linear-gradient(currentColor 0 2px,transparent 2px 4px,currentColor 4px 6px,transparent 6px 8px,currentColor 8px 10px);
  }
  html[data-ui-mode="mobile"] .club-header.tools-ready nav {
    display:none;position:absolute;z-index:15;right:0;top:calc(100% - 1px);
    margin:0;max-width:none;width:max-content;grid-template-columns:repeat(2,minmax(100px,1fr));gap:6px;
    background:#fbf2dc;border:1px solid #a89271;padding:8px;border-radius:8px;box-shadow:0 5px 12px #213d352c;
  }
  html[data-ui-mode="mobile"] .club-header.tools-open nav {display:grid}
  html[data-ui-mode="mobile"] .club-header nav button {min-height:44px;font-size:14px}
  html[data-ui-mode="mobile"] .club-aside:not([hidden]) {max-height:calc(100% - 8px)}
  html[data-ui-mode="mobile"] .material-choice .choice-name {font-size:13px}
  html[data-ui-mode="mobile"] .choice-card small {font-size:11px}
  html[data-ui-mode="mobile"] dialog {max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px);overscroll-behavior:contain}
  html[data-ui-mode="mobile"] .dialoghead button, html[data-ui-mode="mobile"] #appearance .dialoghead button, html[data-ui-mode="mobile"] .demo-options button {min-width:40px;min-height:40px}
@media (orientation:portrait) {
  html[data-ui-mode="mobile"] {--ui-header:52px}
  html[data-ui-mode="mobile"] .club-header, html[data-ui-mode="mobile"] .club-main {padding-inline:max(6px,env(safe-area-inset-left)) max(6px,env(safe-area-inset-right))}
  html[data-ui-mode="mobile"] .club-header {padding-block:4px;gap:8px}html[data-ui-mode="mobile"] .club-heading {gap:7px}
  html[data-ui-mode="mobile"] .club-seal {display:grid;width:30px;height:32px;font-size:21px}
  html[data-ui-mode="mobile"] .club-heading h1 {font-size:21px}html[data-ui-mode="mobile"] .club-heading small {font-size:9px}
  html[data-ui-mode="mobile"] .club-main {min-height:390px;height:calc(100dvh - var(--ui-header));padding-bottom:max(3px,env(safe-area-inset-bottom))}
  html[data-ui-mode="mobile"] .sessionline {min-height:47px;gap:6px;font-size:12px}
  html[data-ui-mode="mobile"] .sessionline>span {display:none}html[data-ui-mode="mobile"] .sessionline i {margin-right:3px}
  html[data-ui-mode="mobile"] .sessionline .new-round, html[data-ui-mode="mobile"] #coachBtn {font-size:12px;min-height:36px;padding:5px 7px}
  html[data-ui-mode="mobile"] .view-switch button {min-height:29px;padding:2px 7px;font-size:12px}
  html[data-ui-mode="mobile"] .room-view {flex:1 1 0;min-height:160px;height:auto;border-radius:9px 9px 0 0}
  html[data-ui-mode="mobile"] .room-view .cut-info {padding:4px 5px}
  html[data-ui-mode="mobile"] .table-frame .rack {
    display:flex;flex-direction:column;align-items:stretch;gap:0;padding:6px 6px 9px;
    border-radius:0 0 9px 9px;
  }
  html[data-ui-mode="mobile"] .rack-top {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 6px;min-height:0}
  html[data-ui-mode="mobile"] .rack .youline {grid-column:1;grid-row:1}html[data-ui-mode="mobile"] .rack .youline strong {font-size:14px}
  html[data-ui-mode="mobile"] .rack #status {grid-column:1;grid-row:2;text-align:left;justify-self:start;font-size:12px;min-width:0;margin:0}
  html[data-ui-mode="mobile"] #zoomHand {grid-column:2;grid-row:1/span 2;align-self:center;min-height:37px}
  html[data-ui-mode="mobile"] .rack #handDetail {width:100%}
  html[data-ui-mode="mobile"] #pocket {
    display:grid;grid-template-columns:repeat(7,minmax(0,1fr));width:min(100%,449px);margin:0 auto;
    gap:9px 2px;padding:12px 0 5px;justify-items:stretch;
  }
  html[data-ui-mode="mobile"] #pocket button.tile {
    width:100%;max-width:none;min-width:0;height:auto;aspect-ratio:.84;--depth:5px;
    margin:0;border-radius:5px;justify-self:stretch;
  }
  html[data-ui-mode="mobile"] #pocket .tile .draw-label, html[data-ui-mode="mobile"] #pocket .tile .claim-tag {font-size:9px;line-height:11px;top:-9px}
  html[data-ui-mode="mobile"] .rack #actions {max-width:none;margin:5px 0 0;gap:6px}
  html[data-ui-mode="mobile"] .rack .actions .discard-button {min-height:50px;min-width:58%;font-size:18px}
  html[data-ui-mode="mobile"] .rack .actions button {min-height:42px}
}
/* In phone landscape the table and the rack share the same usable height. */
@media (orientation:landscape) {
  html[data-ui-mode="mobile"] {--ui-header:0px}
  html[data-ui-mode="mobile"] .club-header {width:198px;position:absolute;top:env(safe-area-inset-top);left:env(safe-area-inset-left);height:46px;min-height:0;padding:3px 4px 3px 8px;border:0;gap:3px}
  html[data-ui-mode="mobile"] .club-header.tools-ready .tools-trigger {min-height:38px;padding:4px 8px;font-size:13px}
  html[data-ui-mode="mobile"] .club-heading h1 {font-size:16px;letter-spacing:0}html[data-ui-mode="mobile"] .club-heading small, html[data-ui-mode="mobile"] .club-seal {display:none}
  html[data-ui-mode="mobile"] .club-header.tools-ready nav {left:6px;right:auto}
  html[data-ui-mode="mobile"] .club-main {height:100vh;height:100svh;min-height:295px;padding:max(0px,env(safe-area-inset-top)) max(5px,env(safe-area-inset-right)) max(4px,env(safe-area-inset-bottom)) max(5px,env(safe-area-inset-left))}
  html[data-ui-mode="mobile"] .sessionline {margin-left:200px;min-height:46px;gap:5px;font-size:12px}
  html[data-ui-mode="mobile"] .sessionline>span {display:none}html[data-ui-mode="mobile"] .sessionline b {white-space:nowrap}
  html[data-ui-mode="mobile"] .sessionline .new-round, html[data-ui-mode="mobile"] #coachBtn {min-height:35px;font-size:12px;padding:4px 7px}
  html[data-ui-mode="mobile"] .view-switch button {font-size:12px;min-height:26px;padding:2px 7px}
  html[data-ui-mode="mobile"] .table-frame {display:grid;grid-template-columns:minmax(0,1fr) clamp(218px,38vw,462px);grid-template-rows:minmax(0,1fr)}
  html[data-ui-mode="mobile"] .room-view {height:100%;min-height:0;min-width:0;border-radius:8px 0 0 8px}
  html[data-ui-mode="mobile"] .table-frame .rack {
    display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto auto;
    grid-template-areas:"info" "meld" "notice" "actions";gap:3px;align-items:stretch;
    min-width:0;min-height:0;padding:4px 6px;
    border:1px solid #796049;border-left:3px solid #b58d63;border-radius:0 8px 8px 0;
    box-shadow:inset 1px 0 #d4b17b;overflow-y:auto;overscroll-behavior:contain;
  }
  html[data-ui-mode="mobile"] .rack-top {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 3px;min-height:0}
  html[data-ui-mode="mobile"] .rack .youline {grid-area:1/1}html[data-ui-mode="mobile"] .rack .youline strong {font-size:13px}
  html[data-ui-mode="mobile"] .rack .youline .chips {display:none}
  html[data-ui-mode="mobile"] .rack #status {grid-area:2/1/3/3;font-size:12px;text-align:center;margin:auto;line-height:1.3}
  html[data-ui-mode="mobile"] #zoomHand {grid-area:1/2;min-height:30px;font-size:12px;padding:2px 5px}
  html[data-ui-mode="mobile"] .rack #handDetail {width:100%;min-height:0;display:flex;flex-direction:column;align-items:center;container-type:size}
  html[data-ui-mode="mobile"] #pocket {
    flex:1;min-height:0;max-height:255px;width:min(100%,155cqh,395px);max-width:100%;
    display:grid;grid-template-columns:repeat(5,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr));
    gap:4px 3px;margin:auto;padding:7px 0 3px;
  }
  html[data-ui-mode="mobile"] #pocket button.tile {
    width:100%;max-width:none;height:100%;min-width:0;min-height:0;--depth:5px;
    aspect-ratio:auto;margin:0;border-radius:4px;
  }
  html[data-ui-mode="mobile"] #pocket .tile .draw-label, html[data-ui-mode="mobile"] #pocket .tile .claim-tag {font-size:9px;line-height:10px;top:-7px}
  html[data-ui-mode="mobile"] .rack #actions {margin:1px 0;gap:4px;max-width:none;justify-self:stretch}
  html[data-ui-mode="mobile"] .rack .actions .discard-button {min-height:47px;min-width:76%;font-size:17px}
  html[data-ui-mode="mobile"] .rack .actions button {min-height:36px;font-size:13px}
  html[data-ui-mode="mobile"] .rack #claimNotice.visible {font-size:11px;padding:2px 5px;line-height:1.3}
  html[data-ui-mode="mobile"] .rack #claimNotice small {display:none}
}
@media (orientation:landscape) and (max-width:655px) {
  html[data-ui-mode="mobile"] .club-header {width:173px}html[data-ui-mode="mobile"] .sessionline {margin-left:174px}html[data-ui-mode="mobile"] .sessionline b {display:none}
}
@media (orientation:portrait) and (max-width:372px) {
  html[data-ui-mode="mobile"] #pocket {grid-template-columns:repeat(6,minmax(0,1fr))}
}
