@font-face { font-family: 'Cinzel'; src: url(fonts/cinzel-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }
:root {
  --bg: #1a1410; --panel: #241c15; --panel2: #2f251b; --line: #6b5230; --gold: #e9c46a; --gold2: #b8862f; --ink: #f3e9d6; --mut: #b3a389;
  --font: 'Trebuchet MS', Verdana, system-ui, sans-serif; --title: 'Cinzel', Georgia, serif;
  --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px); --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: var(--font); -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; }
button { font: inherit; border: 0; cursor: pointer; color: inherit; touch-action: manipulation; }
#cv { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* ---------- the bronze frames ---------- */
.frame { background: linear-gradient(180deg, rgba(58,40,22,.92), rgba(26,18,12,.92)); border: 2px solid var(--gold2); border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,220,150,.25), 0 3px 10px rgba(0,0,0,.6); }
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#hud button, #hud .chat, #mini { pointer-events: auto; }
.me { position: absolute; top: calc(6px + var(--st)); left: calc(6px + var(--sl)); display: flex; gap: 7px; align-items: center; padding: 5px 9px 5px 5px; }
.portrait { width: 46px; height: 46px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #5a4028, #160f0a); border: 2px solid var(--gold); display: flex; align-items: center; justify-content: center; font-size: 22px; box-shadow: 0 0 6px rgba(233,196,106,.35); }
.bars { width: 150px; }
.name { font-size: 13px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px #000; }
.name span { color: var(--gold); font-weight: 700; }
.rank { font-size: 10px; color: var(--gold); font-family: var(--title); line-height: 1.2; }
.bar { position: relative; height: 11px; border-radius: 2px; background: #0c0805; border: 1px solid #3a2a18; overflow: hidden; margin-top: 2px; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; transition: width .15s; }
.bar.hp i { background: linear-gradient(#ff6f5f, #b02418); } .bar.mp i { background: linear-gradient(#6aa6ff, #1f4fa8); }
.bar span { position: absolute; inset: 0; font-size: 9px; font-weight: 700; text-align: center; line-height: 10px; text-shadow: 0 1px 2px #000; }
.qtrack { position: absolute; left: calc(242px + var(--sl)); top: calc(8px + var(--st)); width: 210px; padding: 6px 8px; background: rgba(14,9,6,.55); border-left: 2px solid var(--gold2); border-radius: 3px; font-size: 12px; pointer-events: auto; }
.qtrack .qt { margin-bottom: 4px; } .qtrack .qt b { display: block; color: var(--gold); font-size: 12px; } .qtrack .qt span { color: #e8dcc4; } .qtrack .qt.ready span { color: #7dff7d; }
.qtrack .qh { color: var(--mut); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 3px; }
.qlist .opt b { color: var(--gold); }
.mapbox { position: absolute; top: calc(6px + var(--st)); right: calc(6px + var(--sr)); padding: 4px; text-align: center; width: 132px; }
#mini { display: block; width: 120px; height: 120px; border: 1px solid #3a2a18; background: #0c0805; image-rendering: pixelated; }
.where { font-size: 10px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px #000; }
.where b { color: var(--gold); font-family: var(--title); font-size: 11px; }
.where span { color: var(--mut); font-variant-numeric: tabular-nums; }
.silver { font-size: 12px; margin-top: 2px; }
.silver b { color: #e8eef5; font-variant-numeric: tabular-nums; }
.coin { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, #b8c0cc 60%, #6a7380); vertical-align: -1px; margin-right: 4px; }
.menu { position: absolute; right: calc(6px + var(--sr)); top: calc(178px + var(--st)); display: flex; gap: 4px; width: 132px; justify-content: space-between; }
.menu .mbtn { width: 30px; height: 30px; padding: 2px; display: flex; align-items: center; justify-content: center; } .menu .mbtn svg { width: 20px; height: 20px; }
.mbtn { width: 40px; height: 40px; border-radius: 6px; background: linear-gradient(180deg, #4a3420, #1e140c); border: 2px solid var(--gold2); font-size: 18px; box-shadow: 0 2px 6px rgba(0,0,0,.6); }
.broadcast { position: absolute; left: 50%; top: calc(8px + var(--st)); transform: translateX(-50%); max-width: 60%; text-align: center; font-size: 14px; font-weight: 700; color: #ffe08a; background: linear-gradient(90deg, rgba(110,30,10,0), rgba(110,30,10,.9), rgba(110,30,10,0)); padding: 6px 30px; text-shadow: 0 1px 2px #000; animation: ban .35s ease; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.broadcast.pearl { color: #fff3b0; background: linear-gradient(90deg, rgba(160,90,0,0), rgba(170,100,0,.92), rgba(160,90,0,0)); font-size: 16px; }
@keyframes ban { from { opacity: 0; transform: translate(-50%, -8px); } }
.chat { position: absolute; left: calc(6px + var(--sl)); bottom: calc(24px + var(--sb)); width: min(46vw, 420px); max-height: 128px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(233,196,106,.5) transparent; display: block; font-size: 11px; line-height: 1.35; background: linear-gradient(0deg, rgba(0,0,0,.45), rgba(0,0,0,0)); padding: 4px 6px; border-radius: 4px; }
.chat div { text-shadow: 0 1px 2px #000; white-space: normal; overflow-wrap: anywhere; line-height: 1.3; margin-top: 1px; }
.chat .csay { color: #ffffff; } .chat .cworld { color: #ffb86a; } .chat .cteam { color: #8fe38f; } .chat .cwhisper { color: #ff9ad8; }
.chatin { position: absolute; left: calc(6px + var(--sl)); bottom: calc(6px + var(--sb)); width: min(46vw, 420px); z-index: 30; background: rgba(14,9,6,.85); border: 1px solid var(--gold2); border-radius: 4px; padding: 5px 8px; color: var(--ink); pointer-events: auto; }
body.classic .chatin { bottom: 100px; }
.teambox { position: absolute; left: calc(6px + var(--sl)); top: calc(78px + var(--st, 0px)); background: rgba(20,12,8,.78); border: 1px solid var(--gold2); border-radius: 6px; padding: 5px 8px; font-size: 11px; min-width: 130px; pointer-events: auto; }
.teambox b { color: var(--gold); display: block; margin-bottom: 2px; } .teambox small { color: var(--mut); } .teambox .btn { margin-top: 4px; padding: 2px 8px; font-size: 10px; width: auto; min-height: 0; }
.chat .system { color: #ffe066; } .chat .bc { color: #ff9a4d; } .chat .loot { color: #9fe3a0; } .chat .info { color: #d8d0c0; }
.left-btns { position: absolute; left: calc(8px + var(--sl)); bottom: calc(124px + var(--sb)); display: grid; grid-template-columns: repeat(2, 54px); grid-auto-flow: row; gap: 8px; direction: rtl; }
.left-btns > * { direction: ltr; }
.actions { position: absolute; right: calc(8px + var(--sr)); bottom: calc(24px + var(--sb)); display: grid; grid-template-columns: 54px 54px 72px; grid-template-rows: 54px 72px; gap: 7px; align-items: end; justify-items: end; }
.abtn { position: relative; width: 54px; height: 54px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #5a4028, #1a120b); border: 2px solid var(--gold2); display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 3px 8px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,220,150,.25); overflow: hidden; }
/* old-school windows */
.win { position: absolute; z-index: 40; background: linear-gradient(180deg, #2c2016, #1a120c); border: 2px solid var(--gold2); border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,220,150,.2), 0 8px 30px rgba(0,0,0,.7); padding: 0 6px 6px; user-select: none; -webkit-user-select: none; touch-action: none; }
.win-h { display: flex; justify-content: space-between; align-items: center; height: 26px; color: var(--gold); font-family: var(--title); font-size: 14px; }
.win-h .x { width: 22px; height: 22px; padding: 3px; color: var(--ink); background: none; border: 0; }
#invWin { right: calc(8px + var(--sr)); top: calc(8px + var(--st)); --cell: clamp(28px, calc((100vh - 96px - var(--st) - var(--sb)) / 8), 42px); }
.igrid { display: grid; grid-template-columns: repeat(5, var(--cell)); grid-auto-rows: var(--cell); gap: 3px; }
.win .cell { aspect-ratio: auto; }
.win-f { display: flex; gap: 8px; align-items: center; justify-content: space-between; font-size: 12px; margin-top: 5px; color: var(--ink); }
#eqWin { left: calc(8px + var(--sl)); top: calc(8px + var(--st)); z-index: 41; max-height: calc(100vh - 16px - var(--st) - var(--sb)); overflow-y: auto; }
.eqbody { display: flex; gap: 8px; }
.eqlay { display: flex; gap: 6px; align-items: stretch; }
.eqcol { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; }
.eqlay .cell { width: 40px; height: 40px; }
.slotname { font-size: 8px; letter-spacing: .08em; text-transform: uppercase; color: #6a5844; }
.eqport { position: relative; width: 104px; height: 136px; border: 1px solid #5a4630; border-radius: 6px; overflow: hidden; box-shadow: inset 0 0 18px rgba(0,0,0,.8), 0 0 0 1px #000; }
.eqport canvas { width: 104px; height: 136px; display: block; }
.eqport .turn, .cpreview .turn { position: absolute; bottom: 4px; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--gold2); background: rgba(20,12,6,.75); cursor: pointer; padding: 0; }
.eqport .turn::before, .cpreview .turn::before { content: ''; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; border-left: 2px solid var(--gold); border-bottom: 2px solid var(--gold); transform: translate(-30%, -50%) rotate(45deg); }
.eqport .turn.r::before, .cpreview .turn.r::before { transform: translate(-70%, -50%) rotate(-135deg); }
.eqport .turn.l { left: 4px; } .eqport .turn.r { right: 4px; }
.power { text-align: center; margin: 6px 0 4px; padding: 4px 0; border-top: 1px solid #4a3a28; border-bottom: 1px solid #4a3a28; background: linear-gradient(90deg, transparent, rgba(233,196,106,.12), transparent); }
.power small { display: block; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--mut); }
.power b { font-family: var(--title); font-size: 16px; color: var(--gold); text-shadow: 0 0 10px rgba(233,196,106,.45); }
#eqPortrait { pointer-events: none; }
.eqstats { width: 230px; font-size: 11px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; align-content: start; }
.eqstats > :not(.srow), .eqstats .srow.head { grid-column: 1 / -1; }
.eqcol { justify-content: flex-start !important; }
.eqlay { align-items: flex-start !important; }
.eqname { color: var(--gold); font-weight: 700; font-size: 14px; }
.srow { display: flex; justify-content: space-between; align-items: center; padding: 1px 0; border-bottom: 1px solid rgba(255,220,150,.07); }
.srow.head { color: var(--gold); margin-top: 4px; }
.srow .plusbtn { margin-left: 5px; }
.eqstats .btn { margin-top: 6px; width: 100%; padding: 4px 8px; font-size: 12px; }
.cell.lifted { opacity: .35; }
.cell.picked { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(233,196,106,.5); }
.ghost { position: fixed; width: 40px; height: 40px; z-index: 80; pointer-events: none; filter: drop-shadow(0 3px 4px rgba(0,0,0,.7)); }
.tip { position: fixed; z-index: 70; width: 210px; background: rgba(18,12,8,.97); border: 1px solid var(--gold2); border-radius: 5px; padding: 7px 9px; font-size: 12px; pointer-events: none; box-shadow: 0 6px 20px rgba(0,0,0,.6); }
.tip b { display: block; font-size: 13px; } .tip small { display: block; color: var(--mut); margin-bottom: 4px; }
.tip.wide { width: auto; max-width: min(620px, calc(100vw - 12px)); display: flex; gap: 10px; }
.tip .tcol { width: 190px; } .tip .tdiff { width: 150px; border-left: 1px solid rgba(255,220,150,.15); padding-left: 9px; }
.tip .thead { color: var(--gold); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 3px; }
.tip b.up { color: #7dff7d; } .tip b.down { color: #ff7a6a; } .tip .hint { display: block; margin-top: 4px; color: var(--mut); font-style: italic; }
.tip .stat { display: flex; justify-content: space-between; padding: 1px 0; } .tip .warn { color: #ff8a80; margin-top: 4px; }
/* a shop window sits beside your bag instead of covering the screen */
.overlay.side { background: none; pointer-events: none; justify-content: flex-start; align-items: flex-start; padding: calc(8px + var(--st)) 0 0 calc(8px + var(--sl)); }
.overlay.side .panel { pointer-events: auto; width: min(430px, calc(100vw - 250px - var(--sl) - var(--sr))); max-height: calc(100vh - 16px - var(--st) - var(--sb)); }
.tabs { display: flex; gap: 4px; margin-bottom: 6px; }
.tabs button { flex: 1; padding: 6px; background: #0e0906; border: 1px solid #4a3a28; border-radius: 4px; color: var(--mut); font-weight: 700; }
.tabs button.on { color: var(--gold); border-color: var(--gold2); }
.sgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.scell { text-align: center; } .scell small { font-size: 10px; color: var(--gold); } .scell .cell { aspect-ratio: 1; }
.arow { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid rgba(255,220,150,.08); }
.arow .cell { width: 40px; height: 40px; flex: none; } .arow .at { flex: 1; min-width: 0; } .arow .at b { display: block; font-size: 13px; } .arow .at small { color: var(--mut); font-size: 11px; } .arow .btn { flex: none; }
input, textarea, select { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; font: inherit; font-size: 14px; color: var(--ink); caret-color: var(--gold); }
input::placeholder, textarea::placeholder { color: #8a7a62; }
input:focus, textarea:focus { outline: none; border-color: var(--gold) !important; box-shadow: 0 0 0 2px rgba(233,196,106,.25); }
.asearch { display: flex; gap: 6px; margin: 6px 0; } .asearch .btn { flex: 0 0 auto; width: auto; margin: 0; } .asearch input { flex: 1 1 auto; min-width: 140px; } .asearch input { flex: 1; min-width: 0; background: #0e0906; border: 1px solid #4a3a28; border-radius: 4px; color: var(--ink); padding: 6px 8px; }
.dropzone { border: 2px dashed #6a5034; border-radius: 6px; padding: 18px 10px; text-align: center; color: var(--mut); margin: 8px 0; }
@media (orientation: portrait) { #invWin { top: auto; bottom: calc(8px + var(--sb)); --cell: clamp(28px, calc((100vw - 60px) / 5 * .55), 42px); } .overlay.side .panel { width: calc(100vw - 16px); max-height: 46vh; } }
.xppop { position: fixed; right: 18px; bottom: 150px; z-index: 30; display: flex; gap: 10px; }
.classic .xppop { bottom: 120px; right: 24px; }
.xppop button { position: relative; width: 62px; height: 62px; border-radius: 12px; border: 2px solid #ffd34d; background: radial-gradient(circle at 50% 40%, #6a3a12, #24140a); box-shadow: 0 0 18px rgba(255,200,80,.75); cursor: pointer; animation: xpflash .9s ease-in-out infinite alternate, xpin .35s ease-out; padding: 6px; }
.xppop button svg { width: 100%; height: 100%; }
.xppop button small { position: absolute; left: 0; right: 0; bottom: -17px; text-align: center; font-size: 10px; color: #ffd34d; text-shadow: 0 1px 2px #000; white-space: nowrap; }
.xppop button kbd { position: absolute; top: -8px; right: -8px; font-size: 10px; background: #1a120c; border: 1px solid #ffd34d; color: #ffd34d; border-radius: 4px; padding: 0 4px; }
.xppop .xpt { position: absolute; left: 4px; top: 2px; font-size: 10px; color: #fff; text-shadow: 0 1px 2px #000; }
@keyframes xpflash { from { box-shadow: 0 0 8px rgba(255,200,80,.5); filter: brightness(.9); } to { box-shadow: 0 0 26px rgba(255,220,100,1); filter: brightness(1.25); } }
@keyframes xpin { from { transform: scale(.2) translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.arrows { text-align: center; font-size: 11px; color: #e8dcc4; text-shadow: 0 1px 2px #000; }
.arrows.buff { color: #ffd34d; font-weight: 700; }
.arrows.low { color: #ff6a4a; font-weight: 700; }
.loading { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: radial-gradient(ellipse at 50% 40%, #3a2a1a, #120a06 70%); transition: opacity .35s; }
.loading.done { opacity: 0; pointer-events: none; }
.loading .lt { font-family: var(--title); font-size: clamp(34px, 7vw, 60px); color: var(--gold); text-shadow: 0 3px 0 #3a2210, 0 0 30px rgba(233,196,106,.35); letter-spacing: .06em; }
.loading .ls { color: #e8dcc4; font-size: 14px; min-height: 18px; }
.loading .lb { width: min(360px, 70vw); height: 10px; border: 1px solid var(--gold2); border-radius: 6px; background: #0e0906; overflow: hidden; }
.loading .lb i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8a6a2a, #ffd34d); transition: width .2s; }
.loading .ltip { color: var(--mut); font-size: 12px; max-width: min(420px, 80vw); text-align: center; font-style: italic; min-height: 16px; }
.ico { width: 1em; height: 1em; display: block; }
.ico.in { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -0.25em; margin-right: 3px; }
.mbtn .ico { width: 26px; height: 26px; margin: auto; }
.portrait .ico { width: 30px; height: 30px; }
.iimg { width: 100%; height: 100%; image-rendering: auto; pointer-events: none; }
.cell.empty .iimg { opacity: .22; filter: grayscale(1); }
.card .t .ic .iimg { width: 44px; height: 44px; }
/* the classic PC layout: orbs, an experience bar and an F-key hotbar along the bottom */
.cbar { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); display: flex; align-items: flex-end; gap: 10px; padding: 8px 14px 6px; background: linear-gradient(180deg, #3a2a1c, #1a120c); border: 2px solid var(--gold2); border-bottom: 0; border-radius: 14px 14px 0 0; box-shadow: 0 -4px 20px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,220,150,.2); z-index: 20; }
.orb { position: relative; width: 84px; height: 84px; border-radius: 50%; border: 3px solid var(--gold); overflow: hidden; background: #120a06; box-shadow: inset 0 0 18px rgba(0,0,0,.9); }
.orb i { position: absolute; left: 0; right: 0; bottom: 0; }
.orb.hp i { background: radial-gradient(circle at 40% 30%, #ff8a7a, #c0201a 55%, #5a0a08); }
.orb.mp i { background: radial-gradient(circle at 40% 30%, #8ac4ff, #1f5ad0 55%, #0a1a5a); }
.orb::after { content: ''; position: absolute; left: 14px; top: 8px; width: 34px; height: 18px; border-radius: 50%; background: rgba(255,255,255,.22); transform: rotate(-20deg); }
.orb span { position: absolute; left: 0; right: 0; bottom: 30px; text-align: center; font: 700 11px/1 sans-serif; color: #fff; text-shadow: 0 1px 3px #000; z-index: 1; }
.cmid { display: flex; flex-direction: column; gap: 6px; }
.cxp { position: relative; height: 12px; border: 1px solid var(--gold2); border-radius: 6px; background: #0e0906; overflow: hidden; }
.cxp i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #c9a24a, #ffe08a); }
.cxp span { position: absolute; inset: 0; text-align: center; font: 700 9px/12px sans-serif; color: #fff; text-shadow: 0 1px 2px #000; }
.cslots { display: flex; gap: 4px; }
.cslot { position: relative; width: 50px; height: 50px; border-radius: 6px; border: 1px solid #6a5034; background: radial-gradient(circle at 35% 30%, #4a3420, #120a06); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cslot .ico { width: 30px; height: 30px; } .cslot.off { opacity: .45; } .cslot.on { border-color: #7ff07f; }
.cslot kbd { position: absolute; left: 3px; top: 2px; font: 700 9px/1 sans-serif; color: rgba(255,230,170,.8); }
.cslot small { position: absolute; right: 3px; bottom: 2px; font: 700 10px/1 sans-serif; color: #fff; text-shadow: 0 1px 2px #000; }
.cslot i { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.62); height: 0; }
body.classic .actions, body.classic .xpbar, body.classic .left-btns { display: none !important; }
body.classic .chat { bottom: 118px; }
.abtn span { font-size: 22px; line-height: 1; z-index: 1; display: flex; }
.abtn small { font-size: 10px; font-weight: 700; color: var(--ink); z-index: 1; text-shadow: 0 1px 2px #000; }
.abtn.auto span { font-size: 24px; color: #e9c46a; }
#rideBtn.on { border-color: #e9c46a; box-shadow: 0 0 0 2px rgba(233,196,106,.45); }
.dcup { display: flex; justify-content: center; gap: 10px; margin: 10px 0 12px; padding: 14px; background: radial-gradient(ellipse, #2f5a3a, #183020 75%); border: 2px solid #8a6a2a; border-radius: 50%/30%; }
.die { width: 46px; height: 46px; filter: drop-shadow(0 3px 3px rgba(0,0,0,.5)); }
.die.roll { animation: dieroll .18s linear infinite; }
@keyframes dieroll { 0% { transform: rotate(0) translateY(0); } 50% { transform: rotate(180deg) translateY(-6px); } 100% { transform: rotate(360deg) translateY(0); } }
.dgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.dopt, .dsum { background: #2a1c12; border: 1px solid #6a4a2a; color: #f0e4cc; border-radius: 8px; padding: 6px 2px; cursor: pointer; display: flex; flex-direction: column; align-items: center; font: inherit; }
.dopt small, .dsum small { color: var(--mut); font-size: 10px; }
.dopt.on, .dsum.on { border-color: #ffd34d; background: #5a2a14; box-shadow: 0 0 10px rgba(255,200,80,.5); }
.dsums { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dbet { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 12px 0 4px; }
.dbet b { min-width: 110px; text-align: center; color: var(--gold); }
.dyes { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 6px; margin: 8px 0; }
.dye { background: #2a1c12; border: 1px solid #6a4a2a; border-radius: 8px; padding: 6px 2px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; color: #f0e4cc; font: inherit; }
.dye i { width: 28px; height: 28px; border-radius: 50%; background: var(--c); border: 2px solid #1a120c; box-shadow: inset 0 -4px 6px rgba(0,0,0,.35); }
.dye i.none { background: repeating-linear-gradient(45deg, #6a5a44, #6a5a44 4px, #4a3c2c 4px, #4a3c2c 8px); }
.dye small { font-size: 10px; }
.dye.on { border-color: #ffd34d; box-shadow: 0 0 10px rgba(255,200,80,.5); }
.goods { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.good { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 10px; background: #2a1c12; border: 1px solid #5a3e24; border-radius: 8px; padding: 6px 8px; color: #f0e4cc; font: inherit; text-align: left; cursor: pointer; }
button.good:hover:not(:disabled) { border-color: #c9a24a; background: #3a2616; }
.good:disabled { opacity: .45; cursor: default; }
.good .gp { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: #1a120c; border-radius: 6px; border: 1px solid #4a3420; }
.good .gp img, .good .gp svg { width: 34px; height: 34px; }
.good .gt { display: flex; flex-direction: column; min-width: 0; }
.good .gt small { color: var(--mut); font-size: 11px; }
.good .gc { color: var(--gold); font-weight: 700; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.sline { display: block; font-size: 10.5px; color: #cfc3aa; margin-top: 1px; }
.sline .up { color: #7dff7d; } .sline .down { color: #ff7a6a; }
.tip .tbar { height: 5px; background: #0e0906; border: 1px solid #4a3a28; border-radius: 3px; margin-top: 3px; overflow: hidden; }
.tip .tbar i { display: block; height: 100%; background: linear-gradient(90deg, #8a6a2a, #ffd34d); }
.titlescreen { position: fixed; inset: 0; z-index: 150; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% 35%, #3a2a1a, #120a06 72%); }
.titlescreen .tbox { width: min(380px, 88vw); display: flex; flex-direction: column; gap: 10px; text-align: center; }
.titlescreen h1 { font-family: var(--title); font-size: clamp(38px, 8vw, 64px); color: var(--gold); margin: 0; text-shadow: 0 3px 0 #3a2210, 0 0 30px rgba(233,196,106,.35); letter-spacing: .05em; }
.titlescreen .tag { color: var(--mut); margin: 0 0 10px; font-style: italic; }
.titlescreen .tin { background: #0e0906; border: 1px solid #5a4630; border-radius: 6px; padding: 10px 12px; font-size: 15px; color: var(--ink); }
.titlescreen .quiet { background: none; border: 0; color: var(--mut); text-decoration: underline; }
.titlescreen .tmsg { color: #ff9a7a; font-size: 13px; }
.tradebag { display: grid; grid-template-columns: repeat(auto-fill, 40px); gap: 4px; margin: 4px 0 8px; }
.tradebag .cell { width: 40px; height: 40px; padding: 0; cursor: pointer; }
.spouse { color: #ff9ad8; font-size: 11px; }
.dyedot { width: 26px; height: 26px; border-radius: 50%; background: var(--c); border: 2px solid #1a120c; display: block; }
.jar { width: 74px; height: 86px; margin: 10px auto 4px; border-radius: 44% 44% 34% 34%; background: radial-gradient(circle at 35% 30%, #b8603a, #6a2a14 70%); border: 3px solid #3a1a0a; position: relative; box-shadow: 0 6px 14px rgba(0,0,0,.5); }
.jar::before { content: ''; position: absolute; left: 18px; right: 18px; top: -12px; height: 14px; border-radius: 6px 6px 2px 2px; background: #5a2a14; border: 2px solid #3a1a0a; }
.jar::after { content: ''; position: absolute; left: 10px; right: 10px; top: 30px; height: 6px; background: #e9c46a; border-radius: 3px; }
.jar.shake { animation: jarshake .12s linear infinite; }
@keyframes jarshake { 0% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } 100% { transform: rotate(-6deg); } }
#namesBtn.on { border-color: #9fd3ff; }
.abtn.auto.on { border-color: #7ff07f; box-shadow: 0 0 0 2px rgba(111,211,111,.45), 0 3px 8px rgba(0,0,0,.5); }
.abtn.skill { width: 72px; height: 72px; grid-column: 3; grid-row: 2; border-color: var(--gold); }
.abtn.skill span { font-size: 30px; }
.abtn.xp { grid-column: 3; grid-row: 1; }
.abtn.skill2 { grid-column: 2; grid-row: 1; border-color: var(--gold); }
.tcard small { display: block; } .tcard .tgood { color: #8fe38f; } .tcard .tbad { color: #ff8a7a; } .tcard.rare { border-color: #e9c46a; box-shadow: 0 0 0 1px rgba(233,196,106,.5), 0 0 12px rgba(233,196,106,.25); }
.lvtabs { flex-wrap: wrap; gap: 3px; } .lvtabs button { min-width: 34px; padding: 3px 6px; }
.vline { color: #e8dcc0; font-size: 12px; margin: 2px 0 6px; }
.vgrid { display: grid; grid-template-columns: repeat(5, 52px); gap: 4px; justify-content: center; padding: 8px; background: linear-gradient(180deg, #1c130c, #120c08); border: 1px solid var(--gold2); border-radius: 4px; box-shadow: inset 0 0 12px rgba(0,0,0,.7); }
.vslot { width: 52px; height: 52px; background: radial-gradient(circle at 40% 35%, #3a2a1c, #1a120b); border: 1px solid #5a4428; border-radius: 3px; position: relative; }
.vslot .cell { width: 100%; height: 100%; border: 0; background: none; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.vslot.picked { border-color: #ffd34d; box-shadow: 0 0 0 1px #ffd34d, 0 0 8px rgba(255,211,77,.4); }
.vslot .iimg { width: 44px; height: 44px; } .vicon svg, .vicon { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; }
.vfoot { display: flex; align-items: center; gap: 6px; justify-content: center; margin: 5px 0; } .vpg { width: 28px; height: 22px; padding: 0; } .vpn { color: #c8b898; font-size: 11px; min-width: 40px; text-align: center; }
.vsilver { margin-left: auto; color: #e8e0d0; font-weight: 700; display: flex; align-items: center; gap: 3px; }
.vbox { margin: 6px auto; max-width: 300px; padding: 8px 10px; border: 1px solid var(--gold); border-radius: 4px; background: rgba(20,12,6,.92); box-shadow: 0 4px 14px rgba(0,0,0,.6); }
.vbox .vbt { font-family: var(--title); color: var(--gold); font-size: 13px; margin-bottom: 3px; } .vbox .vrow { display: flex; justify-content: space-between; align-items: center; margin: 4px 0; font-size: 12px; }
.vqty { display: flex; align-items: center; gap: 3px; } .vqty button { min-width: 26px; padding: 2px 5px; } .vqty b { min-width: 30px; text-align: center; } .vbox .short { color: #ff8a7a; }
.vhint { font-size: 10.5px; text-align: center; } .tcol.vprice { margin-top: 2px; }
.eqtabs { display: flex; gap: 2px; margin-bottom: 6px; border-bottom: 1px solid var(--gold2); } .eqtabs button { flex: 1; padding: 4px 6px; font-size: 11.5px; border-radius: 4px 4px 0 0; background: #24180e; color: #c8b898; border: 1px solid #5a4428; border-bottom: 0; }
.eqtabs button.on { background: #3a2814; color: var(--gold); border-color: var(--gold2); }
.eqtabbody { max-height: 300px; overflow-y: auto; scrollbar-width: thin; } .sgrid2 { display: grid; grid-template-columns: 1fr 1fr; column-gap: 10px; }
.skrow { display: flex; gap: 6px; align-items: center; padding: 4px 2px; border-bottom: 1px solid rgba(233,196,106,.12); } .skrow svg.in, .skrow .iimg { width: 26px; height: 26px; flex: none; }
.skrow span { flex: 1; display: block; } .skrow b { display: block; font-size: 12px; } .skrow small { color: #b8a888; font-size: 10.5px; } .skrow.locked { opacity: .5; }
.pbar { display: block; height: 4px; margin-top: 2px; background: #1a120b; border: 1px solid #4a3620; border-radius: 2px; overflow: hidden; } .pbar i { display: block; height: 100%; background: linear-gradient(90deg, #b8873a, #ffd35a); }
.portrait .pface { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.grp.faces { flex-wrap: wrap; } .fpick { width: 40px; height: 40px; padding: 0; border-radius: 6px; overflow: hidden; border: 2px solid #5a4428; background: #1a120b; }
.fpick img { width: 100%; height: 100%; object-fit: cover; display: block; } .fpick.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 8px rgba(233,196,106,.5); }
.eqface { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 1.5px solid var(--gold2); vertical-align: middle; margin-right: 6px; }
.cardbtn { position: absolute; left: 50%; top: 86px; transform: translateX(-50%); z-index: 8; pointer-events: auto; padding: 8px 18px; font-family: var(--title); font-size: 15px; color: #1a1006; background: linear-gradient(180deg, #ffe08a, #c9962e); border: 2px solid #fff3c0; border-radius: 6px; box-shadow: 0 0 16px rgba(255,211,77,.6), 0 4px 10px rgba(0,0,0,.5); animation: glow .8s ease-in-out infinite alternate; }
#pkBtn.on { border-color: #ff5a4a; box-shadow: 0 0 0 2px rgba(255,90,74,.45), 0 3px 8px rgba(0,0,0,.5); }
.frow .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #5a4a3a; margin-right: 6px; } .frow .dot.on { background: #7fe07f; box-shadow: 0 0 6px #7fe07f; }
.frow span:last-child { display: flex; gap: 4px; }
.chat .cguild { color: #c9a0ff; } .gbul { width: 100%; min-height: 54px; background: #1a120b; color: var(--ink); border: 1px solid var(--gold2); border-radius: 4px; padding: 5px; font: inherit; resize: vertical; }
.pcard { position: fixed; z-index: 40; pointer-events: none; display: flex; gap: 8px; align-items: center; padding: 6px 10px 6px 6px; background: rgba(20,13,8,.94); border: 1px solid var(--gold2); border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.6); max-width: 220px; }
.pcard img { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--gold); object-fit: cover; }
.pcard b { display: block; color: #fff; font-size: 13px; } .pcard small { display: block; color: #c8b898; font-size: 11px; } .pcard .gld { color: #9fd3ff; } .pcard .ttl { color: #ffd34d; } .pcard .pkr { color: #ff5a4a; }
.cstage, .bstage { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; margin: 6px 0; }
.cpreview { position: relative; width: 220px; height: 275px; background: radial-gradient(circle at 50% 70%, #3a2a18, #120c08 70%); border: 2px solid var(--gold2); border-radius: 10px; box-shadow: inset 0 0 24px rgba(0,0,0,.7); }
.cpreview canvas { width: 100%; height: 100%; display: block; } .cpreview.small { width: 160px; height: 200px; }
.cpreview .turn { position: absolute; bottom: 8px; width: 28px; height: 28px; } .cpreview .turn.l { left: 8px; } .cpreview .turn.r { right: 8px; }
.cside { display: flex; flex-direction: column; gap: 8px; align-items: center; max-width: 420px; }
.cpface { width: 84px; height: 84px; border-radius: 50%; border: 3px solid var(--gold); object-fit: cover; box-shadow: 0 0 14px rgba(233,196,106,.35); display: block; margin: 0 auto 6px; }
.cpname { text-align: center; } .cpname b { display: block; font-family: var(--title); color: var(--gold); font-size: 20px; } .cpname small { color: #c8b898; }
.qt.trial b { color: #ffd34d; }
.skgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.skcard { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: rgba(0,0,0,.25); cursor: grab; touch-action: none; user-select: none; }
.skcard svg { width: 34px; height: 34px; flex: none; } .skcard b { display: block; font-size: 13px; } .skcard small { color: #b8a888; font-size: 10.5px; }
.skcard.locked { opacity: .5; } .skcard.pick, .skslot.pick { border-color: #9fd3ff; box-shadow: 0 0 0 2px rgba(159,211,255,.4); }
.skbar { display: flex; gap: 8px; justify-content: center; padding: 6px 0; }
.skslot { position: relative; width: 52px; height: 52px; border-radius: 8px; border: 2px dashed rgba(233,196,106,.45); background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; touch-action: none; user-select: none; }
.skslot.sk { border-style: solid; border-color: var(--gold2); cursor: grab; } .skslot svg { width: 36px; height: 36px; }
.skslot kbd { position: absolute; bottom: -15px; left: 0; right: 0; text-align: center; font: 700 9px/1 sans-serif; color: rgba(255,230,170,.75); }
.skghost { position: fixed; z-index: 999; width: 44px; height: 44px; margin: -22px 0 0 -22px; pointer-events: none; border-radius: 8px; background: rgba(20,12,6,.8); border: 2px solid var(--gold); display: flex; align-items: center; justify-content: center; }
.skghost svg { width: 34px; height: 34px; }
.abtn.skill3 { grid-column: 1; grid-row: 1; border-color: #9fd3ff; }
.abtn.skill4 { position: absolute; right: 9px; bottom: calc(100% + 7px); border-color: #9fd3ff; }
.abtn kbd { position: absolute; top: 3px; right: 9px; font: 700 9px/1 sans-serif; color: rgba(255,230,170,.7); z-index: 1; }
@media (pointer: coarse) { .abtn kbd { display: none; } }
.abtn.pot:first-child { grid-column: 1; grid-row: 2; } .abtn.pot:nth-child(2) { grid-column: 2; grid-row: 2; }
.abtn i { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.62); height: 0; }
.abtn.xp i { background: linear-gradient(0deg, rgba(233,196,106,.65), rgba(233,196,106,.2)); }
.abtn.xp.ready { border-color: #ffd34d; animation: glow .6s ease-in-out infinite alternate; }
@keyframes glow { to { box-shadow: 0 0 18px 5px rgba(255,211,77,.85); } }
.abtn.locked { opacity: .45; }
.revive { position: absolute; left: 50%; bottom: calc(110px + var(--sb)); transform: translateX(-50%); pointer-events: auto; padding: 12px 26px; font-family: var(--title); font-size: 16px; color: #2a1a08; background: linear-gradient(#f5d77e, #c8962e); border-radius: 8px; box-shadow: 0 4px 0 #7a5410, 0 0 20px rgba(255,220,120,.4); }
.xpbar { position: absolute; left: 0; right: 0; bottom: 0; height: calc(16px + var(--sb)); padding-bottom: var(--sb); background: #0c0805; border-top: 2px solid var(--gold2); }
.xpbar i { position: absolute; left: 0; top: 0; height: 14px; background: linear-gradient(#ffe48a, #c8962e); width: 0; }
.xpbar span { position: absolute; left: 0; right: 0; top: 0; height: 14px; font-size: 10px; font-weight: 700; text-align: center; line-height: 14px; text-shadow: 0 1px 2px #000; }
@media (orientation: portrait) { .chat { bottom: calc(24px + var(--sb)); width: 58vw; } .left-btns { bottom: calc(130px + var(--sb)); } }

/* ---------- create ---------- */
.screen { position: fixed; inset: 0; z-index: 30; overflow-y: auto; padding: calc(24px + var(--st)) 18px calc(30px + var(--sb)); background: radial-gradient(ellipse at top, #3a2a1a, #120c08 70%); text-align: center; }
.logo { font-family: var(--title); font-size: 42px; color: var(--gold); text-shadow: 0 2px 0 #6b4a12, 0 0 30px rgba(233,196,106,.35); }
.tag { color: var(--mut); max-width: 460px; margin: 6px auto 16px; line-height: 1.45; }
.kbs { display: flex; gap: 4px; } .kb { padding: 3px 7px; background: #0e0906; border: 1px solid #4a3a28; border-radius: 4px; color: var(--mut); font-size: 11px; font-weight: 700; } .kb.on { color: var(--gold); border-color: var(--gold); }
.tut { position: absolute; left: 50%; top: calc(64px + var(--st)); transform: translateX(-50%); max-width: min(520px, calc(100vw - 280px)); background: rgba(20,12,6,.92); border: 2px solid var(--gold); border-radius: 8px; padding: 9px 14px 8px; color: #f4e8cc; font-size: 14px; line-height: 1.4; z-index: 30; box-shadow: 0 6px 24px rgba(0,0,0,.6); text-align: center; animation: rise .3s ease; }
.tut b { color: var(--gold); display: block; font-family: var(--title); font-size: 13px; letter-spacing: .06em; margin-bottom: 2px; } .tut button { margin-top: 6px; background: none; border: 0; color: var(--mut); font-size: 11px; text-decoration: underline; }
@media (orientation: portrait) { .tut { max-width: calc(100vw - 24px); top: calc(150px + var(--st)); } }
.cls small.pas { display: block; margin-top: 4px; color: var(--gold); font-size: 11px; }
.looks { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: center; align-items: center; margin: 10px auto; max-width: 760px; }
.looks .grp { display: flex; gap: 4px; align-items: center; } .looks .grp > span { color: var(--mut); font-size: 12px; margin-right: 4px; }
.looks button { min-width: 34px; height: 30px; padding: 0 8px; background: #0e0906; border: 1px solid #4a3a28; border-radius: 4px; color: var(--ink); font-weight: 700; }
.looks button.on { border-color: var(--gold); color: var(--gold); }
.looks .hsw { min-width: 24px; width: 24px; height: 24px; border-radius: 50%; padding: 0; border: 2px solid #4a3a28; }
.looks .hsw.on { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(233,196,106,.4); }
.barber-pv { display: block; margin: 0 auto; }
.classes { display: grid; gap: 8px; max-width: 760px; margin: 0 auto; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); }
.cls { display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; background: var(--panel); border: 2px solid #4a3a28; border-radius: 10px; padding: 10px 8px; }
.cls.on { border-color: var(--gold); background: var(--panel2); box-shadow: 0 0 0 3px rgba(233,196,106,.2); }
.cls canvas { width: 90px; height: 100px; }
.cls b { font-family: var(--title); font-size: 16px; color: var(--gold); }
.cls small { color: var(--mut); font-size: 12px; line-height: 1.3; }
.name-in { display: block; width: min(520px, 100%); margin: 14px auto 0; height: 48px; border-radius: 8px; border: 2px solid #4a3a28; background: #120c08; color: var(--ink); font: inherit; font-size: 18px; text-align: center; outline: none; }
.name-in:focus { border-color: var(--gold); }
.btn { display: flex; align-items: center; justify-content: center; width: 100%; height: 46px; border-radius: 8px; background: linear-gradient(180deg, #3a2a1a, #241a10); border: 1px solid var(--line); font-weight: 700; font-size: 15px; margin-top: 8px; }
.btn.big { height: 52px; font-family: var(--title); font-size: 18px; color: #2a1a08; background: linear-gradient(#f5d77e, #c8962e); border: 0; box-shadow: 0 4px 0 #7a5410; max-width: 520px; margin: 14px auto 0; }
.btn:disabled { opacity: .45; }
.btn.small { height: 38px; font-size: 13px; }

/* ---------- windows ---------- */
.overlay { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.4); animation: fade .2s ease; padding: 10px; }
@keyframes fade { from { opacity: 0; } }
.panel { width: min(560px, 100%); max-height: calc(100vh - 20px - var(--st) - var(--sb)); overflow-y: auto; background: linear-gradient(180deg, #2c2016, #1a120c); border: 2px solid var(--gold2); border-radius: 8px; padding: 12px 12px 14px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,220,150,.2), 0 10px 40px rgba(0,0,0,.7); animation: rise .2s ease; }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }
.sheet-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.sheet-h h2 { margin: 0; font-family: var(--title); color: var(--gold); font-size: 19px; }
.x { width: 32px; height: 32px; border-radius: 6px; background: #3a2a1a; border: 1px solid var(--line); font-size: 16px; }
.muted { color: var(--mut); font-size: 13px; line-height: 1.45; margin: 4px 0 8px; }
.say { background: #120c08; border: 1px solid #3a2a18; border-radius: 6px; padding: 8px 10px; font-size: 13px; line-height: 1.5; margin: 4px 0 8px; color: #e8dcc4; }
.lbl { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--mut); margin: 10px 2px 5px; }
.slots { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.cell { position: relative; aspect-ratio: 1; border-radius: 5px; background: radial-gradient(circle at 50% 38%, #2c2118, #0b0705 72%); border: 1px solid #5a4630; box-shadow: inset 0 0 0 1px rgba(0,0,0,.85), inset 0 3px 8px rgba(0,0,0,.7); display: flex; align-items: center; justify-content: center; font-size: 20px; overflow: hidden; }
.cell::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }
.cell.q4::after { background: linear-gradient(115deg, transparent 30%, rgba(255,230,150,.35) 45%, transparent 60%); background-size: 260% 100%; animation: shimmer 3.2s linear infinite; }
.cell.q3::after { background: linear-gradient(115deg, transparent 35%, rgba(220,170,255,.22) 48%, transparent 60%); background-size: 260% 100%; animation: shimmer 4.5s linear infinite; }
@keyframes shimmer { from { background-position: 130% 0; } to { background-position: -130% 0; } }
.cell.empty { opacity: .4; font-size: 15px; }
.cell .plus { position: absolute; right: 2px; top: 1px; font-size: 10px; font-weight: 800; color: #ffe08a; text-shadow: 0 1px 2px #000, 0 0 6px rgba(255,200,80,.6); z-index: 1; }
.cell .lv { position: absolute; left: 2px; bottom: 2px; font-size: 9px; font-weight: 700; color: #e8dcc4; background: rgba(0,0,0,.65); border-radius: 3px; padding: 0 3px; line-height: 13px; z-index: 1; }
.cell.q1 { border-color: #4f9a4f; } .cell.q2 { border-color: #5aa9ff; box-shadow: inset 0 0 0 1px rgba(0,0,0,.85), inset 0 0 10px rgba(90,169,255,.25); } .cell.q3 { border-color: #c779ff; box-shadow: inset 0 0 8px rgba(199,121,255,.35); } .cell.q4 { border-color: #ffb43c; box-shadow: inset 0 0 10px rgba(255,180,60,.45); }
.cell.no { opacity: .5; }
.mats { display: flex; gap: 6px; flex-wrap: wrap; }
.mats span { background: #0e0906; border: 1px solid #4a3a28; border-radius: 4px; padding: 5px 8px; font-size: 13px; }
.card { background: #0e0906; border: 1px solid #4a3a28; border-radius: 6px; padding: 10px; margin: 8px 0; }
.card .t { display: flex; gap: 10px; align-items: center; }
.card .t .ic { font-size: 30px; }
.card .t b { display: block; font-size: 15px; }
.card .t small { color: var(--mut); }
.stat { display: flex; justify-content: space-between; align-items: center; font-size: 13px; padding: 4px 0; border-bottom: 1px solid #2c2219; }
.stat:last-child { border-bottom: 0; }
.stat b { color: var(--gold); font-variant-numeric: tabular-nums; }
.plusbtn { width: 28px; height: 24px; border-radius: 4px; background: #3a5a2a; border: 1px solid #6a9a4a; font-weight: 800; margin-left: 8px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.opt { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; text-align: left; background: #0e0906; border: 1px solid #4a3a28; border-radius: 6px; padding: 9px 10px; margin-top: 5px; }
.opt b { display: block; font-size: 14px; } .opt small { color: var(--mut); font-size: 12px; }
.opt.rec { border-color: var(--gold2); }
.opt:disabled { opacity: .5; }
.opt .go { color: var(--gold); font-weight: 700; white-space: nowrap; font-size: 13px; }
.toast { position: fixed; left: 50%; top: calc(64px + var(--st)); transform: translate(-50%, -6px); z-index: 40; max-width: 70%; text-align: center; background: rgba(20,14,10,.94); border: 1px solid var(--gold2); color: var(--ink); border-radius: 6px; padding: 8px 14px; font-size: 13px; opacity: 0; transition: .25s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toggle { display: flex; justify-content: space-between; align-items: center; padding: 9px 2px; border-bottom: 1px solid #2c2219; font-size: 14px; }
.sw { width: 46px; height: 26px; border-radius: 13px; background: #3a2e22; position: relative; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #d9cdb6; transition: transform .2s; }
.sw.on { background: #4caf6a; } .sw.on::after { transform: translateX(20px); }
.fine { font-size: 11px; color: var(--mut); text-align: center; margin-top: 10px; }
.fine a { color: var(--gold); }
.iimg.in { width: 1.4em; height: 1.4em; vertical-align: -0.4em; margin-right: 3px; }

@media (orientation: portrait) { .qtrack { left: calc(8px + var(--sl)); top: calc(82px + var(--st)); } }
.win-h, .overlay.side .sheet-h { cursor: move; touch-action: none; }
.titlescreen .row3 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .titlescreen .row3 .btn { width: 100%; }

/* ---------- phones and small screens ---------- */
@media (pointer: coarse), (max-width: 900px), (max-height: 500px) {
  /* chat: shorter, on a light backing so it reads over the world, and clear of the button column */
  .chat { max-height: 84px; background: rgba(10, 6, 3, .38); border-radius: 6px; padding: 3px 6px; font-size: 11px; }
}
@media (orientation: portrait) and (max-width: 900px) {
  .chat { width: calc(100vw - 205px - var(--sl) - var(--sr)); bottom: calc(26px + var(--sb)); }
  .left-btns { bottom: calc(120px + var(--sb)); }
  /* the character window fits the width; its tabs and stats wrap instead of running off the edge */
  #eqWin { left: calc(6px + var(--sl)); right: auto; width: min(520px, calc(100vw - 12px - var(--sl) - var(--sr))); max-width: calc(100vw - 12px - var(--sl) - var(--sr)); }
  #eqWin .eqbody { flex-wrap: wrap; justify-content: center; } #eqWin .eqstats { width: auto; min-width: 0; flex: 1 1 220px; }
  /* a shop or a person's window takes the top of the screen and your bag the bottom, never on top of each other */
  body:has(#invWin:not([hidden])) .overlay { align-items: flex-start; padding-top: calc(6px + var(--st)); }
  body:has(#invWin:not([hidden])) .overlay .panel { max-height: calc(100vh - 12px - var(--st) - var(--sb) - var(--invh, 300px)); }
  body:has(#invWin:not([hidden])) .overlay.side .panel { max-height: calc(100vh - 12px - var(--st) - var(--sb) - var(--invh, 300px)); }
  .tut { top: calc(140px + var(--st)); font-size: 12px; padding: 6px 10px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  /* a short screen: every window fits its height and scrolls */
  .chat { max-height: 66px; width: min(40vw, 360px); }
  .left-btns { bottom: calc(96px + var(--sb)); grid-template-columns: repeat(2, 46px); gap: 6px; }
  .left-btns .abtn, .left-btns button { width: 46px; height: 46px; }
  #eqWin { max-height: calc(100vh - 12px - var(--st) - var(--sb)); transform-origin: top left; }
  .panel { max-height: calc(100vh - 12px - var(--st) - var(--sb)); padding: 8px 10px; }
  .overlay { padding: 6px; }
  #mini { width: 96px; height: 96px; }
  .menu { top: calc(150px + var(--st)); }
  .tut { top: calc(8px + var(--st)); max-width: min(420px, calc(100vw - 300px)); font-size: 12px; padding: 5px 9px; }
}
@media (orientation: landscape) and (max-height: 500px), (orientation: landscape) and (max-width: 1000px) {
  /* a person's window and your bag side by side, never one under the other */
  body:has(#invWin:not([hidden])) .overlay { justify-content: flex-start; }
  body:has(#invWin:not([hidden])) .overlay .panel { max-width: calc(100vw - 20px - var(--sl) - var(--sr) - var(--invw, 280px)); }
}

/* chat on a phone: tap the log and it opens taller, with the box to type in just above the bottom bar */
@media (pointer: coarse) {
  .chat { cursor: pointer; }
  .chat.open { max-height: 38vh; background: rgba(10, 6, 3, .82); z-index: 31; }
  .chatin { bottom: calc(24px + var(--sb)); width: calc(100vw - 16px - var(--sl) - var(--sr)); font-size: 16px; padding: 8px 10px; }
  .chat.open + .chatin, .chatin:not([hidden]) { z-index: 32; }
}
@media (pointer: coarse) and (orientation: portrait) { .chat.open { width: calc(100vw - 16px - var(--sl) - var(--sr)); bottom: calc(66px + var(--sb)); } }
