
.gg-app, .gg-app * { box-sizing: border-box; }
.gg-app { --gg-cut: 8px; --gs-ink: #f1f5f9; --gs-muted: #94a3b8; --gs-line: #2f2a45; --gs-accent: #facc15; --gs-accent-ink: #1a1400;
  --gs-panel: #0f0d19; --gs-bg: #07070c; --gs-chip: rgba(20, 17, 34, .92);
  position: relative; display: flex; flex-direction: column; color: #f1f5f9; font: 16px/1.45 "Segoe UI", system-ui, Arial, sans-serif;
  overflow: clip; -webkit-tap-highlight-color: transparent; }
.gg-app.gg-embedded { height: clamp(500px, calc(100svh - 110px), 920px); border: 1px solid #2f2a45; background: #07070c;
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px); }
.gg-app.gs-fs { background: #07070c; }
.gg-app .gs-stage, .gg-app .gs-main { min-height: 0; }
.gg-app.gs-wide .gs-stage { align-items: stretch; grid-template-rows: minmax(0, 1fr); }
.gg-app .gs-side { min-height: 0; overflow: auto; }
.gg-app .gs-main { display: flex; flex-direction: column; }
.gg-body { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 0 10px calc(8px + env(safe-area-inset-bottom, 0px)); }
.gg-app .gg-stage, .gg-app .gg-go, .gg-app .gg-ghost, .gg-app .gg-opt, .gg-app .gg-tile, .gg-app .gg-bin, .gg-app .gg-zone,
.gg-app .gg-unit, .gg-app .gg-tag, .gg-app .gg-why, .gg-app .gg-stats span, .gg-app .gg-lv {
  clip-path: polygon(var(--gg-cut) 0, 100% 0, 100% calc(100% - var(--gg-cut)), calc(100% - var(--gg-cut)) 100%, 0 100%, 0 var(--gg-cut)); }
.gg-stage { position: relative; flex: 0 0 auto; height: 190px; overflow: hidden; background: #07070c; border: 1px solid #2f2a45; user-select: none; -webkit-user-select: none; }
.gg-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.gg-hud { position: absolute; left: 8px; right: 8px; top: 8px; z-index: 2; pointer-events: none; }
.gg-hud-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gg-tag { background: color-mix(in srgb, var(--z) 22%, #0b0a14); border: 1px solid var(--z); color: #fff; font: 700 12.5px system-ui, sans-serif; padding: 3px 9px; }
.gg-shape { font: 700 11px monospace; color: #cbd5e1; text-transform: uppercase; letter-spacing: .6px; text-shadow: 0 1px 4px #000; }
.gg-combo { margin-left: auto; font: 800 16px system-ui, sans-serif; color: #fdba74; text-shadow: 0 1px 6px #000; }
.gg-combo.hot { color: #facc15; text-shadow: 0 0 12px rgba(250, 204, 21, .8); }
.gg-pips { display: flex; gap: 4px; margin-top: 6px; }
.gg-pip { flex: 1 1 0; max-width: 34px; height: 6px; background: rgba(148, 163, 184, .25); }
.gg-pip.now { background: #e2e8f0; }
.gg-pip.ok { background: #4ade80; }
.gg-pip.no { background: #f87171; }
.gg-pip.sp { outline: 1px dashed #facc15; outline-offset: 1px; }
.gg-card { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 2px 2px 4px; }
.gg-ask { margin: 4px 0 6px; font: 600 13.5px system-ui, sans-serif; color: #a5b4cf; }
.gg-sent { margin: 0 0 8px; font: 600 21px/1.5 Georgia, "Times New Roman", serif; color: #f8fafc; }
.gg-src { font-size: 18px; color: #cbd5e1; border-left: 3px solid #facc15; padding-left: 10px; }
.gg-cue { font: 600 15px system-ui, sans-serif; color: #fde68a; }
.gg-gap { display: inline-block; min-width: 54px; padding: 0 6px; border-bottom: 3px solid #facc15; color: #facc15; text-align: center; }
.gg-gap.ok { color: #4ade80; border-color: #4ade80; }
.gg-gap.fix { color: #fbbf24; border-color: #fbbf24; }
.gg-line { display: inline-flex; flex-wrap: wrap; gap: 5px; vertical-align: middle; min-height: 40px; align-items: center; }
.gg-line-full { display: flex; min-height: 48px; padding: 4px; border: 1px dashed #3f3a5c; }
.gg-tokens { line-height: 2.1; }
.gg-tok { font: inherit; color: inherit; background: transparent; border: 1px solid transparent; border-bottom: 2px dotted rgba(148, 163, 184, .35); padding: 0 4px; margin: 0 -1px; cursor: pointer; min-height: 40px; }
.gg-tok:hover:not(:disabled) { border-color: #64748b; }
.gg-tok.sel { border-color: #facc15; background: rgba(250, 204, 21, .15); }
.gg-tok.bad { background: rgba(248, 113, 113, .25); border-color: #f87171; color: #fecaca; }
.gg-tok.no { border-color: #64748b; }
.gg-tok:disabled { cursor: default; }
.gg-why { margin-top: 6px; padding: 10px 12px; font-size: 14.5px; background: rgba(30, 27, 48, .9); border: 1px solid #2f2a45; display: none; }
.gg-why.ok, .gg-why.no { display: block; }
.gg-why.ok { border-color: #22c55e; }
.gg-why.ok b { color: #4ade80; }
.gg-why.no { border-color: #f87171; }
.gg-why.no b { color: #fca5a5; }
.gg-why p { margin: 6px 0 0; color: #dbe4f0; }
.gg-corr { display: block; margin-top: 4px; font: 600 17px Georgia, serif; color: #bbf7d0; }
.gg-lvup { color: #facc15 !important; font-weight: 800; }
.gg-note { color: #94a3b8; font-size: 13px; margin: 6px 0; }
.gg-dock { flex: 0 0 auto; max-height: 56%; overflow-y: auto; }
.gg-answer { display: flex; flex-direction: column; gap: 8px; }
.gg-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gg-opts.gg-long { grid-template-columns: 1fr; }
.gg-opt { position: relative; min-height: 50px; padding: 8px 12px 8px 30px; text-align: left; background: #17142a; color: #f1f5f9; border: 1px solid #3a3456;
  font: 600 16.5px system-ui, sans-serif; cursor: pointer; }
.gg-long .gg-opt { font: 500 15.5px/1.35 Georgia, serif; }
.gg-opt small { position: absolute; left: 10px; top: 9px; font: 700 11px monospace; color: #64748b; }
.gg-opt:hover:not(:disabled) { border-color: #facc15; }
.gg-opt.picked { border-color: #facc15; }
.gg-opt.ok { background: rgba(34, 197, 94, .22); border-color: #22c55e; }
.gg-opt.no { background: rgba(239, 68, 68, .22); border-color: #ef4444; }
.gg-opt:disabled { cursor: default; }
.gg-fix .gg-note { margin: 0 0 6px; }
.gg-tiles { display: flex; flex-wrap: wrap; gap: 8px; }
.gg-tile { min-height: 44px; padding: 6px 12px; background: #1d1934; color: #f8fafc; border: 1px solid #4b4470; font: 600 16px system-ui, sans-serif; cursor: pointer; }
.gg-tile:disabled { opacity: .3; cursor: default; }
.gg-tile.in { background: #2a2350; border-color: #facc15; opacity: 1; min-height: 38px; }
.gg-tile.ok { border-color: #22c55e; background: rgba(34, 197, 94, .2); }
.gg-tile.fix { border-color: #fbbf24; background: rgba(251, 191, 36, .16); }
.gg-sort { display: flex; flex-direction: column; gap: 6px; }
.gg-sort-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; align-items: center; }
.gg-sort-w { font: 600 17px Georgia, serif; overflow-wrap: anywhere; }
.gg-bin { min-height: 42px; min-width: 64px; padding: 4px 10px; background: #17142a; color: #cbd5e1; border: 1px solid #3a3456; font: 700 13px system-ui, sans-serif; cursor: pointer; }
.gg-bin.sel { border-color: #facc15; color: #fff; background: rgba(250, 204, 21, .14); }
.gg-bin.ok { border-color: #22c55e; background: rgba(34, 197, 94, .22); color: #fff; }
.gg-bin.no { border-color: #ef4444; background: rgba(239, 68, 68, .22); }
.gg-row { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.gg-go { min-height: 48px; padding: 0 22px; border: 0; background: linear-gradient(180deg, #facc15, #eab308); color: #1a1400; font: 800 15.5px system-ui, sans-serif; cursor: pointer; }
.gg-go:disabled { opacity: .4; cursor: default; }
.gg-go.gg-alt { background: #1d1934; color: #f8fafc; border: 1px solid #4b4470; }
.gg-go.gg-small { min-height: 40px; padding: 0 12px; font-size: 13px; margin-left: auto; }
.gg-go small { display: block; font: 600 11px system-ui, sans-serif; color: #fde68a; }
.gg-ghost { min-height: 48px; padding: 0 16px; background: transparent; color: #cbd5e1; border: 1px solid #3a3456; font: 700 14px system-ui, sans-serif; cursor: pointer; }
.gg-msg { min-height: 18px; font-size: 13px; color: #cbd5e1; margin-top: 4px; }
.gg-msg .bad { color: #fca5a5; }
.gg-floor-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 2px 0 8px; }
.gg-floor-head b { font-size: 18px; }
.gg-floor-head span { font: 700 11px monospace; color: #a5b4cf; letter-spacing: .4px; }
.gg-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.gg-quick .gg-go:first-child:not(.gg-alt) { grid-column: 1 / -1; }
.gg-zones { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.gg-zone { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: left; min-height: 64px;
  padding: 8px 10px; background: linear-gradient(135deg, color-mix(in srgb, var(--z) 20%, #12101f), #12101f 70%); border: 1px solid color-mix(in srgb, var(--z) 55%, #2f2a45);
  color: #f8fafc; cursor: pointer; font-family: inherit; }
.gg-zone:hover { border-color: var(--z); }
.gg-zone-i { grid-row: 1 / 3; font-size: 24px; }
.gg-zone-t { font: 700 14.5px system-ui, sans-serif; }
.gg-zone-m { font: 600 11.5px system-ui, sans-serif; color: #94a3b8; }
.gg-zone-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.gg-zone-head b { color: var(--z); font-size: 16px; }
.gg-zone-head .gg-ghost { min-height: 40px; padding: 0 10px; }
.gg-units { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.gg-unit { position: relative; display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 9px 11px 12px; background: #12101f;
  border: 1px solid #2f2a45; border-left: 3px solid var(--z); color: #f8fafc; cursor: pointer; font-family: inherit; min-height: 64px; }
.gg-unit:hover:not(:disabled) { border-color: var(--z); }
.gg-unit:disabled { opacity: .5; cursor: default; }
.gg-unit-t { font: 700 15px system-ui, sans-serif; }
.gg-unit-l { font: 500 12.5px system-ui, sans-serif; color: #a5b4cf; }
.gg-unit-m { display: flex; gap: 8px; align-items: center; margin-top: 3px; font: 600 11px system-ui, sans-serif; color: #94a3b8; }
.gg-unit-m i { font-style: normal; }
.gg-lv { color: #0b0a14 !important; padding: 1px 6px; font-weight: 800 !important; }
.gg-unit-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(148, 163, 184, .15); }
.gg-unit-bar i { display: block; height: 100%; background: var(--z); }
.gg-end { text-align: center; padding: 8px 0; }
.gg-end-big { font: 800 26px system-ui, sans-serif; color: #fef3c7; margin: 6px 0 10px; }
.gg-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0; }
.gg-stats span { background: rgba(255, 255, 255, .05); padding: 6px 4px; font-size: 11.5px; color: #94a3b8; }
.gg-stats b { display: block; font: bold 20px monospace; color: #fde68a; }
.gg-sp { font: 800 20px system-ui, sans-serif; color: #facc15; margin: 8px 0; }
.gg-end-units { display: flex; flex-direction: column; gap: 6px; margin: 12px auto 4px; max-width: 460px; text-align: left; }
.gg-end-unit { position: relative; display: flex; align-items: center; gap: 8px; padding: 8px 10px 11px; background: #12101f; border-left: 3px solid var(--z); font: 600 14px system-ui, sans-serif; }
.gg-end-unit span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gg-end-unit .gg-lv { font: 800 11px system-ui, sans-serif; font-style: normal; }
@media (min-width: 700px) {
  .gg-stage { height: 230px; }
  .gg-sent { font-size: 24px; }
  .gg-body { padding: 0 14px 10px; }
}
@media (max-width: 420px) {
  .gg-stage { height: 150px; }
  .gg-stage.gg-3d { height: 185px; }   
  .gg-sent { font-size: 19px; }
  .gg-opt { font-size: 15.5px; }
  .gg-quick { grid-template-columns: 1fr; }
}
.gg-app .gg-card { display: flex; flex-direction: column; }
.gg-app .gg-card::before, .gg-app .gg-card::after { content: ''; flex: 1 1 0; min-height: 0; }
@media (max-width: 420px) and (min-height: 700px) {   
  .gg-app .gg-stage { height: clamp(150px, 30svh, 280px); }
  .gg-app .gg-stage.gg-3d { height: clamp(185px, 32svh, 300px); }
}
