:root {
  --ink: #fff;
  --panel: rgba(17, 19, 31, 0.72);
  --panel-2: rgba(17, 19, 31, 0.86);
  --line: rgba(255, 255, 255, 0.14);
  --red: #ff4d2e;
  --gold: #ffd23a;
  --cream: #fff4dc;
  --purple: #b98fe0;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --display: "Dela Gothic One", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #11131f; color: var(--ink);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", system-ui, sans-serif;
  -webkit-user-select: none; user-select: none; overscroll-behavior: none; }
button, input { font: inherit; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }

/* ---------- labels above heads ---------- */
#labels, #pops { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.tag { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; will-change: transform; white-space: nowrap; }
.tag .name { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(17, 19, 31, 0.62); border: 1px solid rgba(255,255,255,.18); text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.tag.me .name { background: rgba(255, 77, 46, 0.85); border-color: rgba(255,255,255,.5); }
.tag.npc .name { background: rgba(122, 82, 170, 0.9); border-color: rgba(255,255,255,.5); font-size: 13px; }
.tag.boss .name { background: rgba(200, 30, 40, 0.92); font-size: 14px; }
.bubble { display: none; max-width: 220px; white-space: normal; text-align: center; font-size: 15px; font-weight: 800; line-height: 1.25; color: #1b1b22; background: #fff; border-radius: 14px; padding: 6px 11px; box-shadow: 0 3px 10px rgba(0,0,0,.25); position: relative; animation: pop .22s ease-out; }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -7px; margin-left: -7px; border: 7px solid transparent; border-top-color: #fff; border-bottom: 0; }
.bubble.show { display: block; }
.tag.npc .bubble { background: var(--cream); font-size: 16px; }
.tag.npc .bubble::after { border-top-color: var(--cream); }
.bubble.hint { background: var(--gold); }
.bubble.hint::after { border-top-color: var(--gold); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.popnum { position: absolute; left: 0; top: 0; font-family: var(--display); font-size: 26px; color: var(--gold); text-shadow: 0 2px 0 #7a2a00, 0 0 8px rgba(0,0,0,.4); animation: rise .9s ease-out forwards; }
@keyframes rise { from { opacity: 1; margin-top: 0; } to { opacity: 0; margin-top: -60px; } }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; display: none; }
body.joined #hud { display: block; }
#hud .tl { position: absolute; top: calc(var(--sat) + 10px); left: calc(var(--sal) + 10px); display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
#hud .tr { position: absolute; top: calc(var(--sat) + 10px); right: calc(var(--sar) + 10px); display: flex; flex-direction: column; gap: 6px; align-items: flex-end; pointer-events: auto; }
.pill { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px 11px; font-size: 13px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.pill b { font-weight: 800; }
.pill .dot { opacity: .5; margin: 0 6px; }
.pill.rec { display: flex; align-items: baseline; gap: 8px; }
.pill.rec .rec-l { font-size: 12px; opacity: .9; }
.pill.rec b { font-family: var(--display); font-size: 22px; color: var(--gold); font-weight: 400; letter-spacing: .02em; }
.pill.rec small { opacity: .8; margin-left: 3px; }
.pill.rec .rec-n { white-space: nowrap; }
.pill.sm { font-size: 12px; padding: 4px 10px; }
.rank { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 7px 11px; font-size: 12px; min-width: 170px; }
.rank-h { font-weight: 800; color: var(--gold); margin-bottom: 3px; }
.rank ol { margin: 0; padding-left: 20px; }
.rank li { display: flex; justify-content: space-between; gap: 10px; }
.rank li span:last-child { font-weight: 800; }
.btn { pointer-events: auto; display: inline-flex; align-items: center; gap: 4px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: #fff; font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn.follow { background: linear-gradient(90deg, #ff4d2e, #ff8a3d); border-color: transparent; }
.btn:active { transform: scale(.96); }

#hud .bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 calc(var(--sar) + 10px) calc(var(--sab) + 10px) calc(var(--sal) + 10px); display: flex; flex-direction: column; align-items: center; gap: 7px; }
.raid { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.raid.on { background: rgba(170, 20, 30, 0.88); border-color: #ff8080; font-size: 14px; animation: pulse 1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(255, 60, 60, .25); } }
.hpbar { width: 120px; height: 10px; border-radius: 6px; background: rgba(0,0,0,.45); overflow: hidden; }
.hpbar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ffd23a, #ff4d2e); transition: width .15s; }
.me { display: flex; gap: 10px; font-size: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }
.me-p b { color: var(--gold); }
.hint { font-size: 12px; opacity: .85; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; max-width: 520px; pointer-events: auto; }
.act { position: relative; min-height: 62px; border-radius: 18px; border: 1px solid var(--line); background: var(--panel-2); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-weight: 800; font-size: 12px; cursor: pointer; touch-action: manipulation; }
.act i { font-style: normal; font-size: 24px; line-height: 1; }
.act.punch { background: linear-gradient(180deg, #ff6a3d, #e2341c); border-color: rgba(255,255,255,.35); }
.act.ready { box-shadow: 0 0 0 3px var(--gold), 0 0 18px rgba(255, 210, 58, .6); }
.act:active, .act.hit { transform: scale(.94); }
.act kbd { position: absolute; top: 4px; right: 7px; font-size: 9px; opacity: .55; font-family: inherit; }
@media (pointer: coarse) { .act kbd { display: none; } }

.chatbar { width: 100%; max-width: 520px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 16px; padding: 8px; pointer-events: auto; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.chips button { flex: none; border: 1px solid var(--line); background: rgba(255,255,255,.08); color: #fff; border-radius: 999px; padding: 6px 10px; font-size: 13px; cursor: pointer; }
#chatform { display: flex; gap: 6px; align-items: center; }
#chat-in { flex: 1; min-width: 0; border-radius: 10px; border: 1px solid var(--line); background: rgba(0,0,0,.35); color: #fff; padding: 10px 12px; font-size: 16px; -webkit-user-select: text; user-select: text; }
#chat-count { font-size: 11px; opacity: .7; width: 36px; text-align: right; }
#chat-count.over { color: #ff8080; opacity: 1; }
.send { border: 0; border-radius: 10px; background: var(--red); color: #fff; font-weight: 800; padding: 10px 14px; cursor: pointer; }

#toast { position: fixed; left: 50%; top: calc(var(--sat) + 64px); transform: translateX(-50%); background: rgba(17,19,31,.92); border: 1px solid var(--line); padding: 9px 16px; border-radius: 999px; font-size: 14px; font-weight: 700; opacity: 0; transition: opacity .25s; pointer-events: none; max-width: 92vw; text-align: center; z-index: 40; }
#toast.show { opacity: 1; }
#toast.big { font-size: 16px; background: rgba(170, 20, 30, .92); }

/* ---------- intro ---------- */
#intro { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: calc(var(--sat) + 16px) 16px calc(var(--sab) + 16px); background: radial-gradient(ellipse at center, rgba(17,19,31,.45), rgba(17,19,31,.82)); z-index: 30; overflow-y: auto; }
body.joined #intro { display: none; }
.card { width: 100%; max-width: 420px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.logo { width: 64px; height: 64px; border-radius: 18px; background: #fff; display: grid; place-items: center; font-size: 38px; box-shadow: 0 6px 20px rgba(0,0,0,.35); border: 3px solid var(--red); }
.kicker { font-family: var(--display); color: var(--gold); letter-spacing: .18em; font-size: 12px; }
h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1.15; text-shadow: 0 3px 0 rgba(0,0,0,.35); }
h1 span { color: var(--gold); font-size: 34px; }
.match { width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; }
.m-label { font-size: 12px; color: var(--gold); font-weight: 800; margin-bottom: 6px; }
.m-title { font-family: var(--display); font-size: 21px; line-height: 1.35; }
.m-title i { color: var(--red); font-style: normal; margin: 0 4px; }
.m-title em { font-style: normal; color: var(--cream); white-space: nowrap; font-size: min(1em, 5.1vw); }
.m-result { margin-top: 8px; font-size: 13px; font-weight: 700; opacity: .9; }
.lead { margin: 0; font-size: 14px; line-height: 1.6; opacity: .95; }
#join { width: 100%; display: flex; flex-direction: column; gap: 10px; align-items: center; }
#nick { width: 100%; border-radius: 14px; border: 1px solid var(--line); background: rgba(0,0,0,.45); color: #fff; padding: 14px 16px; font-size: 16px; text-align: center; -webkit-user-select: text; user-select: text; }
.cta { border: 0; border-radius: 999px; background: linear-gradient(180deg, #ff6a3d, #e2341c); color: #fff; font-family: var(--display); font-size: 22px; padding: 14px 40px; cursor: pointer; box-shadow: 0 6px 0 #8f1d0d, 0 10px 24px rgba(0,0,0,.35); }
.cta:active { transform: translateY(3px); box-shadow: 0 3px 0 #8f1d0d; }
.cta:disabled { opacity: .6; }
.foot { font-size: 12px; opacity: .75; }
.intro-err { color: #ffb0a0; font-weight: 700; font-size: 14px; }

/* ---------- help ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 35; }
.modal[hidden] { display: none; }
.sheet { width: 100%; max-width: 460px; max-height: 86vh; overflow-y: auto; background: #1a1d2d; border: 1px solid var(--line); border-radius: 20px; padding: 18px 18px 20px; }
.sheet h2 { margin: 0 0 10px; font-family: var(--display); font-weight: 400; font-size: 22px; }
.sheet ul { margin: 0 0 16px; padding-left: 18px; font-size: 14px; line-height: 1.65; }
.sheet li { margin-bottom: 6px; }
.sheet .cta { width: 100%; font-size: 18px; padding: 12px; }

/* ---------- small screens (phones) ---------- */
@media (max-width: 640px) {
  .tr .btn span { display: none; }
  .tr .btn { padding: 8px 10px; font-size: 16px; }
  .tr .btn.follow span { display: inline; font-size: 11px; }
  .tr .btn.follow { font-size: 12px; }
  .pill.rec { flex-direction: column; gap: 0; align-items: flex-start; }
  .pill.rec b { font-size: 20px; }
  .rank { display: none; }
  .hint { display: none; }
  .act kbd { display: none; }
  h1 { font-size: 26px; } h1 span { font-size: 30px; }
}
@media (max-height: 520px) { .hint, .me { display: none; } .act { min-height: 50px; } }

/* ---------- progression: vitals, stats panel, KO overlay ---------- */
.vitals { display: flex; align-items: center; gap: 8px; pointer-events: auto; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px 5px 6px; }
.lvb { border: 0; border-radius: 999px; background: linear-gradient(180deg, #ffd23a, #f0a020); color: #2a1a00; font-family: var(--display); font-size: 14px; padding: 4px 10px; cursor: pointer; white-space: nowrap; }
.lvb.can { box-shadow: 0 0 0 2px #fff, 0 0 14px rgba(255, 210, 58, .9); animation: glow 1.2s infinite; }
.lvb.big { font-size: 18px; padding: 5px 14px; cursor: default; }
@keyframes glow { 50% { box-shadow: 0 0 0 2px #fff, 0 0 4px rgba(255, 210, 58, .4); } }
.hpw { display: flex; align-items: center; gap: 5px; }
.hp-ic { font-size: 14px; }
.hpb { position: relative; width: min(42vw, 180px); height: 16px; border-radius: 8px; background: rgba(0,0,0,.55); overflow: hidden; border: 1px solid rgba(255,255,255,.2); }
.hpb i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #3ddc84, #22b866); transition: width .2s; }
.hpb i.low { background: linear-gradient(90deg, #ff6a3d, #e2341c); }
.hpb span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-weight: 800; text-shadow: 0 1px 2px rgba(0,0,0,.8); }
.yen { font-family: var(--display); color: var(--gold); font-size: 15px; white-space: nowrap; }
.yen.big { font-size: 22px; }
.btn.up { background: linear-gradient(90deg, #f0a020, #ffd23a); color: #2a1a00; border-color: transparent; }
.btn.up.can { animation: glow 1.2s infinite; box-shadow: 0 0 0 2px #fff; }
.tlv { display: inline-block; margin-right: 5px; padding: 0 5px; border-radius: 6px; background: rgba(255, 210, 58, .92); color: #2a1a00; font-size: 10px; font-weight: 800; }
.tlv.rb { background: linear-gradient(90deg, #b98fe0, #ff9ad5); color: #fff; }
.tlv:empty { display: none; }
.popnum.dmg { color: #ff5b4a; text-shadow: 0 2px 0 #5a0d06, 0 0 8px rgba(0,0,0,.5); }
.popnum.lvup { font-size: 30px; color: #7dffb0; text-shadow: 0 2px 0 #0d4a2a, 0 0 10px rgba(0,0,0,.5); animation-duration: 1.4s; }
.st-sheet { max-width: 480px; }
.st-top { display: flex; align-items: center; justify-content: space-between; }
.st-top h2 { margin: 0; }
.st-x { border: 0; background: rgba(255,255,255,.1); color: #fff; width: 34px; height: 34px; border-radius: 50%; font-size: 16px; cursor: pointer; }
.st-sum { display: flex; align-items: center; gap: 12px; margin: 10px 0 4px; }
.st-tip { font-size: 13px; opacity: .85; margin: 4px 0 10px; line-height: 1.5; }
.st-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 14px; padding: 9px 10px; margin-bottom: 8px; }
.st-ic { font-size: 26px; text-align: center; }
.st-name { font-size: 15px; } .st-name b { margin-right: 6px; }
.st-lv { font-family: var(--display); color: var(--gold); }
.st-eff { font-size: 12px; opacity: .9; margin: 2px 0 5px; }
.st-xp { height: 8px; border-radius: 5px; background: rgba(0,0,0,.45); overflow: hidden; }
.st-xp i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7cc8ff, #3a8af0); transition: width .25s; }
.st-p .st-xp i { background: linear-gradient(90deg, #ff9a50, #ff4d2e); }
.st-h .st-xp i { background: linear-gradient(90deg, #3ddc84, #22b866); }
.st-how { font-size: 11px; opacity: .7; margin-top: 4px; }
.st-buy { border: 0; border-radius: 12px; background: linear-gradient(180deg, #ffd23a, #f0a020); color: #2a1a00; font-weight: 800; font-size: 13px; padding: 10px 10px; min-width: 92px; cursor: pointer; }
.st-buy.off { background: rgba(255,255,255,.12); color: rgba(255,255,255,.55); }
.st-buy:active { transform: scale(.96); }
.rb-box { background: linear-gradient(135deg, rgba(185,143,224,.22), rgba(255,154,213,.16)); border: 1px solid rgba(185,143,224,.5); border-radius: 14px; padding: 10px 12px; margin-top: 4px; }
.rb-h { font-weight: 800; font-size: 15px; } .rb-h span { color: var(--purple); margin-left: 6px; }
.rb-d { font-size: 12px; line-height: 1.55; margin: 4px 0 8px; opacity: .92; }
.rb-btn { width: 100%; font-size: 17px !important; padding: 11px !important; background: linear-gradient(180deg, #c49af0, #8d5bd0) !important; box-shadow: 0 5px 0 #4f2c80 !important; }
.rb-btn:disabled { opacity: .45; }
.rb-btn.arm { background: linear-gradient(180deg, #ff6a3d, #e2341c) !important; box-shadow: 0 5px 0 #8f1d0d !important; }
#dead { position: fixed; inset: 0; z-index: 36; display: flex; align-items: center; justify-content: center; pointer-events: none; background: radial-gradient(ellipse at center, rgba(120,0,0,.15), rgba(60,0,0,.55)); }
#dead[hidden] { display: none; }
.dead-card { text-align: center; text-shadow: 0 3px 0 rgba(0,0,0,.45); }
#dead.in .dead-card { animation: kopop .45s cubic-bezier(.2,1.6,.4,1); }
@keyframes kopop { from { transform: scale(.3) rotate(-8deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
.dead-h { font-family: var(--display); font-size: 40px; color: #fff; -webkit-text-stroke: 2px #b01010; }
.dead-s { font-size: 16px; font-weight: 800; margin-top: 4px; }
.dead-c { font-family: var(--display); font-size: 64px; color: var(--gold); margin: 6px 0; }
.dead-tip { font-size: 13px; font-weight: 700; background: rgba(0,0,0,.45); border-radius: 999px; padding: 6px 12px; display: inline-block; }
#flash { position: fixed; inset: 0; pointer-events: none; z-index: 34; opacity: 0; background: radial-gradient(ellipse at center, rgba(255,0,0,0) 40%, rgba(255,20,20,.55)); }
#flash.on { animation: flash .45s ease-out; }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }
.pick { width: 100%; }
#pick-gl { width: 100%; height: 150px; display: block; cursor: pointer; }
.pick-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: -4px; }
.pick-b { border-radius: 12px; border: 2px solid var(--line); background: rgba(0,0,0,.35); color: #fff; padding: 9px; font-weight: 800; font-size: 15px; cursor: pointer; }
.pick-b.on { border-color: var(--gold); background: rgba(255,210,58,.16); color: var(--gold); }
@media (max-width: 640px) {
  .tr .btn.up.keep span { display: inline; font-size: 12px; }
  .tr .btn.up.keep { font-size: 13px; }
  #pick-gl { height: 128px; }
  .dead-h { font-size: 32px; }
}
@media (max-height: 520px) { .vitals { padding: 3px 10px 3px 4px; } .hpb { height: 13px; } }
body:not(.joined) #labels, body:not(.joined) #pops { display: none; }

/* ---------- training ground / auto punch / gates ---------- */
.actions { grid-template-columns: repeat(5, 1fr); max-width: 600px; }
.act.auto.on { background: linear-gradient(180deg, #3ddc84, #18a85a); border-color: rgba(255,255,255,.5); box-shadow: 0 0 0 3px rgba(61,220,132,.35); }
.act.auto.on i { animation: bob 0.85s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-3px) rotate(-8deg); } }
#fade { position: fixed; inset: 0; background: #0b0d14; opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 33; }
#fade.on { opacity: 1; }
.tag.sign .name { background: rgba(255, 210, 58, .95); color: #2a1a00; font-size: 13px; border-color: rgba(255,255,255,.6); }
.popnum.xp { color: #7cc8ff; font-size: 22px; text-shadow: 0 2px 0 #0d2a4a, 0 0 8px rgba(0,0,0,.45); }
@media (max-width: 640px) { .act { min-height: 58px; font-size: 11px; } .act i { font-size: 22px; } }

/* ---------- plaza: prompt button, equipment tags, codes ---------- */
.prompt { pointer-events: auto; display: inline-flex; align-items: center; gap: 10px; border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 900; font-size: 15px; color: #2a1a00; background: linear-gradient(180deg, #ffe36a, #ffb52e); box-shadow: 0 5px 0 #a8660f, 0 8px 20px rgba(0,0,0,.35); cursor: pointer; animation: glow 1.2s infinite; }
.prompt[hidden] { display: none; }
.prompt kbd { font-family: inherit; font-size: 11px; background: rgba(0,0,0,.18); border-radius: 6px; padding: 2px 6px; }
.prompt.wait { background: rgba(17,19,31,.85); color: #fff; box-shadow: none; animation: none; border: 1px solid var(--line); }
.prompt:active { transform: translateY(3px); box-shadow: 0 2px 0 #a8660f; }
@media (pointer: coarse) { .prompt kbd { display: none; } }
.tag.sign.tier .name { background: rgba(61, 220, 132, .95); color: #08301a; }
.tag.sign.tier.locked .name { background: rgba(40, 44, 58, .92); color: #fff; border-color: rgba(255,255,255,.25); }
.tag.sign.gift.ready .name { background: linear-gradient(90deg, #ff6a8a, #ffd23a); color: #2a1a00; animation: glow 1s infinite; }
.popnum.xp.spd { color: #9fe8ff; }
.popnum.xp.hp { color: #7dffb0; }
.popnum.xp.big { font-size: 28px; }
.code-box { background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin: 4px 0 8px; }
#code-form { display: flex; gap: 8px; margin-top: 6px; }
#code-in { flex: 1; min-width: 0; border-radius: 10px; border: 1px solid var(--line); background: rgba(0,0,0,.35); color: #fff; padding: 10px 12px; font-size: 16px; text-transform: uppercase; -webkit-user-select: text; user-select: text; }

/* ---------- shop (コーデ / 武器スキン / エフェクト) ---------- */
.tr .btn.shop { background: linear-gradient(180deg, #ff8fc1, #ff5d8f); color: #fff; box-shadow: 0 4px 0 #a8305a; border: 0; }
@media (max-width: 720px) { .tr .btn.shop.keep span { display: inline; font-size: 12px; } .tr .btn.shop.keep { font-size: 13px; } }
.shop-sheet { max-width: 860px; position: relative; padding-bottom: 14px; }
.shop-bal { display: flex; gap: 10px; align-items: center; margin-left: auto; margin-right: 12px; font-family: var(--display); font-size: 18px; }
.shop-bal .gemb { color: #9fe8ff; }
.shop-tabs { display: flex; gap: 6px; margin: 6px 0 10px; }
.shop-tab { flex: 1; border: 1px solid var(--line); background: rgba(255,255,255,.05); color: #fff; border-radius: 12px; padding: 9px 6px; font-weight: 800; font-size: 14px; cursor: pointer; }
.shop-tab.on { background: linear-gradient(180deg, #ffe36a, #ffb52e); color: #2a1a00; border-color: transparent; }
.shop-main { display: grid; grid-template-columns: 300px 1fr; gap: 12px; }
.shop-view { background: radial-gradient(circle at 50% 35%, #2b3352, #151827); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
#shop-gl { width: 100%; height: 300px; display: block; }
.shop-info { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; }
.shop-rar { font-size: 12px; font-weight: 900; letter-spacing: .04em; }
.shop-nm { font-weight: 900; font-size: 17px; }
.shop-ds { font-size: 13px; color: #c9cfdf; min-height: 18px; }
.shop-src { font-size: 12px; color: #ffb3cf; min-height: 16px; }
.shop-act { margin-top: 6px; border: 0; border-radius: 12px; padding: 11px; font-weight: 900; font-size: 15px; cursor: pointer; color: #2a1a00; background: linear-gradient(180deg, #ffe36a, #ffb52e); box-shadow: 0 4px 0 #a8660f; }
.shop-act.gem { color: #06283a; background: linear-gradient(180deg, #b8f3ff, #5fd0ff); box-shadow: 0 4px 0 #1f7fa8; }
.shop-act.ghost { color: #fff; background: rgba(255,255,255,.08); box-shadow: none; border: 1px solid var(--line); }
.shop-act:disabled { opacity: .55; cursor: default; }
.shop-act:active:not(:disabled) { transform: translateY(2px); }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; align-content: start; max-height: 430px; overflow-y: auto; padding: 2px; }
.shop-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 6px 8px; border-radius: 14px; cursor: pointer; color: #fff;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02)); border: 2px solid color-mix(in srgb, var(--rc) 55%, transparent); }
.shop-card .ic { font-size: 30px; line-height: 1.1; }
.shop-card .n { font-size: 12px; font-weight: 800; text-align: center; line-height: 1.25; min-height: 30px; display: flex; align-items: center; }
.shop-card .pr { font-size: 12px; font-weight: 900; color: var(--gold); }
.shop-card .pr.gem { color: #9fe8ff; }
.shop-card.own .pr { color: #9aa3b5; }
.shop-card.on { background: linear-gradient(180deg, color-mix(in srgb, var(--rc) 30%, transparent), rgba(255,255,255,.03)); }
.shop-card.on .pr { color: #7dffb0; }
.shop-card.sel { border-color: var(--rc); box-shadow: 0 0 0 2px var(--rc), 0 0 16px color-mix(in srgb, var(--rc) 60%, transparent); }
.shop-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.shop-gems { border: 0; border-radius: 999px; padding: 9px 14px; font-weight: 900; cursor: pointer; color: #06283a; background: linear-gradient(180deg, #b8f3ff, #5fd0ff); }
.shop-note { font-size: 12px; color: #9aa3b5; }
.gem-sheet { position: absolute; inset: 0; background: rgba(10,12,20,.72); display: flex; align-items: center; justify-content: center; border-radius: 20px; }
.gem-sheet[hidden] { display: none; }
.gem-box { background: #1f2438; border: 1px solid var(--line); border-radius: 18px; padding: 18px; max-width: 320px; text-align: center; }
.gem-ic { font-size: 42px; }
.gem-box p { white-space: pre-line; font-size: 14px; line-height: 1.6; margin: 8px 0 12px; }
.popnum.word { font-size: 30px; color: #ffffff; -webkit-text-stroke: 1.5px #2a1a00; text-shadow: 0 3px 0 #ff5d8f, 0 0 10px rgba(0,0,0,.5); animation-duration: 1.1s; }
@media (max-width: 720px) {
  .shop-sheet { padding: 12px 12px 12px; max-height: 92vh; }
  .shop-main { grid-template-columns: 1fr; }
  #shop-gl { height: 200px; }
  .shop-view { flex-direction: row; }
  .shop-view #shop-gl { width: 46%; }
  .shop-info { width: 54%; justify-content: center; }
  .shop-grid { max-height: 34vh; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .shop-card .ic { font-size: 24px; }
  .shop-bal { font-size: 15px; gap: 6px; margin-right: 6px; }
}

.tag.sign.mine .name { background: linear-gradient(90deg, #ffd23a, #ffb52e); color: #2a1a00; }
.shop-tabs { flex-wrap: wrap; }
@media (max-width: 720px) { .shop-tab { font-size: 12px; padding: 8px 4px; } }
.shop-tab i { font-style: normal; }
.shop-tab .s { display: none; }
@media (max-width: 720px) { .shop-tab i { display: none; } .shop-tab .l { display: none; } .shop-tab .s { display: inline; } .shop-tab { font-size: 13px; padding: 9px 2px; white-space: nowrap; } }

/* マイマシン button + picker */
.act.my { background: linear-gradient(180deg, #3a2f12, #241d0c); border-color: rgba(255,210,58,.5); }
.act.my.on { background: linear-gradient(180deg, #ffe36a, #ffb52e); color: #2a1a00; box-shadow: 0 0 0 2px #ffd23a, 0 0 18px rgba(255,210,58,.6); }
.act.my[hidden] { display: none; }
.my-pick { position: absolute; bottom: calc(100% + 8px); right: 0; display: flex; flex-direction: column; gap: 6px; background: rgba(17,19,31,.95); border: 1px solid var(--line); border-radius: 14px; padding: 8px; z-index: 5; pointer-events: auto; }
.my-pick[hidden] { display: none; }
.my-pick button { border: 0; border-radius: 10px; padding: 10px 12px; font-weight: 900; font-size: 14px; color: #2a1a00; background: linear-gradient(180deg, #ffe36a, #ffb52e); cursor: pointer; white-space: nowrap; }
.actions { position: relative; }
.actions.has-my { grid-template-columns: repeat(6, 1fr); max-width: 690px; }
@media (max-width: 720px) { .actions.has-my { gap: 5px; } .actions.has-my .act span { font-size: 10px; } }

/* event banner + 引き継ぎコード */
.evbar { pointer-events: none; padding: 7px 16px; border-radius: 999px; font-weight: 900; font-size: 14px; color: #2a1a00; background: linear-gradient(90deg, #ffd23a, #ff8a3d, #ff5d8f); box-shadow: 0 0 18px rgba(255,138,61,.55); animation: glow 1.4s infinite; }
.evbar[hidden] { display: none; }
.save-box small { font-weight: 600; font-size: 11px; color: #9aa3b5; margin-left: 6px; }
.save-row { display: flex; gap: 8px; margin-top: 6px; }
#save-code, #save-in { flex: 1; min-width: 0; border-radius: 10px; border: 1px solid var(--line); background: rgba(0,0,0,.35); color: #fff; padding: 9px 10px; font-size: 14px; font-family: ui-monospace, Menlo, monospace; -webkit-user-select: text; user-select: text; }
#save-form { display: flex; gap: 8px; margin-top: 6px; }
.save-note { margin: 6px 0 0; font-size: 11px; color: #ff9aa8; }
.save-left { margin-top: 6px; font-size: 13px; font-weight: 800; color: #ffd23a; }
.save-left[hidden] { display: none; }
#save-code { font-size: 18px; letter-spacing: .12em; text-align: center; font-weight: 800; }
#save-in { text-transform: uppercase; letter-spacing: .08em; }
#dup { z-index: 60; }
.dup-p { font-size: 14px; line-height: 1.7; color: #c9cfdf; margin: 0 0 14px; }
