/* Approved score-panel restoration: shared self-hosted faces, four fixed seats. */
@font-face { font-family:"Score Names"; src:url('/assets/fonts/smiley-sans.woff2') format('woff2'); font-style:normal; font-weight:400; font-display:swap; }
@font-face { font-family:"Score Digits"; src:url('/assets/fonts/barlow-blackitalic.ttf') format('truetype'); font-style:italic; font-weight:900; font-display:swap; }
.client-tv { --tv-bar:clamp(64px,10vh,110px); --tv-heading:48px; --tv-caption:clamp(15px,1.25vw,23px); --tv-name:clamp(20px,2vw,34px); --tv-gap:clamp(12px,1.3vw,24px); --muted:#d6e9e1; --line:#799b8a; --score-board-height:calc(100vh - var(--tv-bar) - 140px); padding-top:0; position:relative; isolation:isolate; color:#fff; }
.client-tv::before { content:""; position:fixed; inset:0; z-index:-2; pointer-events:none; background:#102921 url('/assets/mahjong-table.jpg') center / cover no-repeat; }
.client-tv[data-screen=home]::before,.client-tv[data-screen=activation]::before { background:#211129 url('/assets/mahjong-home.jpg') center / cover no-repeat; }
.client-tv::after { content:""; position:fixed; inset:0; z-index:-1; pointer-events:none; background:#031a122b; }
.client-tv[data-screen=home]::after { background:none; }
.client-tv[data-brightness=dim]::after { background:#030f1266; }
.client-tv[data-brightness=light] { color:var(--ink); --muted:#53657a; --line:#bacbd3; }
.client-tv[data-brightness=light]::before { background:#fff; }
.client-tv[data-brightness=light]::after { background:none; }
.tv-title { display:flex; align-items:center; justify-content:center; min-height:var(--tv-bar); max-width:88%; margin:0 auto; padding:10px 0; font:700 clamp(25px,3.3vw,56px)/1.2 "Microsoft YaHei",sans-serif; text-align:center; overflow-wrap:anywhere; text-shadow:0 3px 5px #07120c; }
.client-tv[data-screen=home] .tv-title { color:#fff0c3; }
.client-tv[data-brightness=light] .tv-title { color:var(--ink); text-shadow:none; }
.client-tv .tv-stage { width:94%; max-width:2100px; text-shadow:0 2px 3px #06120ec4; }
.client-tv[data-screen=score] { height:100vh; display:flex; flex-direction:column; }
.client-tv[data-screen=score] .tv-title { flex:0 0 auto; }
.client-tv[data-screen=score] .tv-stage { flex:1; min-height:0; margin:0 auto; display:flex; flex-direction:column; }
.client-tv #tvScoreView:not([hidden]) { flex:1; min-height:0; display:grid; grid-template-rows:auto minmax(360px,1fr) auto; }
.client-tv #tvScoreView .compass-board { height:100%; min-height:0; max-height:none; }
.client-tv .toast { left:3%; right:auto; max-width:min(460px,55%); border-left-width:1px; }
.client-tv .tv-home { min-height:calc(100vh - var(--tv-bar)); padding:0 0 5vh; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:22px; }
.client-tv .home-menu { width:auto; display:flex; align-items:center; justify-content:center; gap:clamp(44px,8vw,160px); }
.client-tv .home-module { width:clamp(150px,16vw,250px); height:auto; min-height:0; aspect-ratio:803/1024; padding:22px; display:flex; justify-content:center; align-items:center; background:#f9e4b3 url('/assets/mahjong-tile.jpg') center / 100% 100% no-repeat; border:0; border-radius:12%; color:#a81117; box-shadow:none; text-shadow:0 1px 1px #fff9e0; }
.client-tv .home-module span { font:700 clamp(29px,3vw,50px)/1.3 "KaiTi","STKaiti","Microsoft YaHei",serif; writing-mode:vertical-rl; text-orientation:upright; letter-spacing:.13em; }
.client-tv .home-module:not(:disabled):hover { filter:brightness(1.06); background:#f9e4b3 url('/assets/mahjong-tile.jpg') center / 100% 100% no-repeat; }
.client-tv .home-module:focus-visible { outline:4px solid #fff2aa; outline-offset:7px; }
.client-tv .home-module:not(:disabled):active { filter:brightness(.88); background:#f9e4b3 url('/assets/mahjong-tile.jpg') center / 100% 100% no-repeat; }
.client-tv .home-module:disabled { opacity:.55; filter:saturate(.4); cursor:wait; }
.client-tv .tv-instruction { margin:0; color:#f8e8da; font-size:clamp(14px,1.25vw,21px); }
.client-tv[data-brightness=light] .tv-instruction { color:var(--muted); }
.client-tv[data-brightness=light] .home-module:focus-visible { outline-color:#966015; }
.client-tv .screen-heading,.client-tv .score-meta { min-height:48px; height:auto; padding:0 6px; margin:0 0 8px; background:none; }
.client-tv .screen-heading h1 { font-size:clamp(22px,2.3vw,38px); }
.client-tv .score-meta { gap:16px; }
.client-tv .score-meta > span:first-of-type { color:inherit; }
.score-tools { display:flex; align-items:center; gap:16px; margin-right:auto; }
.client-tv .score-tools .text-button { margin:0; }
.client-tv .tv-stage .text-button { color:#e5f6ef; padding:10px 12px; text-shadow:none; }
.client-tv .tv-stage .text-button:disabled { color:#a9c1b5; }
.client-tv[data-brightness=light] .tv-stage .text-button { color:var(--accent); }
.client-tv .compass-board { height:var(--score-board-height); min-height:410px; max-height:1000px; }
.client-tv #compassBoard { width:100%; margin:auto; }
.client-tv .compass-player { background:#082720dc; border:1px solid #84b69a; border-radius:12px; }
.client-tv .waiting-seat { padding:10px 16px; }
.client-tv .waiting-seat .equipment-wind,.client-tv .waiting-seat-name { color:inherit; }
.client-tv .waiting-center { background:none; color:inherit; }
.client-tv .waiting-center strong,.client-tv .equipment-seat-state.is-ready { color:#ffdf88; }
.client-tv .waiting-center p,.client-tv .preview-note,#waitingMode { color:var(--muted); }
.client-tv .equipment-statusbar { min-height:68px; margin-top:8px; padding:0 6px; border:0; }
.client-tv #compassBoard .compass-player {
  --seat-hue:#56f8ff; --seat-fill:#0ddcea; --seat-mid:#067ba9; --seat-dark:#04162e;
  position:relative; isolation:isolate; justify-self:center; width:calc(100% + clamp(24px,3.2vw,60px));
  display:grid; grid-template-columns:minmax(0,35%) minmax(0,1fr); grid-template-rows:minmax(0,1fr);
  gap:0; padding:12px 16px; overflow:hidden; border:0; border-radius:0;
  clip-path:polygon(3.5% 0,96.5% 0,100% 8.75%,100% 91.25%,96.5% 100%,3.5% 100%,0 91.25%,0 8.75%);
  background:linear-gradient(116deg,var(--seat-fill) 0%,var(--seat-mid) 33%,var(--seat-dark) 86%); color:#fff;
}
.client-tv #compassBoard .seat-E { justify-self:end; }
.client-tv #compassBoard .seat-W { justify-self:start; }
.client-tv #compassBoard .seat-N { --seat-hue:#65f68a; --seat-fill:#24d943; --seat-mid:#08773f; --seat-dark:#041e29; }
.client-tv #compassBoard .seat-W { --seat-hue:#ffdf60; --seat-fill:#ffbc19; --seat-mid:#8f6110; --seat-dark:#07192b; }
.client-tv #compassBoard .seat-S { --seat-hue:#ff4d85; --seat-fill:#d51849; --seat-mid:#641b42; --seat-dark:#09142f; }
.score-frame-art { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; z-index:-1; fill:none; stroke:var(--seat-hue); stroke-width:1.5; }
.score-frame-art .frame-etch { opacity:.55; stroke-width:1; }
.client-tv #compassBoard .compass-person { position:relative; grid-column:1; grid-row:1; display:flex; flex-direction:column; justify-content:center; align-items:center; gap:5px; min-width:0; padding:4px 10px 4px 0; border:0; border-right:1px solid #ffffff80; background:none; }
.client-tv #compassBoard .compass-person::after { content:""; position:absolute; right:-3px; top:39%; width:6px; height:25%; background:var(--seat-hue); clip-path:polygon(0 0,100% 18%,100% 82%,0 100%); }
.client-tv .compass-person .avatar { width:clamp(42px,7.5vh,84px); height:clamp(42px,7.5vh,84px); border:1px solid #d6f7ff; background:#234767; }
.client-tv .compass-identity { display:flex; flex-direction:column; align-items:center; gap:3px; min-width:0; max-width:100%; }
.client-tv .compass-name { color:#fff; font-family:"Score Names","Microsoft YaHei",sans-serif; font-size:clamp(25px,2.8vw,46px); font-weight:700; font-style:normal; line-height:1.08; text-align:center; overflow-wrap:anywhere; text-shadow:0 2px 2px #071326; }
.client-tv .long-name .compass-name { font-size:clamp(16px,1.45vw,27px); line-height:1.15; }
.client-tv #compassBoard .equipment-wind { grid-area:auto; font:400 clamp(12px,1.05vw,19px)/1.3 "Microsoft YaHei",sans-serif; color:#e4f1ed; max-width:100%; }
.client-tv #compassBoard .score-reading { grid-column:2; grid-row:1; display:flex; align-items:center; justify-content:center; padding:0 4px 0 12px; gap:0; min-width:0; }
.client-tv .compass-score { color:#fff; font-family:"Score Digits",sans-serif; font-size:clamp(46px,11.8vh,144px); font-weight:900; font-style:italic; font-synthesis:none; font-variant-numeric:lining-nums tabular-nums; line-height:1; letter-spacing:-.025em; text-shadow:1px 3px 2px #031020,2px 5px 5px #03102080; }
.client-tv .score-compact .compass-score { font-size:clamp(28px,7.2vh,86px); }
.client-tv .score-extra-compact .compass-score { font-size:clamp(14px,3.6vh,44px); }
.client-tv .dealer-center { grid-column:2; grid-row:2; width:100%; height:100%; min-height:0; padding:0; background:none; }
.client-tv .dealer-center::after { display:none; }
.dealer-orbit { position:relative; width:clamp(106px,18vh,208px); height:clamp(106px,18vh,208px); }
.dealer-ring { position:absolute; left:36%; top:36%; width:28%; height:28%; border:3px solid #dcefdc; border-radius:50%; }
.dealer-character { position:absolute; display:flex; align-items:center; justify-content:center; width:32%; height:32%; left:68%; top:34%; font-size:clamp(28px,5.3vh,64px); color:#ffe09a; font-family:"KaiTi","Microsoft YaHei",serif; }
[data-seat=N] .dealer-character { left:34%; top:0; }
[data-seat=W] .dealer-character { left:0; top:34%; }
[data-seat=S] .dealer-character { left:34%; top:68%; }
.client-tv .score-footer { display:flex; align-items:center; justify-content:space-between; min-height:76px; margin:0; padding:8px 6px 10px; border:0; gap:24px; }
.client-tv .score-bottom { gap:4px 16px; color:var(--muted); }
.dealer-notice { display:flex; flex-direction:column; align-items:flex-end; gap:4px; max-width:48%; padding:6px 12px; border-radius:8px; background:#06291de6; text-align:right; }
.dealer-notice span { color:#ffe09a; font-size:clamp(19px,2vw,34px); }
.dealer-notice strong { font-size:clamp(22px,2.4vw,42px); font-weight:700; line-height:1.2; overflow-wrap:anywhere; }
.client-tv[data-brightness=light] .tv-stage { text-shadow:none; }
.client-tv[data-brightness=light] .compass-player { background:#f3f6f9; color:var(--ink); }
.client-tv[data-brightness=light] .dealer-character,.client-tv[data-brightness=light] .dealer-notice span { color:#8b4c0c; }
.client-tv[data-brightness=light] .dealer-ring { border-color:#33714c; }
.client-tv[data-brightness=light] .dealer-notice { background:none; }
.client-tv[data-brightness=light] .waiting-center strong,.client-tv[data-brightness=light] .equipment-seat-state.is-ready { color:#176846; }
.client-tv .activation-screen { padding-top:3vh; }
.client-tv .activation-card { padding:24px 30px; background:var(--surface); border:1px solid var(--line); border-radius:16px; text-shadow:none; color:var(--ink); }
.client-tv .activation-card > .mode-icon { display:none; }
.client-tv dialog { text-shadow:none; }
.client-tv button,.client-tv select,.client-tv input,.client-tv .settings-form .check-label { min-height:48px; touch-action:manipulation; }
.client-tv .settings-form input[type=checkbox] { min-height:24px; width:24px; height:24px; }
.tv-connection-notice { position:fixed; z-index:15; bottom:12px; left:3%; max-width:94%; padding:12px 18px; background:var(--surface); border:1px solid var(--red); color:var(--red); font-size:16px; }
.client-tv[data-text-size=large] { --tv-name:clamp(23px,2.3vw,40px); --tv-caption:clamp(17px,1.45vw,25px); }
.client-tv[data-text-size=large] .compass-name { font-size:clamp(27px,3vw,50px); }
.client-tv[data-text-size=large] .long-name .compass-name { font-size:clamp(17px,1.55vw,29px); }
@media (max-width:800px) {
  .client-tv { --tv-bar:76px; --tv-name:16px; --tv-caption:13px; --tv-gap:8px; }
  .client-tv .tv-stage { width:96%; }
  .client-tv .tv-title { font-size:clamp(23px,5.5vw,36px); }
  .client-tv .screen-heading { flex-wrap:wrap; gap:8px; }
  .client-tv .score-meta { gap:4px; flex-wrap:wrap; }
  .score-tools { gap:0; }
  .client-tv .score-meta > span+span { padding-left:8px; }
  .client-tv .compass-board { height:calc(100vh - 232px); min-height:450px; }
  .client-tv #compassBoard .compass-player { width:100%; padding:6px 4px; grid-template-columns:minmax(0,40%) minmax(0,1fr); }
  .client-tv #compassBoard .compass-person { padding-right:4px; gap:6px; }
  .client-tv .compass-person .avatar { width:28px; height:28px; }
  .client-tv .compass-name,.client-tv .long-name .compass-name,.client-tv[data-text-size=large] .compass-name,.client-tv[data-text-size=large] .long-name .compass-name { font-size:clamp(11px,2.4vw,18px); }
  .client-tv #compassBoard .equipment-wind { font-size:11px; }
  .client-tv #compassBoard .score-reading { padding-left:3px; }
  .client-tv .compass-score { font-size:clamp(21px,5.8vw,43px); }
  .client-tv .score-compact .compass-score { font-size:clamp(12px,3.3vw,26px); }
  .client-tv .score-extra-compact .compass-score { font-size:clamp(7px,1.5vw,13px); }
  .dealer-orbit { width:90px; height:90px; }
  .dealer-character { font-size:28px; }
  .client-tv .score-footer { gap:12px; }
  .client-tv .score-bottom { max-width:48%; font-size:12px; }
  .dealer-notice span { font-size:17px; }
  .dealer-notice strong { font-size:20px; }
  .client-tv .waiting-seat { display:flex; flex-direction:column; padding:8px; gap:8px; }
  .client-tv .waiting-seat .equipment-wind { font-size:25px; }
  .client-tv .waiting-seat-name { margin:0; font-size:14px; white-space:normal; }
  .client-tv .equipment-seat-state { font-size:11px; }
  .client-tv .seat-qr { width:clamp(70px,16vw,128px); }
  .client-tv .waiting-seat .avatar { width:60px; height:60px; }
  .client-tv .waiting-center { padding:0; }
  .client-tv .waiting-center h2 { font-size:17px; }
  .client-tv .waiting-center > strong { font-size:14px; }
  .client-tv .waiting-center p { font-size:12px; }
  .client-tv .equipment-statusbar { flex-wrap:wrap; gap:8px; padding:10px 0; }
  .client-tv .home-menu { gap:8vw; }
  .client-tv .home-module { width:clamp(120px,29vw,210px); }
  .client-tv .home-module span { font-size:clamp(26px,5vw,37px); }
}
