@font-face { font-family: 'PS2P'; src: url('/assets/fonts/PressStart2P-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'VT'; src: url('/assets/fonts/VT323-Regular.ttf') format('truetype'); font-display: swap; }

:root {
  --bg: #0f0b09; --panel: #1b1511; --panel2: #251c16; --line: #6b4f2a; --line2: #3b2c1c;
  --text: #e9dfc9; --dim: #9a8a70; --gold: #f0c050; --red: #d9534f; --green: #6fd36f; --blue: #5aa7ff; --purple: #c77dff;
  --hp: #c8383a; --mp: #3b78d8; --xp: #c9a227;
  --px: 'PS2P', monospace; --body: 'VT', 'Courier New', monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 20px; overflow: hidden; -webkit-tap-highlight-color: transparent; }
body { background: radial-gradient(ellipse at 50% 0%, #2a1d12 0%, #0f0b09 60%); }
#app { height: 100%; position: relative; }
.hidden { display: none !important; }
canvas { image-rendering: pixelated; image-rendering: crisp-edges; }
button, input, select { font-family: var(--body); font-size: 20px; color: var(--text); }
input, select { background: #120d0a; border: 2px solid var(--line2); padding: 4px 8px; outline: none; min-width: 0; }
input:focus, select:focus { border-color: var(--gold); }
button { background: var(--panel2); border: 2px solid var(--line); padding: 4px 12px; cursor: pointer; box-shadow: inset 0 -3px 0 #0006; }
button:hover:not(:disabled) { background: #3a2b1d; border-color: var(--gold); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .4; cursor: not-allowed; }
button.primary { background: #7a4a14; border-color: var(--gold); font-family: var(--px); font-size: 12px; padding: 12px 18px; text-transform: uppercase; letter-spacing: 1px; }
button.primary:hover:not(:disabled) { background: #9a6020; }
.dim { color: var(--dim); } .small { font-size: 17px; } .err { color: var(--red); min-height: 1.2em; }
.good { color: var(--green); } .warn { color: #ffb347; } .gold { color: var(--gold); }

/* ---------- screens ---------- */
.screen { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 12px; overflow: auto; background: #000a; z-index: 30; }
#game.pre #hud, #game.pre #side { visibility: hidden; }
.auth-box, .create-box { background: var(--panel); border: 4px solid var(--line); box-shadow: 0 0 0 4px #000, 0 0 60px #000c, inset 0 0 0 2px #0008; padding: 22px 26px; width: min(440px, 100%); }
.logo { text-align: center; margin-bottom: 8px; }
.logo canvas { width: 64px; height: 64px; }
.logo h1 { font-family: var(--px); font-size: 30px; margin: 6px 0 4px; color: var(--gold); text-shadow: 3px 3px 0 #5a2a0a, 0 0 18px #f0c05055; letter-spacing: 3px; }
.logo .tag { font-family: var(--px); font-size: 11px; color: var(--red); letter-spacing: 8px; }
.lede { text-align: center; color: var(--dim); margin: 8px 0 14px; }
label { display: block; margin: 8px 0; color: var(--dim); }
label input { display: block; width: 100%; margin-top: 3px; color: var(--text); }
.seg { display: flex; margin: 6px 0 10px; }
.seg button { flex: 1; border-right-width: 0; }
.seg button:last-child { border-right-width: 2px; }
.seg button.on { background: #7a4a14; border-color: var(--gold); border-right-width: 2px; }
.seg button.on + button { border-left-width: 0; }
#auth-form .primary { width: 100%; margin-top: 8px; }
.foot { text-align: center; margin-top: 14px; font-size: 16px; }
.create-box { width: min(900px, 100%); }
.create-box h2 { font-family: var(--px); font-size: 16px; color: var(--gold); margin: 0 0 12px; }
.create-grid { display: grid; grid-template-columns: 220px 1fr; gap: 20px; }
.preview { text-align: center; background: #0b0806; border: 2px solid var(--line2); padding: 12px; align-self: start; }
.preview canvas { width: 160px; height: 160px; background: radial-gradient(circle, #3b5a2b 0, #1f3318 100%); border: 2px solid var(--line2); }
.pv-name { font-family: var(--px); font-size: 10px; margin: 8px 0; color: var(--gold); min-height: 1.2em; word-break: break-all; }
#pv-stats { text-align: left; font-size: 17px; color: var(--dim); }
#pv-stats b { color: var(--text); display: inline-block; width: 2.4em; text-align: right; margin-right: 6px; }
.lbl { color: var(--dim); font-size: 17px; margin-top: 6px; text-transform: uppercase; letter-spacing: 1px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chips button { padding: 2px 10px; }
.chips button.on { background: #7a4a14; border-color: var(--gold); }
#c-go { margin-top: 12px; width: 100%; }

/* ---------- game layout ---------- */
#game { position: absolute; inset: 0; display: flex; flex-direction: column; }
#hud { display: flex; align-items: center; gap: 16px; padding: 5px 10px; background: linear-gradient(#2a1d12, #1b1511); border-bottom: 3px solid var(--line); flex: 0 0 auto; flex-wrap: wrap; z-index: 5; }
#hud-id { display: flex; gap: 8px; align-items: center; min-width: 170px; }
#hud-face { width: 44px; height: 44px; background: radial-gradient(circle, #3b5a2b, #1f3318); border: 2px solid var(--line); }
#hud-name { font-family: var(--px); font-size: 11px; color: var(--gold); }
#hud-sub { font-size: 17px; color: var(--dim); }
#hud-bars { display: flex; flex-direction: column; gap: 3px; width: 240px; }
.bar { position: relative; height: 15px; background: #0a0706; border: 2px solid #000; box-shadow: 0 0 0 1px var(--line2); }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; transition: width .25s; }
.bar.hp i { background: linear-gradient(#e0494b, #a02426); } .bar.mp i { background: linear-gradient(#4b8cf0, #2656a8); } .bar.xp i { background: linear-gradient(#e6c040, #a07e10); }
.bar span { position: absolute; inset: 0; text-align: center; font-size: 14px; line-height: 12px; text-shadow: 1px 1px 0 #000; }
#hud-stats { display: flex; gap: 14px; font-size: 21px; }
#hud-stats div { display: flex; align-items: center; gap: 5px; }
.hico { width: 28px; height: 28px; }
#hud-btns { margin-left: auto; display: flex; gap: 4px; }
#hud-btns button { font-family: var(--px); font-size: 9px; padding: 8px 8px; }
#hud-btns button.off { opacity: .45; }
#banner { background: #5a1414; border-bottom: 2px solid var(--red); text-align: center; padding: 3px; font-size: 20px; flex: 0 0 auto; }
#stage { flex: 1 1 auto; display: flex; min-height: 0; }
#viewwrap { position: relative; flex: 1 1 auto; min-width: 0; background: #000; overflow: hidden; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#place { position: absolute; left: 10px; top: 8px; font-family: var(--px); font-size: 10px; color: #fff; text-shadow: 2px 2px 0 #000; pointer-events: none; }
#levelup { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); background: #7a4a14; border: 3px solid var(--gold); padding: 6px 14px; font-family: var(--px); font-size: 10px; animation: pulse 1s infinite alternate; z-index: 3; pointer-events: none; text-align: center; }
@keyframes pulse { from { box-shadow: 0 0 0 0 #f0c05000; } to { box-shadow: 0 0 20px 4px #f0c050aa; } }
#side { flex: 0 0 300px; display: flex; flex-direction: column; background: var(--panel); border-left: 3px solid var(--line); min-height: 0; }
#tabs { display: flex; flex: 0 0 auto; }
#tabs button { flex: 1; border-width: 0 0 3px 0; border-radius: 0; font-size: 18px; background: #140f0b; padding: 6px 2px; }
#tabs button.on { border-bottom-color: var(--gold); background: var(--panel2); }
.tab { display: none; flex: 1 1 auto; min-height: 0; flex-direction: column; }
.tab.on { display: flex; }
#chat-log, #news-log, #who-log { flex: 1 1 auto; overflow-y: auto; padding: 6px 8px; font-size: 19px; line-height: 1.15; overflow-wrap: anywhere; }
#chat-log .m { margin: 2px 0; } #chat-log .n { color: var(--gold); cursor: pointer; } #chat-log .t { color: #8fd; } #chat-log .w { color: #f9c; } #chat-log .e { color: #ca8; font-style: italic; } #chat-log .a { color: #ff7; }
#chat-log .k { color: var(--gold); } #chat-log .sys { color: var(--dim); }
#news-log .m { margin: 4px 0; border-bottom: 1px dotted var(--line2); padding-bottom: 3px; }
#news-log .time { color: var(--dim); font-size: 15px; display: block; }
#chat-form { display: flex; gap: 4px; padding: 6px; border-top: 2px solid var(--line2); }
#chat-form select { width: 70px; padding: 2px; } #chat-in { flex: 1; }
#who-log .p { display: flex; justify-content: space-between; gap: 6px; padding: 3px 4px; cursor: pointer; border-bottom: 1px dotted var(--line2); }
#who-log .p:hover { background: #ffffff10; } #who-log .loc { color: var(--dim); font-size: 16px; }
#king-card { flex: 0 0 auto; border-top: 2px solid var(--line); padding: 6px 8px; font-size: 17px; background: #1f1810; color: var(--dim); }
#king-card b { color: var(--gold); }

/* ---------- panels (buildings) ---------- */
#panel, #overlay { position: absolute; z-index: 10; background: var(--panel); border: 4px solid var(--line); box-shadow: 0 0 0 4px #000, 0 10px 50px #000c; display: flex; flex-direction: column; max-height: calc(100% - 16px); }
#panel { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(760px, calc(100% - 16px)); }
#overlay { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(680px, calc(100% - 16px)); z-index: 12; }
.p-head { display: flex; gap: 12px; align-items: center; padding: 10px 14px; background: linear-gradient(#34251a, #231a13); border-bottom: 3px solid var(--line); flex: 0 0 auto; }
.p-head canvas { width: 64px; height: 64px; background: radial-gradient(circle, #4a6a35, #243a1a); border: 3px solid var(--line); flex: 0 0 auto; }
.p-head h3 { margin: 0 0 4px; font-family: var(--px); font-size: 14px; color: var(--gold); line-height: 1.4; }
.p-head .blurb { color: var(--dim); font-size: 19px; line-height: 1.1; }
.p-head .x { margin-left: auto; align-self: flex-start; }
.p-head.scene { position: relative; display: block; padding: 0; aspect-ratio: 380 / 72; min-height: 96px; overflow: hidden; background: #000; }
.p-head.scene .sc { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: none; image-rendering: pixelated; object-fit: cover; }
.p-head.scene::before { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(8,5,3,.94) 0, rgba(8,5,3,.82) 30%, rgba(8,5,3,.35) 52%, rgba(8,5,3,0) 70%); pointer-events: none; }
.p-head.scene .ht { position: absolute; left: 14px; top: 8px; bottom: 6px; width: 45%; z-index: 2; display: flex; flex-direction: column; justify-content: center; text-shadow: 2px 2px 0 #000; }
.p-head.scene .x { position: absolute; right: 8px; top: 8px; z-index: 3; }
.p-head.scene h3 { font-size: 15px; text-shadow: 2px 2px 0 #000, 0 0 12px #000; }
.p-head.scene .blurb { color: #e6d9bd; }
.p-body { overflow-y: auto; padding: 10px 14px; flex: 1 1 auto; min-height: 0; }
.p-body .txt { margin: 6px 0 10px; line-height: 1.15; }
.p-body .txt.warn { color: #ffb347; } .p-body .txt.good { color: var(--green); }
.sec { font-family: var(--px); font-size: 10px; color: var(--gold); margin: 14px 0 6px; padding-bottom: 4px; border-bottom: 2px solid var(--line2); text-transform: uppercase; }
.row { display: flex; align-items: center; gap: 10px; padding: 5px 6px; border-bottom: 1px dotted var(--line2); }
.row:hover { background: #ffffff08; }
.row .ico { width: 40px; height: 40px; flex: 0 0 auto; background: #0b0806; border: 2px solid var(--line2); display: flex; align-items: center; justify-content: center; }
.row .ico canvas { width: 32px; height: 32px; }
.row .mid { flex: 1 1 auto; min-width: 0; line-height: 1.05; }
.row .nm { font-size: 21px; } .row .sb { color: var(--dim); font-size: 17px; }
.row .pr { color: var(--gold); white-space: nowrap; margin-right: 4px; }
.row .tag { font-family: var(--px); font-size: 8px; background: #2c4a20; border: 1px solid #5c9a40; color: #9f9; padding: 3px 5px; margin-right: 4px; white-space: nowrap; }
.row .acts { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.row .acts input { width: 100px; padding: 2px 6px; } .row .acts input[type=text] { width: 140px; }
.r0 { color: var(--text); } .r1 { color: var(--green); } .r2 { color: var(--blue); } .r3 { color: var(--purple); text-shadow: 0 0 8px #c77dff88; } .dim.nm { color: #777; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; align-items: center; }
.btns .bi { display: flex; gap: 4px; align-items: center; }
.btns input { width: 110px; } .btns input[type=text] { width: 200px; }
table { border-collapse: collapse; width: 100%; font-size: 19px; margin: 4px 0 8px; }
th { text-align: left; color: var(--dim); font-weight: normal; border-bottom: 2px solid var(--line2); padding: 2px 6px; }
td { padding: 2px 6px; border-bottom: 1px dotted var(--line2); }
.logbox { background: #0d0a08; border: 2px solid var(--line2); padding: 6px 10px; margin-bottom: 8px; font-size: 19px; line-height: 1.1; }
.logbox .good { color: var(--green); } .logbox .warn { color: #ffb347; }
.p-foot { padding: 8px 14px; border-top: 3px solid var(--line); display: flex; justify-content: space-between; gap: 8px; background: #17110d; flex: 0 0 auto; }
#gamble-out { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 8px 0; min-height: 76px; }
#gamble-out canvas { width: 64px; height: 64px; background: #0b0806; border: 3px solid var(--line); padding: 6px; }
#gamble-out .res { font-family: var(--px); font-size: 12px; margin-left: 12px; }

/* ---------- battle ---------- */
#battle-ui { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 6; pointer-events: none; }
#battle-ui > * { pointer-events: auto; }
#battle-log { background: #000a; border: 2px solid var(--line2); padding: 3px 12px; min-height: 28px; max-width: 94%; text-align: center; font-size: 20px; }
#battle-btns { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
#battle-btns button { min-width: 96px; padding: 6px 10px; font-size: 19px; line-height: 1; }
#battle-btns button small { display: block; font-size: 14px; color: var(--dim); }
#battle-btns button kbd { font-family: var(--px); font-size: 8px; color: var(--gold); margin-right: 5px; }
#result { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); background: var(--panel); border: 4px solid var(--gold); box-shadow: 0 0 0 4px #000, 0 0 60px #000; padding: 16px 24px; text-align: center; z-index: 11; min-width: 300px; max-width: calc(100% - 20px); }
#result h4 { font-family: var(--px); font-size: 18px; margin: 0 0 10px; } #result h4.win { color: var(--gold); } #result h4.lose { color: var(--red); }
#result .line { margin: 4px 0; font-size: 22px; }
#result button { margin-top: 10px; }

/* ---------- misc ---------- */
#dpad { position: absolute; left: 10px; bottom: 14px; width: 150px; height: 150px; z-index: 4; display: grid; grid-template: 1fr 1fr 1fr / 1fr 1fr 1fr; gap: 2px; opacity: .8; }
#dpad button { padding: 0; font-size: 22px; background: #000a; }
#dpad [data-d=u] { grid-area: 1 / 2; } #dpad [data-d=l] { grid-area: 2 / 1; } #dpad [data-d=r] { grid-area: 2 / 3; } #dpad [data-d=d] { grid-area: 3 / 2; }
#conn { position: fixed; top: 0; left: 50%; transform: translateX(-50%); background: #7a1c1c; border: 2px solid var(--red); padding: 4px 16px; z-index: 100; font-family: var(--px); font-size: 10px; }
#toasts { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; width: min(560px, 96vw); }
.toast { background: #1b1511ee; border: 2px solid var(--line); padding: 5px 14px; font-size: 21px; animation: tin .2s, tout .5s 3.6s forwards; text-align: center; max-width: 100%; }
.toast.good { border-color: #3d9a3d; color: #bff0bf; } .toast.warn { border-color: #c9892a; color: #ffd9a0; }
@keyframes tin { from { transform: translateY(-14px); opacity: 0; } } @keyframes tout { to { opacity: 0; transform: translateY(-8px); } }
#help, #confirm { position: fixed; inset: 0; z-index: 90; background: #000b; display: flex; align-items: center; justify-content: center; padding: 10px; }
.modal { background: var(--panel); border: 4px solid var(--line); box-shadow: 0 0 0 4px #000; padding: 16px 22px; max-width: 640px; max-height: 92vh; overflow: auto; }
.modal h3 { font-family: var(--px); font-size: 14px; color: var(--gold); margin: 0 0 10px; }
.modal h4 { font-family: var(--px); font-size: 10px; color: var(--gold); margin: 14px 0 4px; }
.modal p, .modal li { margin: 4px 0; line-height: 1.1; } .modal ul { padding-left: 20px; margin: 4px 0; }
.modal kbd { font-family: var(--px); font-size: 9px; background: #000; border: 1px solid var(--line); padding: 2px 4px; color: var(--gold); }
.modal .btns { justify-content: flex-end; }

/* ---------- mobile ---------- */
@media (max-width: 860px) {
  .p-head.scene { aspect-ratio: auto; min-height: 0; display: flex; flex-direction: column; background: #1b1511; }
  .p-head.scene .sc { position: static; height: auto; aspect-ratio: 380 / 72; }
  .p-head.scene::before { display: none; }
  .p-head.scene .ht { position: static; width: auto; padding: 8px 12px 10px; }
  html, body { font-size: 18px; }
  #side { position: absolute; right: 0; top: 0; bottom: 0; width: min(88vw, 340px); z-index: 20; transform: translateX(100%); transition: transform .2s; box-shadow: -4px 0 20px #000a; }
  #side.open { transform: none; }
  #hud { gap: 8px; padding: 4px 6px; } #hud-bars { width: 150px; } #hud-id { min-width: 0; } #hud-face { width: 36px; height: 36px; }
  #hud-stats { gap: 8px; font-size: 18px; } #hud-btns button { padding: 6px 5px; font-size: 8px; }
  .create-grid { grid-template-columns: 1fr; } .preview canvas { width: 112px; height: 112px; }
  .row { flex-wrap: wrap; } .row .acts { width: 100%; justify-content: flex-start; }
  #battle-btns button { min-width: 74px; padding: 5px 6px; font-size: 17px; }
}
@media (min-width: 861px) { #btn-side { display: none; } }
@media (pointer: coarse) { #dpad { display: grid; } }
@media (pointer: fine) { #dpad { display: none !important; } }

/* ---------- graphics level menu ---------- */
.gfx-menu { min-width: min(420px, 92vw); }
.gfx-opt { display: block; width: 100%; text-align: left; margin: 8px 0; padding: 10px 14px; }
.gfx-opt b { font-family: var(--px); font-size: 11px; color: var(--gold); display: block; margin-bottom: 4px; font-weight: normal; }
.gfx-opt small { color: var(--dim); font-size: 17px; }
.gfx-opt.on { background: #7a4a14; border-color: var(--gold); }

/* ================= HD graphics level =================
   Clean serif/humanist type, rounded glassy panels, glossy bars, smooth (not pixelated) canvases. */
@font-face { font-family: 'Cinzel'; src: url('/assets/fonts/Cinzel-Variable.ttf') format('truetype'); font-weight: 400 900; font-display: swap; }
@font-face { font-family: 'Alegreya Sans'; src: url('/assets/fonts/AlegreyaSans-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Alegreya Sans'; src: url('/assets/fonts/AlegreyaSans-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
html[data-gfx="hd"] { --px: 'Cinzel', 'Palatino Linotype', serif; --body: 'Alegreya Sans', 'Segoe UI', sans-serif; --line: #8a6c3a; --line2: #3f3022; --panel: #17110d; --panel2: #231a13; }
html[data-gfx="hd"], html[data-gfx="hd"] body, html[data-gfx="hd"] button, html[data-gfx="hd"] input, html[data-gfx="hd"] select { font-family: var(--body); font-size: 19px; }
html[data-gfx="hd"] canvas { image-rendering: auto; }
html[data-gfx="hd"] body { background: radial-gradient(ellipse at 50% 0%, #34231a 0%, #0d0907 62%); }
html[data-gfx="hd"] button { border-radius: 7px; background: linear-gradient(#34261b, #1f1610); border: 1px solid var(--line); box-shadow: inset 0 1px 0 #ffffff1a, 0 2px 4px #0008; padding: 5px 13px; transition: filter .12s, transform .08s; }
html[data-gfx="hd"] button:hover:not(:disabled) { background: linear-gradient(#4a3624, #2c1f15); border-color: var(--gold); filter: drop-shadow(0 0 5px #f0c05055); }
html[data-gfx="hd"] button.primary { background: linear-gradient(#a26a1e, #6b4210); border-color: #f0c050; font-size: 15px; letter-spacing: 2px; border-radius: 9px; box-shadow: inset 0 1px 0 #ffffff40, 0 3px 10px #0009; }
html[data-gfx="hd"] button.primary:hover:not(:disabled) { background: linear-gradient(#c58528, #84521a); }
html[data-gfx="hd"] input, html[data-gfx="hd"] select { border-radius: 6px; background: #0c0806; border: 1px solid var(--line2); box-shadow: inset 0 2px 5px #000a; }
html[data-gfx="hd"] .seg button { border-radius: 0; } html[data-gfx="hd"] .seg button:first-child { border-radius: 7px 0 0 7px; } html[data-gfx="hd"] .seg button:last-child { border-radius: 0 7px 7px 0; }
html[data-gfx="hd"] .auth-box, html[data-gfx="hd"] .create-box { border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(#1f1812e8, #120d0af0); box-shadow: 0 0 0 1px #000, 0 10px 60px #000d, inset 0 1px 0 #ffffff14; backdrop-filter: blur(6px); }
html[data-gfx="hd"] .logo h1 { font-size: 40px; letter-spacing: 6px; font-weight: 800; text-shadow: 0 3px 0 #5a2a0a, 0 0 28px #f0c05077; }
html[data-gfx="hd"] .logo .tag { font-size: 15px; letter-spacing: 12px; }
html[data-gfx="hd"] .create-box h2 { font-size: 24px; letter-spacing: 3px; }
html[data-gfx="hd"] .preview { border-radius: 12px; border: 1px solid var(--line2); }
html[data-gfx="hd"] .preview canvas { border-radius: 10px; border: 1px solid var(--line2); }
html[data-gfx="hd"] .pv-name { font-size: 15px; letter-spacing: 1px; }
html[data-gfx="hd"] #hud { background: linear-gradient(#33241a, #1a120d); border-bottom: 1px solid var(--line); box-shadow: 0 4px 16px #000a; }
html[data-gfx="hd"] #hud-face { border-radius: 10px; border: 1px solid var(--line); }
html[data-gfx="hd"] #hud-name { font-size: 15px; letter-spacing: 1px; } html[data-gfx="hd"] #hud-sub { font-size: 16px; }
html[data-gfx="hd"] .bar { height: 17px; border-radius: 9px; border: 1px solid #000; box-shadow: 0 0 0 1px var(--line2), inset 0 2px 4px #000c; overflow: hidden; }
html[data-gfx="hd"] .bar i { border-radius: 9px; box-shadow: inset 0 3px 0 #ffffff33, inset 0 -3px 0 #0004; transition: width .5s cubic-bezier(.2,.8,.2,1); }
html[data-gfx="hd"] .bar span { font-size: 13px; line-height: 15px; font-weight: 700; letter-spacing: .5px; }
html[data-gfx="hd"] #hud-btns button { font-family: var(--px); font-size: 12px; font-weight: 600; letter-spacing: 1px; padding: 8px 10px; }
html[data-gfx="hd"] #side { background: linear-gradient(#1b140f, #120d0a); border-left: 1px solid var(--line); box-shadow: -6px 0 20px #0008; }
html[data-gfx="hd"] #tabs button { border-radius: 0; font-family: var(--px); font-size: 14px; border-bottom: 3px solid transparent; background: #130e0a; box-shadow: none; }
html[data-gfx="hd"] #tabs button.on { border-bottom-color: var(--gold); background: #231a13; }
html[data-gfx="hd"] #chat-log, html[data-gfx="hd"] #news-log, html[data-gfx="hd"] #who-log { font-size: 18px; line-height: 1.25; }
html[data-gfx="hd"] #panel, html[data-gfx="hd"] #overlay { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: linear-gradient(#1e1610f2, #130d0af5); box-shadow: 0 0 0 1px #000, 0 18px 60px #000e, 0 0 40px #f0c05014; backdrop-filter: blur(8px); }
html[data-gfx="hd"] .p-head { background: linear-gradient(#3a2a1d, #20170f); border-bottom: 1px solid var(--line); }
html[data-gfx="hd"] .p-head h3 { font-size: 20px; letter-spacing: 2px; font-weight: 700; }
html[data-gfx="hd"] .p-head .blurb { font-size: 19px; }
html[data-gfx="hd"] .p-head canvas { border-radius: 12px; border: 1px solid var(--line); }
html[data-gfx="hd"] .p-head.scene { border-radius: 14px 14px 0 0; }
html[data-gfx="hd"] .p-head.scene h3 { font-size: 22px; }
html[data-gfx="hd"] .p-foot { background: #130d0a; border-top: 1px solid var(--line); }
html[data-gfx="hd"] .sec { font-size: 14px; letter-spacing: 3px; border-bottom: 1px solid var(--line2); color: #e4b650; }
html[data-gfx="hd"] .row { border-radius: 9px; border-bottom: 0; margin: 3px 0; background: #ffffff05; transition: background .12s; }
html[data-gfx="hd"] .row:hover { background: #ffffff0f; }
html[data-gfx="hd"] .row .ico { border-radius: 10px; border: 1px solid var(--line2); background: radial-gradient(#352a22, #0e0a08); }
html[data-gfx="hd"] .row .nm { font-size: 22px; } html[data-gfx="hd"] .row .sb { font-size: 18px; }
html[data-gfx="hd"] .row .tag { font-size: 11px; border-radius: 5px; letter-spacing: 1px; }
html[data-gfx="hd"] #battle-log { border-radius: 10px; background: #0009; border: 1px solid var(--line2); backdrop-filter: blur(4px); font-size: 21px; }
html[data-gfx="hd"] #battle-btns button { min-width: 108px; border-radius: 9px; font-size: 20px; }
html[data-gfx="hd"] #battle-btns button kbd { font-family: var(--px); font-size: 11px; }
html[data-gfx="hd"] #result { border: 1px solid var(--gold); border-radius: 16px; background: linear-gradient(#241a12f4, #120d0af4); box-shadow: 0 0 0 1px #000, 0 0 70px #000, 0 0 40px #f0c05033; }
html[data-gfx="hd"] #result h4 { font-size: 30px; letter-spacing: 6px; font-weight: 800; }
html[data-gfx="hd"] #result h4.win { text-shadow: 0 0 22px #f0c050aa; } html[data-gfx="hd"] #result h4.lose { text-shadow: 0 0 22px #d9211faa; }
html[data-gfx="hd"] .modal { border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(#1e1610, #130d0a); box-shadow: 0 0 0 1px #000, 0 18px 60px #000; }
html[data-gfx="hd"] .modal h3 { font-size: 22px; letter-spacing: 3px; } html[data-gfx="hd"] .modal h4 { font-size: 15px; letter-spacing: 2px; }
html[data-gfx="hd"] .toast { border-radius: 9px; font-size: 21px; box-shadow: 0 4px 16px #000a; }
html[data-gfx="hd"] #levelup { font-size: 14px; border-radius: 10px; letter-spacing: 1px; }
html[data-gfx="hd"] #banner { font-size: 21px; }
html[data-gfx="hd"] #conn { font-size: 14px; border-radius: 8px; }
html[data-gfx="hd"] .gfx-opt b { font-size: 15px; letter-spacing: 2px; } html[data-gfx="hd"] .gfx-opt { border-radius: 10px; }
.gfx-toggle { display: flex; align-items: center; gap: 10px; margin: 10px 0 2px; }
.gfx-toggle button.on { background: #7a4a14; border-color: var(--gold); }