/* Direction A — "Ngọc & Thạch" skin. Loaded AFTER hi3d-a.css; changes look only, never layout/behaviour.
   Everything here is image-based chrome taken from the approved mobile kit (tools/build-web-a-skin-assets.py):
   gold-chased frames with a marble fill, bevelled tiles, thick gold icons, moonlit scenery. */
@font-face{font-family:'Lora';src:url(assets/fonts/lora.ttf) format('truetype');font-weight:400 700;font-display:swap}
:root{
  --a-gold-grad:linear-gradient(180deg,#fbeab4 0%,#e3c273 48%,#b88b3c 100%);
  --a-frame-panel:url(assets/ui/frame-panel.webp);--a-frame-tile:url(assets/ui/frame-tile.webp);
  --a-frame-primary:url(assets/ui/frame-primary.webp);--a-frame-red:url(assets/ui/frame-red.webp);
  --a-scene:url(assets/approved/kylam-scene-wide.webp);--a-marble:url(assets/ui/marble-dark.webp);
  --a-ink:#f2e9d0;--a-muted:#c2b896;
}
body{background:#050b09 var(--a-scene) center top/cover no-repeat}
/* ---- gold display type ---- */
.a-gold-text,.a-home h1,.a-brand b,.a-dialog h2,.a-help-body h3,#loading .loading-card h2,.a-vs b{
  background:var(--a-gold-grad);-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent;
  text-shadow:none;filter:drop-shadow(0 2px 0 #3a2a0c) drop-shadow(0 0 10px #d8a64a40)}
.a-home h1{font-weight:700;letter-spacing:.05em}
/* ---- icons: thick, gold ---- */
.a-ic{-webkit-mask-image:url(assets/ui/a-icons-bold.png);mask-image:url(assets/ui/a-icons-bold.png);
  background:var(--a-gold-grad);color:inherit;filter:drop-shadow(0 1px 0 #2a1d08) drop-shadow(0 0 5px #d8a64a55)}
.a-nav button:not([aria-current=page]) .a-ic,.a-tabbar button:not([aria-current=page]) .a-ic{background:linear-gradient(180deg,#e9e0c6,#a99f82);filter:drop-shadow(0 1px 0 #0008)}
/* ---- ornate surfaces: gold-chased marble frame ---- */
.a-panel,.a-dialog,#help-dialog,#settings-dialog,.opening-dialog,.opening-form-dialog,.opening-suggestions-dialog,#side-dialog,#loading .loading-card{
  background:#06100c var(--a-marble) center/cover padding-box!important;border:24px solid transparent!important;border-radius:0!important;
  border-image:var(--a-frame-panel) 72/24px/0 stretch!important;box-shadow:none!important;
  filter:drop-shadow(0 18px 36px #000c)}
.a-home{padding:10px 14px}.a-side{padding:6px 10px}.a-dialog{padding:12px 18px}
dialog::backdrop{background:linear-gradient(#050b09b8,#050b09d8),var(--a-scene) center/cover!important}
/* ---- header ---- */
.a-header{--a-header-h:76px;height:calc(var(--a-header-h) + var(--a-safe-t))!important;
  background:linear-gradient(90deg,#050b09f5 0%,#050b09b0 40%,#050b0966 100%),var(--a-scene) 50% 6%/cover!important;
  border-bottom:0!important;box-shadow:0 6px 18px #000a}
.a-header::after{content:'';position:absolute;left:0;right:0;bottom:-3px;height:6px;pointer-events:none;
  background:linear-gradient(180deg,#f7e4a8,#b88b3c 45%,#4c3711 55%,#d9b565 80%,#6b4e1b)}
.a-brand img{width:78px;height:64px;object-fit:contain;filter:drop-shadow(0 2px 6px #000a)}
.a-brand b{font-size:32px;letter-spacing:.08em;font-weight:700}.a-brand small{font-size:14px;color:var(--a-ink)}
.a-nav button{font-size:17px;font-weight:500;color:#d8cfb0;min-width:170px}
.a-nav button+button::before{content:'';position:absolute;left:0;top:24%;height:52%;width:1px;background:linear-gradient(180deg,transparent,#c8a962,transparent)}
.a-nav button .a-ic{width:38px;height:38px}
.a-nav button[aria-current=page]{color:var(--a-gold-hi)}
.a-nav button[aria-current=page]::after{left:18px;right:18px;bottom:6px;height:4px;border-radius:2px;background:var(--a-gold-grad);box-shadow:0 0 12px #f0c86a}
.a-header-tools .a-ic{width:40px;height:40px}
.a-header-tools button{width:56px;height:56px}
.a-tabbar{background:linear-gradient(180deg,#0a1511f6,#050b09fa)!important;border-top:3px solid #a88c52!important;box-shadow:0 -6px 18px #000a}
/* ---- buttons ---- */
.a-btn{border:12px solid transparent;border-image:var(--a-frame-tile) 24 fill/12px/0 stretch;border-radius:0;background:none;
  color:var(--a-ink);font-weight:500;padding:0 8px;min-height:60px;filter:drop-shadow(0 3px 5px #0009);transition:filter .15s,transform .05s}
.a-btn:hover:not(:disabled){background:none;filter:drop-shadow(0 3px 5px #0009) brightness(1.18) drop-shadow(0 0 8px #e3c27388)}
.a-btn:active:not(:disabled){transform:translateY(1px);filter:brightness(.92)}
.a-btn:disabled{opacity:.55}
.a-primary,.a-home .a-primary{border:0;border-image:var(--a-frame-primary) 120 240 fill/32px 60px/0 stretch;background:none;min-height:104px;padding:0 26px}
.a-primary:hover:not(:disabled){background:none}
.a-primary .a-label,.a-primary span:not(.a-discs):not(.a-chev):not(.a-ic){background:var(--a-gold-grad);-webkit-background-clip:text;background-clip:text;color:transparent;font-weight:700;letter-spacing:.02em}
.a-home .a-primary .a-label{font-size:clamp(22px,2vw,30px)}
.a-primary .a-chev{color:var(--a-gold-hi);font-size:36px;text-shadow:0 2px 0 #000a}
.a-chev{color:var(--a-gold);font-size:34px}
.a-stack b{font-weight:600;font-size:19px;color:var(--a-ink)}.a-stack small{color:var(--a-muted);font-size:13.5px}
.a-row{min-height:76px}.a-row .a-ic{width:44px;height:44px}
.a-card{min-height:132px}.a-card img{width:104px;height:104px}
.a-tile{min-height:104px;font-size:15px;gap:6px}.a-tile .a-ic{width:46px;height:46px}
.a-ghost{border:0;border-image:none;border-top:2px solid var(--a-line-soft);filter:none;background:none}
.a-disc,.a-discs i{width:52px;height:52px;font-size:28px;border:2px solid #d8b762;box-shadow:inset 0 0 0 3px #e9dcb4,0 2px 5px #000a}
.a-disc.red,.a-discs i.red{color:#c32a20}
.a-discs i:first-child{background:radial-gradient(circle at 35% 30%,#2d3a33,#0e1613);color:#e5d8ae;border-color:#c9a24f}
/* ---- play side panel ---- */
.a-side{gap:6px}
.a-player{border:22px solid transparent;border-image:var(--a-frame-panel) 72 fill/18px/0 stretch;border-radius:0;background:none;padding:0 6px;min-height:104px;margin:-6px -6px;filter:drop-shadow(0 4px 6px #0009)}
.a-player.a-me{border-image-source:var(--a-frame-red);border-image-slice:110 120;border-image-width:20px 24px;border-width:20px 24px}
.a-player.a-me[data-active=true][data-red=false]{border-image-source:var(--a-frame-panel);border-image-slice:72;border-image-width:18px;border-width:22px}
.a-player[data-active=true],.a-player.a-me[data-active=true]{background:none;border-width:22px}
.a-player.a-me[data-active=true][data-red=true]{background:none;border-width:20px 24px}
.a-avatar:not(.a-disc){width:78px;height:78px;border:0;background:url(assets/ui/medallion.webp) center/contain no-repeat;border-radius:0;filter:drop-shadow(0 2px 4px #000a)}
.a-avatar:not(.a-disc) img{opacity:0}
.a-me .a-disc{width:70px;height:70px;font-size:40px;border:4px solid #e0bd68;box-shadow:inset 0 0 0 4px #efe3bf,0 0 14px #ff4a2c66,0 3px 6px #000b}
.a-player .a-stack b{font-size:21px;letter-spacing:.03em;text-transform:uppercase}
.a-clock{min-width:128px;padding:6px 10px;border:2px solid #b8924a;border-radius:6px;background:linear-gradient(180deg,#050b09,#0b1612);
  box-shadow:inset 0 0 0 2px #050b09,inset 0 0 0 3px #6d5527,0 0 12px #0008;font:700 34px 'Lora',Georgia,serif;letter-spacing:.02em;color:#fff4d8;text-shadow:0 0 10px #f5d27a66}
.a-me[data-red=true] .a-clock,.a-me[data-active=true] .a-clock{color:#ffb083;text-shadow:0 0 12px #ff5a2cb0}
.a-turn{border:2px solid #b8924a;background:linear-gradient(180deg,#0b1612,#050b09);padding:7px 30px;font-weight:600;letter-spacing:.1em;box-shadow:0 2px 6px #000a,inset 0 0 0 2px #050b09}
.a-turn i{width:13px;height:13px;box-shadow:0 0 10px 2px #ff4a2c}.a-turn[data-turn=b] i{box-shadow:0 0 10px 2px #7fc4a2}
.a-history{border:20px solid transparent;border-image:var(--a-frame-panel) 72/18px/0 stretch;border-radius:0;background:#06100c var(--a-marble) center/cover padding-box;padding:0;margin:-4px -6px}
.a-history summary{border-bottom:2px solid #7a6030;font-size:22px;color:var(--a-ink)}.a-history summary .a-ic{width:34px;height:34px}
.a-history ol{font-size:15px;color:var(--a-ink)}
.a-history p{color:#8f8a78;font-size:16px}
.a-history p::before{content:'';display:block;width:56px;height:56px;margin:0 auto 6px;opacity:.55;background:var(--a-gold-grad);
  -webkit-mask:url(assets/ui/a-icons-bold.png) calc(1*100%/7) calc(2*100%/4)/800% 500% no-repeat;mask:url(assets/ui/a-icons-bold.png) calc(1*100%/7) calc(2*100%/4)/800% 500% no-repeat}
.a-tools{gap:6px}
.a-tools .a-btn{flex-direction:column;gap:2px;min-height:92px;font-size:16px}.a-tools .a-ic{width:44px;height:44px}
.a-wide{min-height:84px;border-width:0;border-image:var(--a-frame-primary) 120 240 fill/28px 56px/0 stretch}
.a-wide .a-ic{width:40px;height:40px}
.a-wide span:last-child{background:var(--a-gold-grad);-webkit-background-clip:text;background-clip:text;color:transparent;font:700 24px 'Lora',Georgia,serif}
/* board view bar */
.a-viewbar{background:none;border:20px solid transparent;border-image:var(--a-frame-panel) 72 fill/18px/0 stretch;border-radius:0;padding:2px 14px;bottom:10px;filter:drop-shadow(0 4px 8px #000a);color:var(--a-ink)}
.a-viewbar button{border:1.5px solid #8b6f35;background:linear-gradient(180deg,#0c1814,#050b09);font-size:14px}
.a-viewbar button[aria-pressed=true]{background:var(--a-gold-grad);color:#241a07;font-weight:700;border-color:#f3dd9b;box-shadow:0 0 12px #e3c27388}
/* ---- dialogs / segmented ---- */
.a-seg,.a-stepper,.a-side-cards button{border-color:#a88c52}
.a-seg button[aria-checked=true],.a-side-cards button[aria-checked=true]{background:linear-gradient(180deg,#244a3c,#12291f);box-shadow:inset 0 0 0 2px var(--a-gold),0 0 12px #e3c27344}
.a-help-list button{border-color:#7a6030;background:linear-gradient(180deg,#0c1814,#07110e)}.a-help-list button[aria-current=true]{background:linear-gradient(180deg,#3d3318,#241d0c)}
.a-help-body,.a-switch,.a-info{border-color:#7a6030;background:linear-gradient(180deg,#0c1814e8,#07110ef0)}
.a-switch input:checked{background:var(--a-gold-grad)}
.a-header-tools button:hover{background:#e3c27333}
/* mobile (<1024): same chrome, smaller metrics */
@media (max-width:1023.98px){
  .a-header{--a-header-h:60px}.a-brand img{width:44px;height:44px}.a-brand b{font-size:24px}
  .a-nav button{min-width:0}.a-header-tools .a-ic{width:34px;height:34px}.a-header-tools button{width:48px;height:48px}
  .a-panel,.a-dialog{border-width:18px!important;border-image-width:18px!important}
  .a-home{padding:4px 8px}.a-btn{border-width:10px;border-image-width:10px;min-height:52px}
  .a-primary{min-height:76px;border-image-width:26px 48px}.a-home .a-primary .a-label{font-size:21px}
  .a-row{min-height:60px}.a-row .a-ic{width:34px;height:34px}.a-card{min-height:88px}.a-card img{width:64px;height:64px}.a-tile{min-height:60px}.a-tile .a-ic{width:30px;height:30px}
  .a-player{min-height:64px;border-width:16px;border-image-width:14px;margin:-4px -6px;padding:0 2px}
  .a-player.a-me{border-width:14px 18px;border-image-width:14px 18px}
  .a-avatar{width:48px;height:48px}.a-me .a-disc{width:46px;height:46px;font-size:26px}.a-player .a-stack b{font-size:15px}
  .a-clock{min-width:74px;font-size:21px;padding:3px 6px}
  .a-history{border-width:14px;border-image-width:14px;margin:-4px -4px}.a-history summary{font-size:16px}.a-history summary .a-ic{width:24px;height:24px}
  .a-history p::before{display:none}
  .a-tools .a-btn{min-height:60px;font-size:12px}.a-tools .a-ic{width:30px;height:30px}
  .a-wide{min-height:60px;border-image-width:20px 40px}.a-wide span:last-child{font-size:18px}.a-wide .a-ic{width:28px;height:28px}
  .a-tabbar .a-ic{width:34px;height:34px}
}
@media (min-width:1024px) and (max-width:1279.98px){.a-brand small{display:none}.a-nav button{min-width:130px}.a-tools .a-btn{min-height:76px}.a-player{min-height:88px}.a-clock{font-size:28px;min-width:104px}}

.a-tools #a-pause{grid-column:auto}.a-tools #a-menu{display:flex}
@media (min-width:1024px){.a-tools{grid-template-columns:1fr 1fr}}
@media (min-width:1024px){
  .a-home{gap:16px}.a-home .a-primary{padding:0 64px 0 58px}.a-home .a-primary .a-chev{margin-right:-6px}
  .a-card{min-height:168px}.a-card img{width:132px;height:132px}.a-card .a-stack b{font-size:23px;font-family:'Lora',Georgia,serif}
  .a-tile{min-height:132px;font-size:16px}.a-tile .a-ic{width:58px;height:58px}
  .a-row{min-height:88px}.a-row .a-stack b{font-size:22px;font-family:'Lora',Georgia,serif}
}
@media (max-width:1023.98px){
  :root{--a-sheet-h:min(46dvh,372px)}
  .a-side{padding:8px 8px calc(8px + var(--a-safe-b));gap:4px;border-width:16px!important;border-image-width:16px!important}
  .a-player,.a-player.a-me{margin:0;min-width:0;min-height:62px;border-width:13px 16px;border-image-width:13px 16px;gap:6px;padding:0}
  .a-player .a-stack{min-width:0}.a-player .a-stack b{font-size:14px;white-space:nowrap}.a-player .a-stack small{font-size:11px;white-space:nowrap}
  .a-avatar:not(.a-disc){width:44px;height:44px}.a-me .a-disc{width:40px;height:40px;font-size:23px;border-width:3px}
  .a-clock{min-width:0;margin-left:auto;font-size:18px;padding:2px 6px}
  .a-turn{padding:3px 22px;font-size:12px}
  .a-history{margin:0;border-width:12px;border-image-width:12px;max-height:62px;min-height:44px}.a-history summary{display:none}.a-history ol{padding-block:2px;font-size:12.5px;line-height:1.5}.a-history p{font-size:13px;padding:6px}
  .a-tools .a-btn{min-height:58px;border-width:9px;border-image-width:9px}.a-tools .a-ic{width:28px;height:28px}
  .a-wide{min-height:52px;border-image-width:18px 38px}
  .a-home .a-primary .a-label{font-size:19px;white-space:nowrap}.a-home .a-primary{padding:0 30px 0 22px}.a-discs i{width:34px;height:34px;font-size:18px}
}
@media (max-width:1023.98px){
  .a-me .a-clock{font-size:15px;padding:1px 4px}.a-player .a-stack b{font-size:13px}
}
.a-actions .a-primary{min-height:68px;white-space:nowrap;border-image-width:24px 44px;padding:0 20px}
.a-actions .a-primary span{font-size:18px}
.a-vs img{border:0;background:none;padding:0;object-fit:contain;width:84px;height:84px;border-radius:0}
#settings-dialog h2,#help-dialog h2,.opening-dialog h2,.opening-form-dialog h2,.opening-suggestions-dialog h2,#side-dialog h2{
  background:var(--a-gold-grad);-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent;font-family:'Lora',Georgia,serif;font-weight:700;filter:drop-shadow(0 2px 0 #3a2a0c)}
.dialog-close{border:2px solid #b8924a!important;border-radius:50%!important;background:linear-gradient(180deg,#12261e,#07110d)!important;color:#f0d99c!important;width:44px;height:44px;box-shadow:0 2px 6px #000a}
.dialog-close:hover{filter:brightness(1.25)}
.a-primary{color:#f2dc9b}
#settings-dialog h3,#settings-dialog legend{color:#f0d99c;font-family:'Lora',Georgia,serif}
.a-primary .a-label{white-space:nowrap}
@media (min-width:1024px){.a-home .a-primary{padding:0 56px 0 52px}.a-home .a-primary .a-label{font-size:clamp(20px,1.75vw,27px)}}
@media (max-width:1023.98px){
  :root{--a-sheet-h:min(50dvh,310px)}
  body[data-screen=play] .a-side{height:auto;max-height:var(--a-sheet-h);padding:6px;gap:4px;border-width:8px!important;border-image-width:8px!important}
  .a-history{min-height:0;max-height:128px;border-width:4px;border-image-width:4px}
  .a-history summary{display:flex;align-items:center;gap:6px;min-height:44px;padding:2px 6px;font-size:12px;line-height:1.2;border:0}
  .a-history summary .a-ic{width:20px;height:20px}
  .a-history:not([open]){max-height:54px}
  .a-history ol{max-height:84px;overflow:auto}
  .a-tools .a-btn{min-height:48px;border-width:6px;border-image-width:6px}
  .a-wide{min-height:48px;border-image-width:14px 32px}
}
@media (max-width:1023.98px){
  .a-player,.a-player.a-me{display:grid;grid-template-columns:34px minmax(0,1fr);gap:4px 6px;min-height:88px;border-width:10px;border-image-width:10px}
  .a-player .a-stack{overflow:hidden}
  .a-player .a-stack b,.a-player .a-stack small{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .a-avatar:not(.a-disc),.a-me .a-disc{width:34px;height:34px;font-size:20px;border-width:2px}
  .a-player .a-clock,.a-me .a-clock{grid-column:1/-1;justify-self:stretch;min-width:0;max-width:none;margin:0;font-size:20px;line-height:1.2;padding:2px 6px;letter-spacing:0;font-variant-numeric:tabular-nums;white-space:nowrap}
}
