:root {
  --panel: rgba(20, 22, 38, .92);
  --line: rgba(255, 255, 255, .14);
  --text: #fff;
  --muted: #b9bfd6;
  --accent: #ffd23f;
  --green: #4cd964;
  --red: #ff4d4d;
  --font: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: #1b1530; color: var(--text);
  font-family: var(--font); user-select: none; -webkit-user-select: none; touch-action: none;
}
#game, #game canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }

.hud { position: fixed; z-index: 10; pointer-events: none; }
b { font-weight: 800; }

/* ステータス */
#stats { top: max(10px, env(safe-area-inset-top)); left: 10px; display: flex; flex-direction: column; gap: 6px; }
.stat {
  display: flex; align-items: baseline; gap: 6px; padding: 5px 12px 5px 8px; border-radius: 12px;
  background: rgba(0, 0, 0, .45); border: 2px solid rgba(255, 255, 255, .12); min-width: 150px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .5);
}
.stat .ico { font-size: 18px; }
.stat b { font-size: 20px; }
.stat small { color: var(--muted); font-size: 12px; margin-left: auto; padding-left: 8px; }
.stat.money b { color: #7dff8a; }
.stat.reb b { color: #c9a7ff; }
.stat.ev b { color: #c9a7ff; font-variant-numeric: tabular-nums; }
.stat.ev.on { border-color: #b388ff; background: rgba(80, 30, 160, .6); animation: evPulse 1.2s ease-in-out infinite; }
.stat.ev.on small { color: #fff; font-weight: 800; }
@keyframes evPulse { 50% { box-shadow: 0 0 16px #b388ff; } }
.mut { display: inline-block; padding: 0 6px; margin: 1px 2px; border-radius: 6px; font-size: 11px; font-weight: 900; color: #1d1240; white-space: nowrap; }
.mut-gold { background: #ffd23f; }
.mut-diamond { background: #8ff3ff; }
.mut-galaxy { background: linear-gradient(90deg, #6a3cff, #ff5cf4); color: #fff; }
.mut-pumpkin { background: linear-gradient(90deg, #ff8c1a, #ffb347); color: #2a1000; }
.mut-rainbowpumpkin { background: linear-gradient(90deg, #ff5e5e, #ffd23f, #4cd964, #3a8dff, #b05cff); color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, .5); }
.mut-pumpkin-card { border-color: rgba(255, 140, 26, .8) !important; }
.mut-rainbowpumpkin-card { border-color: rgba(255, 119, 233, .8) !important; }
/* ハロウィン */
.stat.pk.on { border-color: #ff9f1c; background: rgba(120, 50, 0, .6); animation: evPulse 1.2s ease-in-out infinite; }
.stat.pk b { color: #ffb347; }
.halloween-badge {
  display: inline-block; margin: 10px 0 0; padding: 5px 14px; border-radius: 999px; font-size: 12px; font-weight: 900; color: #2a1000;
  background: linear-gradient(90deg, #ff8c1a, #ffd23f); box-shadow: 0 0 18px rgba(255, 140, 26, .6);
}
body.halloween #title {
  background:
    radial-gradient(ellipse at 50% 38%, rgba(255, 140, 26, .32), transparent 55%),
    linear-gradient(180deg, rgba(40, 10, 60, .65) 0%, rgba(40, 10, 60, .3) 40%, rgba(15, 5, 20, .9) 100%);
}
body.halloween .title-bg .fb { background: linear-gradient(135deg, #ffb347, #ff7a1a); border-color: #a34a00; }
body.halloween .title-bg .fb::after { content: '🎃'; font-size: calc(var(--s) * .5); }
#reveal .mut { font-size: 18px; vertical-align: middle; }
.card.rebirth { border-color: #b388ff; }
.card .warn { color: #ff9e80; font-size: 12px; }
.btn.reb { background: #b388ff; color: #22104a; }

#menu { top: max(10px, env(safe-area-inset-top)); right: 10px; display: flex; gap: 8px; pointer-events: auto; }
#menu button {
  width: 64px; height: 64px; border-radius: 16px; border: 3px solid rgba(0, 0, 0, .35);
  background: linear-gradient(#ffe066, #ffb703); font-size: 24px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; box-shadow: 0 4px 0 rgba(0, 0, 0, .35); color: #3b2a00;
}
#menu button span { font-size: 10px; font-weight: 800; white-space: nowrap; letter-spacing: -.04em; }
#menu button:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .35); }

#zoneLabel {
  top: max(14px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  font-size: 18px; font-weight: 900; padding: 4px 16px; border-radius: 999px;
  background: rgba(0, 0, 0, .4); text-shadow: 0 2px 0 rgba(0, 0, 0, .6); white-space: nowrap;
}

#prompt {
  bottom: 22%; left: 50%; transform: translateX(-50%); padding: 10px 20px; border-radius: 14px;
  background: rgba(0, 0, 0, .6); border: 2px solid rgba(255, 255, 255, .25); font-size: 18px; font-weight: 800;
  white-space: nowrap;
}
#prompt kbd {
  display: inline-block; background: #fff; color: #222; border-radius: 6px; padding: 0 8px; margin-right: 8px;
  box-shadow: 0 3px 0 #999; font-family: inherit;
}

#lockHint {
  bottom: 16px; left: 50%; transform: translateX(-50%); padding: 6px 14px; border-radius: 999px;
  background: rgba(0, 0, 0, .55); font-size: 14px; font-weight: 800; white-space: nowrap;
}

/* トースト */
#toasts { position: fixed; top: 22%; left: 50%; transform: translateX(-50%); z-index: 30; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; width: 92vw; }
.toast {
  padding: 8px 18px; border-radius: 12px; background: rgba(0, 0, 0, .7); font-weight: 900; font-size: 20px;
  text-align: center; text-shadow: 0 2px 0 rgba(0, 0, 0, .6); animation: toastIn .25s ease-out;
  border: 2px solid rgba(255, 255, 255, .2);
}
.toast.big { font-size: 30px; padding: 10px 24px; }
.toast.out { opacity: 0; transform: translateY(-10px); transition: .4s; }
@keyframes toastIn { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* 飛行・追跡HUD */
#flightHud { top: 70px; left: 50%; transform: translateX(-50%); text-align: center; }
#flightHud b { display: block; font-size: 56px; text-shadow: 0 4px 0 rgba(0, 0, 0, .5); }
#flightHud span { font-size: 20px; font-weight: 800; text-shadow: 0 2px 0 rgba(0, 0, 0, .5); }
#chaseHud {
  top: 64px; left: 50%; transform: translateX(-50%); background: rgba(0, 0, 0, .55); border-radius: 14px;
  padding: 8px 16px; min-width: 220px; border: 2px solid rgba(255, 80, 80, .6);
}
#chaseHud .row { display: flex; justify-content: space-between; gap: 16px; font-weight: 800; }
#chaseHud .row b { font-size: 20px; }
#chaseHud .danger b { color: #ff6b6b; }
#chaseHud.close { animation: pulse .4s infinite alternate; }
@keyframes pulse { to { border-color: #ff2020; box-shadow: 0 0 20px rgba(255, 0, 0, .6); } }

/* タイミング */
#timing { position: fixed; bottom: 30%; left: 50%; transform: translateX(-50%); z-index: 20; width: min(420px, 86vw); text-align: center; pointer-events: none; }
#timing .label { font-size: 22px; font-weight: 900; margin-bottom: 6px; text-shadow: 0 2px 0 #000; }
#timing .bar { position: relative; height: 28px; border-radius: 14px; background: #ff6b6b; border: 3px solid #fff; overflow: hidden; }
#timing .good { position: absolute; left: 30%; width: 40%; top: 0; bottom: 0; background: #ffd23f; }
#timing .perfect { position: absolute; left: 45%; width: 10%; top: 0; bottom: 0; background: #4cd964; }
#timing .cursor { position: absolute; top: -4px; bottom: -4px; width: 6px; margin-left: -3px; background: #fff; box-shadow: 0 0 6px #000; }

/* ガチャ演出 */
#reveal { position: fixed; top: 18%; left: 50%; transform: translateX(-50%); z-index: 25; text-align: center; pointer-events: none; width: 92vw; }
#reveal .rarity { font-size: 26px; font-weight: 900; letter-spacing: .1em; text-shadow: 0 3px 0 rgba(0, 0, 0, .6); }
#reveal .name { font-size: 44px; font-weight: 900; text-shadow: 0 4px 0 rgba(0, 0, 0, .6); }
#reveal .income { font-size: 22px; font-weight: 800; color: #7dff8a; text-shadow: 0 2px 0 rgba(0, 0, 0, .6); }
#reveal.pop .name { animation: pop .5s ease-out; }
@keyframes pop { 0% { transform: scale(.3); } 70% { transform: scale(1.2); } 100% { transform: scale(1); } }
.rainbow-text {
  background: linear-gradient(90deg, #ff5e5e, #ffd23f, #4cd964, #3a8dff, #b05cff, #ff5e5e); background-size: 200%;
  -webkit-background-clip: text; background-clip: text; color: transparent !important; animation: rb 2s linear infinite;
  text-shadow: none !important; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .6));
}
@keyframes rb { to { background-position: 200% 0; } }
.cosmic-text {
  background: linear-gradient(90deg, #8a7dff, #ff5cf4, #7df9ff, #fff27a, #8a7dff); background-size: 200%;
  -webkit-background-clip: text; background-clip: text; color: transparent !important; animation: rb 1.4s linear infinite;
  text-shadow: none !important; filter: drop-shadow(0 0 4px rgba(138, 125, 255, .9)) drop-shadow(0 3px 0 rgba(0, 0, 0, .6));
}

/* ラベル */
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.wlabel {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); text-align: center; white-space: nowrap;
  font-weight: 800; text-shadow: 0 2px 0 rgba(0, 0, 0, .8), 0 0 4px rgba(0, 0, 0, .8); font-size: 13px; line-height: 1.25;
}
.wlabel .n { font-size: 14px; }
.wlabel .m { color: #7dff8a; font-size: 15px; }
.wlabel .s { color: #ffd23f; }
.wlabel.boss .n { color: #ff6b6b; font-size: 16px; }

/* スマホ操作 */
.touch-only { display: none; }
body.touch .touch-only { display: block; }
body.touch #actionBtn.hidden { display: none !important; }
#joystick {
  position: fixed; left: 24px; bottom: max(24px, env(safe-area-inset-bottom)); width: 130px; height: 130px; border-radius: 50%;
  background: rgba(255, 255, 255, .12); border: 3px solid rgba(255, 255, 255, .3); z-index: 15; touch-action: none;
}
#joystick .knob {
  position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%;
  background: rgba(255, 255, 255, .7); box-shadow: 0 3px 8px rgba(0, 0, 0, .4); pointer-events: none;
}
#actionBtn {
  position: fixed; right: 24px; bottom: max(36px, env(safe-area-inset-bottom)); width: 100px; height: 100px; border-radius: 50%;
  z-index: 15; border: 4px solid rgba(0, 0, 0, .3); background: radial-gradient(circle at 35% 30%, #ffe680, #ffb703);
  font-size: 18px; font-weight: 900; color: #3b2a00; box-shadow: 0 5px 0 rgba(0, 0, 0, .35); touch-action: none;
}
#actionBtn:active { transform: translateY(3px); }
/* ダッシュ（--p: クールダウンの進み具合 0〜1） */
.pc-only { display: block; }
body.touch .pc-only { display: none !important; }
#dashBtn {
  position: fixed; right: 136px; bottom: max(36px, env(safe-area-inset-bottom)); width: 72px; height: 72px; border-radius: 50%;
  z-index: 15; border: 3px solid rgba(0, 0, 0, .3); font-size: 24px; line-height: 1; color: #fff; touch-action: none;
  background: conic-gradient(rgba(122, 200, 255, .95) calc(var(--p, 1) * 360deg), rgba(40, 50, 70, .85) 0);
  box-shadow: 0 4px 0 rgba(0, 0, 0, .35); opacity: .75;
}
#dashBtn span { display: block; font-size: 11px; font-weight: 900; }
#dashBtn.ready { opacity: 1; }
#dashBtn:active { transform: translateY(3px); }
#dashHud {
  left: 50%; bottom: 58px; transform: translateX(-50%); padding: 4px 12px 8px; border-radius: 10px; font-weight: 800; font-size: 13px;
  background: rgba(0, 0, 0, .45); color: #ccd; overflow: hidden;
}
#dashHud kbd { font-family: inherit; padding: 0 5px; border-radius: 4px; background: rgba(255, 255, 255, .2); font-size: 11px; }
#dashHud i { position: absolute; left: 0; bottom: 0; height: 4px; width: calc(var(--p, 1) * 100%); background: #7ac8ff; }
#dashHud.ready { color: #fff; }
.card.power { flex-wrap: wrap; }
.card.power input { width: 100%; margin: 6px 0; }
#powerVal { color: #ffd23f; margin-left: 6px; }
body.touch #prompt { bottom: 200px; }

#fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; z-index: 40; transition: opacity .35s; }
#fade.on { opacity: 1; }

/* パネル */
.panel {
  position: fixed; z-index: 50; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, 94vw);
  max-height: 86vh; display: flex; flex-direction: column; background: var(--panel); border: 3px solid var(--line);
  border-radius: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); user-select: text;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 2px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 22px; }
.close { width: 40px; height: 40px; border-radius: 12px; border: none; background: #ff5e5e; color: #fff; font-size: 20px; font-weight: 900; }
.panel-body { padding: 14px 16px; overflow-y: auto; touch-action: pan-y; }

.card {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .06);
  border: 2px solid var(--line); margin-bottom: 10px;
}
.card .icon { font-size: 34px; width: 48px; text-align: center; }
.card .info { flex: 1; min-width: 0; }
.card .info h3 { margin: 0 0 2px; font-size: 17px; }
.card .info p { margin: 0; color: var(--muted); font-size: 13px; }
.card .btns { display: flex; flex-direction: column; gap: 6px; }
.btn {
  min-width: 108px; padding: 8px 10px; border-radius: 12px; border: none; font-weight: 900; font-size: 14px;
  background: var(--green); color: #053b10; box-shadow: 0 3px 0 rgba(0, 0, 0, .35);
}
.btn small { display: block; font-size: 12px; font-weight: 800; }
.btn:disabled { background: #555a6e; color: #aaa; box-shadow: none; cursor: default; }
.btn.sell { background: #ff8a65; color: #3a1000; }
.btn:not(:disabled):active { transform: translateY(2px); box-shadow: none; }
.rar { font-weight: 900; }
.empty-slot { color: var(--muted); font-size: 14px; }
.tabs { display: flex; gap: 6px; padding: 10px 16px 0; }
.best-row { padding: 8px 16px 0; }
.btn.best { width: 100%; background: #ffd23f; color: #3b2a00; }
.tab { flex: 1; padding: 8px; border-radius: 10px; border: 2px solid var(--line); background: transparent; color: var(--muted); font-weight: 800; cursor: pointer; }
.tab b { margin-left: 4px; font-size: 12px; opacity: .85; }
.tab.active { background: var(--accent); color: #3b2a00; border-color: var(--accent); }
.card .thumb { width: 56px; height: 56px; flex: 0 0 56px; }
.card .cnt { color: #9ad0ff; font-size: 14px; }
.btn.store { background: #9ad0ff; color: #0b2540; }

.dex-sum { margin: 0 0 10px; color: var(--muted); }

/* インデックス */
#menu button { position: relative; }
#subMenu {
  top: calc(max(10px, env(safe-area-inset-top)) + 78px); right: 10px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  pointer-events: auto;
}
#subMenu > * {
  max-width: 62vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 5px 12px; border-radius: 999px;
  border: 2px solid #7a5cff; background: rgba(20, 16, 50, .78); color: #fff; font-family: var(--font); font-size: 12px; font-weight: 800; line-height: 1.3; text-decoration: none; cursor: pointer;
}
#subMenu a { border-color: #ffd23f; }
/* 公認オープンチャットの宣伝 */
.openchat {
  display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: 16px; text-decoration: none; text-align: left;
  color: #fff; background: linear-gradient(135deg, #06c755, #04a648); box-shadow: 0 4px 0 #037a35, 0 0 18px rgba(6, 199, 85, .35);
  transition: transform .12s, filter .15s;
}
.openchat:hover { filter: brightness(1.08); transform: translateY(-1px); }
.openchat .oc-icon { font-size: 26px; }
.openchat .oc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.openchat small { font-size: 11px; opacity: .9; }
.openchat b { font-size: 15px; }
.openchat em { font-style: normal; font-size: 12px; opacity: .95; }
.openchat .oc-go { flex: 0 0 auto; padding: 5px 12px; border-radius: 999px; background: #fff; color: #06c755; font-weight: 900; font-size: 13px; }
.panel .openchat { margin: 0 0 12px; }
#subMenu .oc-mini { border-color: #06c755; background: rgba(6, 120, 60, .75); }
/* フレンド */
#hudFriendBtn { position: relative; overflow: visible !important; }
#friendPanel { width: min(560px, 96vw); }
.fr-room { display: flex; flex-direction: column; gap: 6px; padding: 12px; margin-bottom: 12px; border-radius: 16px; border: 1px solid rgba(122, 200, 255, .5); background: linear-gradient(135deg, rgba(122, 200, 255, .18), rgba(255, 255, 255, .03)); }
.fr-room.on { border-color: rgba(125, 255, 138, .7); background: linear-gradient(135deg, rgba(125, 255, 138, .2), rgba(255, 255, 255, .03)); }
.fr-room small { color: var(--muted); font-size: 12px; }
.fr-status { margin: 0 0 8px; color: #ffd23f; font-size: 13px; font-weight: 800; }
.fr-me { font-size: 13px; color: var(--muted); }
.fr-me b { color: #ffd23f; user-select: text; }
.fr-add { display: flex; gap: 8px; margin-bottom: 8px; }
.fr-add input { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .22); background: rgba(0, 0, 0, .3); color: #fff; font: inherit; user-select: text; }
.fr-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 6px; border-radius: 14px; background: rgba(255, 255, 255, .06); }
.fr-row .av { font-size: 24px; }
.fr-row > div { flex: 1; min-width: 0; }
.fr-row b { display: block; }
.fr-row small { color: var(--muted); font-size: 12px; }
.fr-row small .on { color: #7dff8a; }
.fr-row small .room { color: #ffd23f; font-weight: 800; }
.fr-row .btn { min-width: 0; padding: 6px 12px; }
.fr-x { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 14px; }
.wlabel.friend .n { color: #9ad0ff; font-size: 15px; }
/* チャット */
#chatPanel { width: min(560px, 96vw); height: min(640px, 86vh); }
.chat-list { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.chat-msg { padding: 7px 12px 8px; border-radius: 14px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .08); max-width: 92%; align-self: flex-start; }
.chat-msg.me { align-self: flex-end; background: rgba(125, 255, 138, .14); border-color: rgba(125, 255, 138, .35); }
.chat-msg.admin { border-color: rgba(255, 210, 63, .6); background: rgba(255, 210, 63, .12); }
.chat-head { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.chat-head b { color: #ffd23f; }
.chat-head small { color: var(--muted); margin-left: auto; }
.chat-tag { font-size: 10px; padding: 0 6px; border-radius: 999px; }
.chat-tag.ok { background: rgba(125, 255, 138, .25); color: #7dff8a; }
.chat-tag.adm { background: #ffd23f; color: #3b2a00; font-weight: 900; }
.chat-msg p { margin: 2px 0 0; font-size: 14px; line-height: 1.45; word-break: break-word; user-select: text; }
.chat-del { border: none; background: none; cursor: pointer; font-size: 12px; opacity: .7; }
.chat-form { display: flex; gap: 8px; padding: 10px 16px 4px; border-top: 1px solid rgba(255, 255, 255, .12); }
.chat-form input {
  flex: 1; min-width: 0; padding: 10px 12px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(0, 0, 0, .3); color: #fff; font: inherit; font-size: 15px; user-select: text;
}
.chat-form input:focus { outline: none; border-color: #ffd23f; }
.chat-form .btn { min-width: 76px; }
.chat-status { margin: 0 16px 10px; min-height: 16px; font-size: 12px; color: #ff9e80; }
.chat-tabs { margin-top: 10px; }
.chat-tabs .tab { position: relative; }
.chat-sys { align-self: center; font-size: 12px; color: var(--muted); padding: 2px 10px; }
.chat-msg.party { border-color: rgba(154, 208, 255, .35); }
.chat-msg.party .chat-head b { color: #9ad0ff; }
.wlabel .say { margin-top: 3px; padding: 4px 10px; border-radius: 12px; background: rgba(255, 255, 255, .95); color: #222; font-size: 13px; max-width: 220px; white-space: normal; word-break: break-word; }
.rank-me.held { color: #ffb4a8; border-color: rgba(255, 107, 107, .5); }
.rank-row .chat-del { margin-left: 6px; }
.chat-dot { position: absolute; top: -3px; right: -3px; width: 12px; height: 12px; border-radius: 50%; background: #ff3b3b; border: 2px solid #fff; }
/* 数字入りの通知（①みたいに） */
.chat-dot:not(:empty) { top: -8px; right: -8px; width: auto; height: auto; min-width: 20px; padding: 1px 5px; border-radius: 999px; color: #fff; font: 900 12px/16px system-ui, sans-serif; font-style: normal; text-align: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.chat-tabs .chat-dot:not(:empty) { top: -6px; right: 6px; }
#hudChatBtn { position: relative; overflow: visible !important; }
/* 同時接続 */
#subMenu .online { cursor: default; border-color: rgba(125, 255, 138, .6); }
.online i, .online-title i {
  display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; vertical-align: 1px;
  background: #4cd964; box-shadow: 0 0 6px #4cd964; animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: .35; } }
.online-title {
  display: inline-block; margin: 12px 0 0; padding: 4px 14px; border-radius: 999px; font-size: 13px; font-weight: 800;
  background: rgba(0, 0, 0, .35); border: 1px solid rgba(125, 255, 138, .45); color: #fff;
}
.online-title b { color: #7dff8a; font-size: 15px; }
@media (max-width: 600px) {
  #subMenu { top: calc(max(10px, env(safe-area-inset-top)) + 62px); }
  #subMenu > * { font-size: 11px; padding: 4px 10px; }
}
.badge {
  position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px;
  background: #ff3b3b; color: #fff; font-size: 12px; font-weight: 900; font-style: normal; line-height: 18px;
  border: 2px solid #fff; box-shadow: 0 2px 0 rgba(0, 0, 0, .35);
}
#indexPanel { width: min(720px, 96vw); }
.idx-total { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font-weight: 900; }
.idx-total .num { font-size: 22px; white-space: nowrap; }
.progress { flex: 1; height: 12px; border-radius: 6px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.progress > div { height: 100%; border-radius: 6px; background: linear-gradient(90deg, #4cd964, #ffd23f); }
.idx-sec { margin-bottom: 16px; }
.idx-sec h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 17px; }
.idx-sec h3 .cnt { margin-left: auto; font-size: 14px; color: var(--muted); }
.idx-sec h3 .done { color: #ffd23f; }
.idx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.idx-card {
  position: relative; padding: 8px 6px 10px; border-radius: 14px; text-align: center; font-size: 12px;
  background: rgba(255, 255, 255, .06); border: 2px solid var(--rc, var(--line));
}
.idx-card img { display: block; width: 96px; height: 96px; margin: 0 auto 4px; }
.idx-card b { display: block; font-size: 15px; margin-bottom: 2px; }
.idx-card .inc { color: #7dff8a; font-weight: 800; }
.idx-card .meta { color: var(--muted); margin-top: 2px; }
.idx-card.locked { border-color: var(--line); }
.idx-card.locked b { color: var(--muted); }
.idx-card .new {
  position: absolute; top: 6px; left: 6px; padding: 1px 6px; border-radius: 6px; background: #ff3b3b; color: #fff;
  font-size: 11px; font-weight: 900;
}
.idx-tabs .tab { font-size: 13px; white-space: nowrap; }
.idx-total { flex-wrap: wrap; }
.idx-total .progress { min-width: 120px; }
.theme-card { margin-bottom: 14px; }
.mut-gold-card { border-color: rgba(255, 210, 63, .7) !important; }
.mut-diamond-card { border-color: rgba(143, 243, 255, .7) !important; }
.mut-galaxy-card { border-color: rgba(179, 136, 255, .8) !important; }
@media (max-width: 600px) {
  .idx-tabs { flex-wrap: wrap; }
  .idx-tabs .tab { flex: 1 1 40%; font-size: 12px; padding: 7px 4px; }
  .idx-grid { grid-template-columns: repeat(2, 1fr); }
  /* 狭い画面ではボタンをカードの下に横並びにする */
  .card { flex-wrap: wrap; }
  .card .info { flex: 1 1 150px; }
  .card .btns { flex-direction: row; flex: 1 1 100%; }
  .card .btns .btn { flex: 1; min-width: 0; }
}

.field { display: block; margin-bottom: 14px; font-weight: 800; }
.field input:not([type=range]) {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border-radius: 10px; border: 2px solid var(--line);
  background: rgba(0, 0, 0, .35); color: #fff; font-size: 16px; font-family: inherit;
}
.field input[type=range] { display: block; width: 100%; margin-top: 8px; }
.howto h3, .credits h3 { margin: 14px 0 6px; font-size: 16px; color: var(--accent); }
.howto ol { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.6; }
.howto p, .credits p { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 6px 0; }
.credits a { color: #8ecbff; }
.note { font-size: 12px !important; }
.version { margin: 10px 0 0; text-align: center; font-size: 12px; color: var(--muted); }
.danger-btn { margin-top: 16px; width: 100%; padding: 10px; border-radius: 12px; border: 2px solid var(--red); background: transparent; color: var(--red); font-weight: 900; }

/* タイトル */
/* ===== タイトル画面（後ろでゲームの世界がゆっくり回る） ===== */
#title {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px;
  overflow: hidden auto;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(255, 210, 63, .28), transparent 55%),
    linear-gradient(180deg, rgba(24, 14, 60, .55) 0%, rgba(24, 14, 60, .25) 40%, rgba(12, 8, 30, .85) 100%);
}
body.title-mode .hud, body.title-mode .touch-only, body.title-mode #labels { visibility: hidden; }
.title-bg { position: absolute; inset: 0; pointer-events: none; }
.title-bg .fb {
  position: absolute; left: var(--x); bottom: -80px; width: var(--s); height: var(--s); border-radius: 18%;
  background: linear-gradient(135deg, #ffe680, #ffb703); border: 3px solid #c98a00; opacity: .55;
  box-shadow: 0 0 18px rgba(255, 210, 63, .6); animation: floatUp var(--d) linear infinite; animation-delay: var(--dl);
}
.title-bg .fb::after { content: '?'; position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; color: #8a5a00; font-size: calc(var(--s) * .62); }
@keyframes floatUp { from { transform: translateY(0) rotate(0); } to { transform: translateY(-120vh) rotate(360deg); } }
.title-bg .spark {
  position: absolute; left: var(--x); top: var(--y); width: 10px; height: 10px; background: #fff;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  animation: twinkle 2.6s ease-in-out infinite; animation-delay: var(--dl);
}
@keyframes twinkle { 0%, 100% { transform: scale(0); opacity: 0; } 50% { transform: scale(1.6) rotate(45deg); opacity: 1; } }

.title-inner { position: relative; text-align: center; max-width: 560px; width: 100%; margin: auto; animation: titleIn .7s ease-out both; }
@keyframes titleIn { from { transform: translateY(24px); opacity: 0; } }

/* 立体のブロック */
.cube-wrap { position: relative; width: 96px; height: 120px; margin: 0 auto 6px; perspective: 600px; }
.cube {
  position: absolute; left: 0; top: 0; width: 96px; height: 96px; transform-style: preserve-3d;
  animation: spin 7s linear infinite, hop 1.6s ease-in-out infinite;
}
.cube .f {
  position: absolute; inset: 0; display: grid; place-items: center; font-size: 62px; font-weight: 900; color: #8a5a00;
  background: linear-gradient(135deg, #fff1a8 0%, #ffd23f 40%, #f2a900 100%); border: 6px solid #c98a00; border-radius: 10px;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .35); backface-visibility: hidden;
}
.cube .f1 { transform: translateZ(48px); }
.cube .f2 { transform: rotateY(90deg) translateZ(48px); }
.cube .f3 { transform: rotateY(180deg) translateZ(48px); }
.cube .f4 { transform: rotateY(-90deg) translateZ(48px); }
.cube .f5 { transform: rotateX(90deg) translateZ(48px); }
.cube .f6 { transform: rotateX(-90deg) translateZ(48px); }
.cube-shadow { position: absolute; left: 14px; right: 14px; bottom: 0; height: 12px; border-radius: 50%; background: rgba(0, 0, 0, .45); filter: blur(4px); animation: shadowPulse 1.6s ease-in-out infinite; }
@keyframes spin { from { transform: rotateX(-18deg) rotateY(0); } to { transform: rotateX(-18deg) rotateY(360deg); } }
@keyframes hop { 50% { top: -14px; } }
@keyframes shadowPulse { 50% { transform: scaleX(.75); opacity: .6; } }

/* ロゴ文字: 下に太い縁取りの文字、上に同じ文字をグラデーションで重ねる */
.logo { margin: 0; line-height: 1.1; font-weight: 900; letter-spacing: -.02em; }
.logo span { position: relative; display: block; color: #2a1250; -webkit-text-stroke: 10px #2a1250; filter: drop-shadow(0 6px 0 #160a30); }
.logo span::after {
  content: attr(data-t); position: absolute; left: 0; right: 0; top: 0; -webkit-text-stroke: 0;
  background: linear-gradient(180deg, #fff6c2 0%, #ffd23f 45%, #ff9f1c 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.logo .l1 { font-size: clamp(34px, 10vw, 64px); }
.logo .l2 { font-size: clamp(24px, 6.5vw, 40px); margin-top: 2px; }
.logo .l2::after { background: linear-gradient(180deg, #ffffff, #d9e4ff); -webkit-background-clip: text; background-clip: text; }
.tag {
  display: inline-block; margin: 12px 0 0; padding: 4px 14px; border-radius: 999px; font-size: 12px; font-weight: 900; letter-spacing: .25em;
  color: #ffd23f; background: rgba(0, 0, 0, .35); border: 1px solid rgba(255, 210, 63, .45);
}
.tag em { font-style: normal; color: #fff; letter-spacing: .1em; }
.flow { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.flow li {
  position: relative; padding: 5px 12px; border-radius: 10px; font-size: 13px; font-weight: 800; color: #fff;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); backdrop-filter: blur(4px);
}
.flow li + li::before { content: '›'; position: absolute; left: -7px; top: 50%; transform: translate(-50%, -52%); color: #ffd23f; font-weight: 900; }
.welcome { margin: 12px 0 0; font-size: 14px; font-weight: 800; color: #ffe680; text-shadow: 0 2px 0 rgba(0, 0, 0, .5); }

/* ボタンのカード（すりガラス） */
.title-card {
  margin: 18px auto 0; padding: 18px 18px 12px; max-width: 420px; border-radius: 22px;
  background: rgba(20, 12, 50, .45); border: 1px solid rgba(255, 255, 255, .18);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
}
#startBtn {
  position: relative; overflow: hidden; width: 100%; padding: 16px 0; font-size: 26px; font-weight: 900; border-radius: 16px;
  border: 3px solid rgba(0, 0, 0, .25); background: linear-gradient(#8dff99, #22b544); color: #053b10; cursor: pointer;
  box-shadow: 0 6px 0 #0f6b25, 0 0 30px rgba(77, 255, 120, .35); animation: startGlow 1.8s ease-in-out infinite;
}
#startBtn::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .7), transparent); animation: shine 2.6s ease-in-out infinite;
}
#startBtn:active { transform: translateY(4px); box-shadow: 0 2px 0 #0f6b25; }
@keyframes shine { 0%, 40% { left: -60%; } 100% { left: 130%; } }
@keyframes startGlow { 50% { box-shadow: 0 6px 0 #0f6b25, 0 0 46px rgba(77, 255, 120, .6); } }
.title-links { display: flex; gap: 8px; margin-top: 12px; }
.title-links .account-btn { flex: 1; margin: 0; min-width: 0; font-size: 13px; padding: 9px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 480px) {
  .title-links { flex-direction: column; }
  .cube-wrap { transform: scale(.85); margin-bottom: 0; }
}
#title .ctrl { margin: 12px 0 0; font-size: 12px; color: rgba(255, 255, 255, .75); }
.account-btn {
  display: block; margin: 12px auto 0; padding: 8px 16px; border-radius: 999px; border: 2px solid #7a5cff;
  background: rgba(20, 16, 50, .75); color: #fff; font-weight: 800; font-size: 14px; cursor: pointer;
}
.account-btn:hover { border-color: #ff3ea5; }
a.more-games { text-decoration: none; text-align: center; }
#title a.more-games { border-color: #ffd23f; }
.panel a.btn.more-games { display: block; margin: 0 0 14px; background: #7a5cff; color: #fff; }
.account-box { margin-bottom: 16px; padding: 12px; border-radius: 12px; border: 2px solid #7a5cff; background: rgba(122, 92, 255, .12); }
.account-box h3 { margin: 0 0 4px; font-size: 15px; }
.account-box p { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
#title .note { margin-top: 14px; font-size: 11px; color: rgba(255, 255, 255, .55); }

@media (max-width: 600px) {
  .stat { min-width: 0; padding: 3px 10px 3px 6px; }
  .stat b { font-size: 16px; }
  .stat small { font-size: 11px; }
  #menu button { width: 52px; height: 52px; font-size: 20px; border-radius: 13px; }
  #menu button span { font-size: 9px; }
  #zoneLabel { top: 128px; font-size: 14px; }
  #reveal .name { font-size: 32px; }
  #flightHud b { font-size: 40px; }
  #chaseHud { top: 160px; }
  #flightHud { top: 150px; }
  body.touch #prompt { bottom: 150px; font-size: 15px; }
}

/* メニューボタンのキー表示（PC のみ。1〜4 キーでパネルを開く） */
#menu button kbd { position: absolute; left: 4px; top: 2px; font-size: 10px; font-weight: 900; opacity: .7; font-family: inherit; }
body.touch #menu button kbd { display: none; }

/* =====================================================================
   デザイン v0.24: タイトル画面に合わせた「すりガラス × ゴールド」の見た目
   （上の基本ルールを、ここでまとめて上書きする）
   ===================================================================== */
:root {
  --panel: rgba(26, 16, 58, .82);
  --line: rgba(255, 255, 255, .16);
  --muted: #c3bfe0;
  --glass: rgba(20, 12, 48, .55);
  --gold: linear-gradient(180deg, #fff1a8 0%, #ffd23f 45%, #ffa51c 100%);
}

/* ---------- 画面上のHUD ---------- */
.stat {
  padding: 4px 14px 4px 4px; border-radius: 999px; min-width: 160px; align-items: center;
  background: var(--glass); border: 1px solid rgba(255, 255, 255, .2);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
}
.stat .ico {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-size: 16px;
  background: rgba(255, 255, 255, .14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2);
}
.stat.money { border-color: rgba(125, 255, 138, .45); }
.stat.money b { color: #8dff99; text-shadow: 0 0 10px rgba(125, 255, 138, .5), 0 2px 0 rgba(0, 0, 0, .5); }
.stat.ev.on { border-color: #b388ff; }

#menu button {
  border: 2px solid rgba(255, 255, 255, .55); border-radius: 18px; background: var(--gold);
  box-shadow: 0 5px 0 #a8620a, 0 8px 18px rgba(0, 0, 0, .35), inset 0 2px 0 rgba(255, 255, 255, .7);
  transition: transform .12s;
}
#menu button:hover { transform: translateY(-2px); }
#menu button:active { transform: translateY(4px); box-shadow: 0 1px 0 #a8620a; }
#subMenu > * { background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

#zoneLabel {
  padding: 6px 20px; background: var(--glass); border: 1px solid rgba(255, 255, 255, .25);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
}
#prompt {
  border-radius: 999px; padding: 10px 22px; background: var(--glass); border: 1px solid rgba(255, 210, 63, .6);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 0 22px rgba(255, 210, 63, .25);
}
#prompt kbd { background: var(--gold); color: #3b2a00; box-shadow: 0 3px 0 #a8620a; }
#lockHint, #dashHud { background: var(--glass); border: 1px solid rgba(255, 255, 255, .18); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

/* お知らせ */
.toast {
  border-radius: 16px; background: rgba(20, 12, 48, .72); border: 1px solid rgba(255, 255, 255, .25);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.toast.big { border-color: rgba(255, 210, 63, .7); box-shadow: 0 0 30px rgba(255, 210, 63, .35), 0 8px 24px rgba(0, 0, 0, .35); }

/* 飛行・追跡 */
#flightHud b {
  font-size: 64px; background: var(--gold); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .55)); text-shadow: none;
}
#flightHud span { display: inline-block; padding: 3px 14px; border-radius: 999px; background: var(--glass); backdrop-filter: blur(6px); }
#chaseHud {
  border-radius: 18px; background: rgba(60, 8, 20, .62); border: 1px solid rgba(255, 90, 90, .7);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 0 24px rgba(255, 40, 40, .3);
}

/* タイミングゲージ */
#timing .bar {
  height: 32px; border-radius: 999px; border: 3px solid rgba(255, 255, 255, .9);
  background: linear-gradient(180deg, #ff8a8a, #e84545); box-shadow: 0 6px 20px rgba(0, 0, 0, .4);
}
#timing .good { background: linear-gradient(180deg, #ffe680, #ffc21a); }
#timing .perfect { background: linear-gradient(180deg, #a6ffb0, #2fbf4a); box-shadow: 0 0 14px #4cd964; }
#timing .cursor { width: 8px; margin-left: -4px; border-radius: 4px; box-shadow: 0 0 10px #fff, 0 0 4px #000; }
#timing .label { text-shadow: 0 3px 0 #000, 0 0 12px rgba(255, 210, 63, .6); }

/* キャラが出たときの演出（後ろで光が回る） */
#reveal::before {
  content: ''; position: absolute; left: 50%; top: 50%; width: 520px; height: 520px; margin: -260px 0 0 -260px; z-index: -1;
  background: repeating-conic-gradient(rgba(255, 230, 128, .28) 0 10deg, transparent 10deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 0%, transparent 65%); mask: radial-gradient(circle, #000 0%, transparent 65%);
  animation: rays 6s linear infinite;
}
@keyframes rays { to { transform: rotate(360deg); } }
#reveal .income { display: inline-block; margin-top: 6px; padding: 4px 16px; border-radius: 999px; background: var(--glass); }

/* 3D空間のラベル */
.wlabel .n, .wlabel .m { text-shadow: 0 2px 0 rgba(0, 0, 0, .85), 0 0 6px rgba(0, 0, 0, .7); }

/* ---------- パネル ---------- */
.panel {
  border: 1px solid rgba(255, 255, 255, .22); border-radius: 26px; overflow: hidden;
  background: linear-gradient(160deg, rgba(48, 28, 102, .9), rgba(20, 12, 48, .92));
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .25);
  animation: panelIn .22s cubic-bezier(.2, 1.4, .4, 1) both;
}
@keyframes panelIn { from { opacity: 0; transform: translate(-50%, -46%) scale(.94); } }
.panel-head {
  padding: 14px 18px; border-bottom: 1px solid rgba(255, 255, 255, .14);
  background: linear-gradient(90deg, rgba(255, 210, 63, .18), rgba(122, 92, 255, .12) 60%, transparent);
}
.panel-head h2 {
  font-size: 24px; letter-spacing: .02em; background: var(--gold); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .45));
}
.close {
  border-radius: 50%; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .3);
  font-size: 18px; transition: background .15s, transform .15s;
}
.close:hover { background: #ff5e5e; transform: rotate(90deg); }
.panel-body { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .3) transparent; }

/* カード */
.card {
  border-radius: 18px; border: 1px solid rgba(255, 255, 255, .14);
  background: linear-gradient(135deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .03));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12); transition: transform .15s, border-color .15s;
}
.card:hover { border-color: rgba(255, 210, 63, .5); }
.card .icon {
  display: grid; place-items: center; width: 52px; height: 52px; font-size: 28px; border-radius: 16px;
  background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15);
}
.card .thumb { border-radius: 14px; background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, .18), rgba(255, 255, 255, .03)); }
.card.rebirth { border-color: rgba(179, 136, 255, .7); background: linear-gradient(135deg, rgba(179, 136, 255, .22), rgba(255, 255, 255, .03)); }
.card.power { border-color: rgba(255, 210, 63, .5); }

/* ボタン */
.btn {
  position: relative; overflow: hidden; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .45);
  background: linear-gradient(180deg, #8dff99, #22b544); color: #053b10;
  box-shadow: 0 4px 0 #0f6b25, inset 0 1px 0 rgba(255, 255, 255, .6); transition: transform .1s, filter .15s;
}
.btn:not(:disabled):hover { filter: brightness(1.08); }
.btn:not(:disabled):active { transform: translateY(3px); box-shadow: 0 1px 0 #0f6b25; }
.btn:disabled { background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .45); border-color: rgba(255, 255, 255, .12); box-shadow: none; }
.btn.sell { background: linear-gradient(180deg, #ffb199, #ff6b4a); color: #3a1000; box-shadow: 0 4px 0 #a33a1e, inset 0 1px 0 rgba(255, 255, 255, .6); }
.btn.store { background: linear-gradient(180deg, #c7e8ff, #6fb8ff); color: #0b2540; box-shadow: 0 4px 0 #2f6fae, inset 0 1px 0 rgba(255, 255, 255, .6); }
.btn.reb { background: linear-gradient(180deg, #dcc8ff, #9d6bff); color: #1e0b48; box-shadow: 0 4px 0 #5a32b3, inset 0 1px 0 rgba(255, 255, 255, .6); }
.btn.best { background: var(--gold); color: #3b2a00; box-shadow: 0 4px 0 #a8620a, inset 0 1px 0 rgba(255, 255, 255, .7); }
.btn.best::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 30%; left: -40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .7), transparent); animation: shine 3s ease-in-out infinite;
}
.panel a.btn.more-games { background: linear-gradient(180deg, #a48bff, #6a3cff); box-shadow: 0 4px 0 #3d1f9e, inset 0 1px 0 rgba(255, 255, 255, .5); }
.danger-btn { border-radius: 14px; border: 1px solid rgba(255, 90, 90, .7); background: rgba(255, 60, 60, .1); }

/* タブ（セグメント切り替え） */
.tabs { margin: 12px 16px 0; padding: 4px; gap: 4px; border-radius: 16px; background: rgba(0, 0, 0, .3); }
.tab { border: none; border-radius: 12px; padding: 9px; transition: background .15s, color .15s; }
.tab.active { background: var(--gold); color: #3b2a00; box-shadow: 0 3px 0 #a8620a; }

/* スライダー */
input[type=range] { -webkit-appearance: none; appearance: none; height: 10px; border-radius: 999px; background: rgba(255, 255, 255, .15); outline: none; }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--gold);
  border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .45); cursor: pointer;
}
input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #ffd23f; border: 2px solid #fff; cursor: pointer; }

/* 入力欄・設定 */
.field input:not([type=range]) { border-radius: 14px; border: 1px solid rgba(255, 255, 255, .22); background: rgba(0, 0, 0, .3); }
.field input:not([type=range]):focus { outline: none; border-color: #ffd23f; box-shadow: 0 0 0 3px rgba(255, 210, 63, .25); }
.account-box { border-radius: 18px; border: 1px solid rgba(122, 92, 255, .6); background: linear-gradient(135deg, rgba(122, 92, 255, .25), rgba(122, 92, 255, .06)); }
.howto, .credits { padding: 4px 14px 8px; margin-top: 12px; border-radius: 18px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); }
.howto ol li { margin: 2px 0; }

/* インデックス */
.progress { height: 14px; background: rgba(0, 0, 0, .35); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .5); }
.progress > div { background: linear-gradient(90deg, #4cd964, #ffd23f, #ff9f1c); box-shadow: 0 0 10px rgba(255, 210, 63, .6); }
.idx-sec h3 { padding: 6px 12px; border-radius: 12px; background: rgba(255, 255, 255, .06); }
.idx-card {
  border-radius: 18px; border: 1px solid var(--rc, var(--line));
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--rc, #fff) 22%, transparent), rgba(255, 255, 255, .03) 70%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12); transition: transform .15s;
}
.idx-card:hover { transform: translateY(-3px); }
.idx-card.locked { background: rgba(0, 0, 0, .2); border-style: dashed; }
.badge { background: linear-gradient(180deg, #ff6b6b, #e02424); }

/* ランキング */
#rankPanel { width: min(600px, 96vw); }
.rank-tabs { display: flex; gap: 6px; padding: 12px 16px 4px; overflow-x: auto; scrollbar-width: none; touch-action: pan-x; }
.rank-tabs::-webkit-scrollbar { display: none; }
.rank-tab {
  flex: 0 0 auto; padding: 7px 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .08); color: var(--muted); font-weight: 800; font-size: 13px; white-space: nowrap;
}
.rank-tab.active { background: var(--gold); color: #3b2a00; border-color: transparent; box-shadow: 0 3px 0 #a8620a; }
.rank-name { margin: 4px 16px 0; font-size: 12px; color: var(--muted); }
.rank-me {
  margin-bottom: 12px; padding: 10px 14px; border-radius: 16px; font-weight: 800; text-align: center;
  background: linear-gradient(135deg, rgba(255, 210, 63, .25), rgba(255, 210, 63, .05)); border: 1px solid rgba(255, 210, 63, .55);
}
.rank-me b { font-size: 22px; color: #ffd23f; }
.rank-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin-bottom: 6px; border-radius: 14px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); font-weight: 800;
}
.rank-row .pos { width: 34px; text-align: center; font-size: 15px; color: var(--muted); }
.rank-row.top .pos { font-size: 22px; }
.rank-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .val { color: #ffd23f; white-space: nowrap; }
.rank-row.top { background: linear-gradient(90deg, rgba(255, 210, 63, .18), rgba(255, 255, 255, .04)); }
.rank-row.me { border-color: #7dff8a; box-shadow: 0 0 0 1px #7dff8a inset; }
#subMenu kbd { font-family: inherit; font-size: 10px; opacity: .7; margin-right: 4px; }
#title .rank-btn { border-color: #ffd23f; }

/* スキン */
#skinPanel { width: min(640px, 96vw); }
.skin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.skin-card {
  padding: 8px 6px 10px; border-radius: 18px; border: 1px solid rgba(255, 255, 255, .16); color: #fff; text-align: center;
  background: radial-gradient(circle at 50% 30%, rgba(122, 200, 255, .2), rgba(255, 255, 255, .03) 70%); transition: transform .12s;
}
.skin-card img { display: block; width: 110px; height: 110px; margin: 0 auto 4px; }
.skin-card b { display: block; font-size: 15px; }
.skin-card small { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }
.skin-card:not(.locked):hover { transform: translateY(-3px); border-color: #ffd23f; }
.skin-card.on { border: 2px solid #7dff8a; box-shadow: 0 0 16px rgba(125, 255, 138, .45); }
.skin-card.on small { color: #7dff8a; font-weight: 800; }
.skin-card.locked { cursor: default; border-style: dashed; background: rgba(0, 0, 0, .25); }
.skin-card.locked img { filter: grayscale(1) brightness(.35); }
@media (max-width: 600px) { .skin-grid { grid-template-columns: repeat(2, 1fr); } }

/* 管理者のお知らせ・管理者メニュー */
#adminMsg {
  top: calc(max(14px, env(safe-area-inset-top)) + 44px); left: 50%; transform: translateX(-50%); max-width: min(560px, 70vw);
  display: flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 14px; font-weight: 800; font-size: 14px;
  background: linear-gradient(90deg, rgba(255, 210, 63, .9), rgba(255, 159, 28, .9)); color: #3b2a00; box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
  animation: evPulse 2s ease-in-out infinite;
}
#adminMsg span { flex: 0 0 auto; font-size: 11px; padding: 1px 8px; border-radius: 999px; background: rgba(0, 0, 0, .2); color: #fff; }
#adminMsg b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#hudAdminBtn { border-color: #ff6b6b !important; }
.card.adm .info { display: flex; flex-direction: column; gap: 8px; }
.card.adm textarea, .card.adm input, .card.adm select {
  width: 100%; padding: 8px 10px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .22); background: rgba(0, 0, 0, .3);
  color: #fff; font: inherit; font-size: 14px; user-select: text; resize: vertical;
}
.card.adm select option, .card.adm select optgroup { background: #241640; color: #fff; }
.adm-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.adm-line label { flex: 1; display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); white-space: nowrap; }
.adm-line select { flex: 1; min-width: 0; }
.adm-h { margin: 10px 0 6px; font-size: 15px; color: #ffd23f; }
/* 配布キャラ選び */
.gift-pick {
  display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 210, 63, .2), rgba(255, 255, 255, .03)); border: 1px solid rgba(255, 210, 63, .5);
}
.gift-pick img { width: 84px; height: 84px; border-radius: 14px; background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, .22), rgba(255, 255, 255, .03)); }
.gift-pick .lbl { display: block; font-size: 11px; color: var(--muted); }
.gift-pick b { display: block; font-size: 18px; }
.gift-pick small { color: #7dff8a; font-weight: 800; }
.gift-muts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gift-muts button[data-gmut="pumpkin"].active { background: linear-gradient(180deg, #ffc27a, #ff8c1a); color: #2a1000; box-shadow: 0 3px 0 #a34a00; }
.gift-muts button[data-gmut="rainbowpumpkin"].active { background: linear-gradient(90deg, #ff5e5e, #ffd23f, #4cd964, #3a8dff, #b05cff); color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, .5); box-shadow: 0 3px 0 #5a32b3; }
.gift-muts button {
  padding: 7px 4px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .07);
  color: var(--muted); font-weight: 800; font-size: 12px; white-space: nowrap;
}
.gift-muts button.active { background: var(--gold); color: #3b2a00; border-color: transparent; box-shadow: 0 3px 0 #a8620a; }
.gift-muts button[data-gmut="diamond"].active { background: linear-gradient(180deg, #e6fbff, #8ff3ff); box-shadow: 0 3px 0 #3a9fb3; }
.gift-muts button[data-gmut="galaxy"].active { background: linear-gradient(180deg, #b388ff, #6a3cff); color: #fff; box-shadow: 0 3px 0 #3d1f9e; }
.gift-rars { padding: 0; }
.gift-rars .rank-tab { font-size: 12px; padding: 5px 10px; }
.gift-rars .rank-tab.active { background: var(--rc); color: #1d1240; box-shadow: none; }
.gift-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.gift-card {
  padding: 6px 4px 8px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .14); color: #fff;
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--rc, #fff) 20%, transparent), rgba(255, 255, 255, .03) 70%);
  transition: transform .12s, border-color .12s;
}
.gift-card img { display: block; width: 64px; height: 64px; margin: 0 auto 2px; }
.gift-card b { display: block; font-size: 11px; line-height: 1.25; }
.gift-card:hover { transform: translateY(-2px); border-color: var(--rc); }
.gift-card.sel { border: 2px solid #ffd23f; box-shadow: 0 0 14px rgba(255, 210, 63, .6); }
.adm-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-bottom: 6px; border-radius: 12px; background: rgba(255, 255, 255, .06); font-size: 13px; }
.adm-row b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-row small { color: var(--muted); white-space: nowrap; }
.adm-row .btn { min-width: 0; padding: 4px 10px; }
/* バックアップ */
.backup-box { border-color: rgba(125, 255, 138, .5); background: linear-gradient(135deg, rgba(125, 255, 138, .16), rgba(125, 255, 138, .03)); }
.backup-box .btn { flex: 1; }
.bk-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 6px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); }
.bk-row > div { flex: 1; min-width: 0; }
.bk-row b { display: block; font-size: 15px; }
.bk-row small { display: block; color: var(--muted); font-size: 12px; }
.bk-row .btn { min-width: 0; padding: 6px 14px; }
.adm-row.sched { border: 1px dashed rgba(122, 200, 255, .6); }
.adm-row.sched small { color: #9ad0ff; font-weight: 800; }
.adm-when span { font-size: 13px; color: var(--muted); }
.adm-when select { flex: 0 0 auto; width: auto !important; }
.adm-when input[type=datetime-local] { flex: 1; min-width: 180px; color-scheme: dark; }


/* =====================================================================
   UI 整理 v0.50
   ===================================================================== */
/* ---- 右のサブメニュー: 同じ幅・同じ形にそろえる ---- */
#subMenu { gap: 5px; align-items: stretch; width: 164px; }
#subMenu > button, #subMenu > .online, #subMenu .hud-links a {
  display: flex; align-items: center; gap: 8px; width: 100%; max-width: none; padding: 6px 10px; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .2); background: var(--glass); color: #fff; font-size: 13px; text-align: left;
  overflow: visible; box-shadow: 0 3px 10px rgba(0, 0, 0, .25); transition: transform .12s, border-color .15s, background .15s;
}
#subMenu > button:hover, #subMenu .hud-links a:hover { transform: translateX(-2px); border-color: rgba(255, 210, 63, .7); background: rgba(40, 26, 90, .8); }
#subMenu > button:active { transform: scale(.97); }
#subMenu .i { flex: 0 0 22px; text-align: center; font-size: 15px; }
#subMenu .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#subMenu kbd { order: 3; margin: 0; padding: 0 5px; border-radius: 5px; background: rgba(255, 255, 255, .14); font-size: 10px; opacity: .85; line-height: 16px; }
#subMenu > .online { justify-content: center; gap: 4px; font-size: 12px; padding: 4px 10px; border-color: rgba(125, 255, 138, .45); box-shadow: none; }
#subMenu > .online i { margin-right: 2px; }
#subMenu > .online .t { flex: 0 1 auto; }
#subMenu > .online b { color: #7dff8a; }
#hudAdminBtn { border-color: rgba(255, 210, 63, .6) !important; }
#subMenu .chat-dot:not(:empty) { top: -7px; right: -7px; }
#subMenu .chat-dot:empty { top: -3px; right: -3px; }
/* リンク: PC では並べて出しておく（ボタンは不要） */
.links-btn { display: none !important; }
#subMenu .hud-links { display: flex; flex-direction: column; gap: 5px; margin-top: 4px; padding: 0; border: none; background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
#subMenu .hud-links a { font-size: 12px; padding: 5px 10px; opacity: .92; text-decoration: none; }
#subMenu .hud-links a.more { border-color: rgba(255, 210, 63, .5); }
#subMenu .hud-links a.oc-mini { border-color: rgba(6, 199, 85, .7); background: rgba(6, 120, 60, .7); }

/* ---- タイトル: 画面が低くても上が切れずにスクロールできる ---- */
#title { align-items: flex-start; }
.title-links { display: grid; grid-template-columns: 1fr 1fr; }
.title-links .account-btn { white-space: normal; line-height: 1.25; display: flex; align-items: center; justify-content: center; text-align: center; }
.title-links .more-games { grid-column: 1 / -1; }
body.title-mode #toasts { display: none; }   /* タイトルの上にお知らせが重ならないように */
@media (max-height: 780px) {
  .cube-wrap { transform: scale(.72); margin: -14px auto -16px; }
  .logo .l1 { font-size: clamp(30px, 8vw, 54px); }
  .logo .l2 { font-size: clamp(22px, 5.5vw, 34px); }
  .tag, .flow, .welcome, .online-title { margin-top: 8px; }
  .title-card { margin-top: 12px; padding: 14px 16px 10px; }
  #startBtn { padding: 12px 0; font-size: 24px; }
  .openchat { margin-top: 10px; padding: 8px 12px; }
}

/* ---- お知らせ・案内を少し控えめに ---- */
.toast { max-width: min(560px, 92vw); text-align: center; }

/* ---- スマホ: HUD が重ならないように小さくまとめる ---- */
@media (max-width: 600px) {
  /* 左のステータス: アイコンと数字だけ（右上のメニューと重ならない幅） */
  #stats { gap: 4px; max-width: calc(100vw - 258px); }
  .stat { min-width: 0; padding: 2px 10px 2px 2px; gap: 5px; }
  .stat .ico { width: 24px; height: 24px; font-size: 13px; flex: 0 0 24px; }
  .stat b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .stat small { display: none; }
  /* ゾーン名: メニューの下の中央 */
  #zoneLabel { top: calc(max(10px, env(safe-area-inset-top)) + 64px); font-size: 13px; padding: 4px 12px; max-width: calc(100vw - 250px); overflow: hidden; text-overflow: ellipsis; }
  /* 右のサブメニュー: アイコンだけの丸ボタン */
  #subMenu { width: 44px; top: calc(max(10px, env(safe-area-inset-top)) + 64px); gap: 6px; align-items: flex-end; }
  #subMenu > button, #subMenu .hud-links a { width: 42px; height: 42px; padding: 0; justify-content: center; border-radius: 50%; }
  #subMenu .t, #subMenu kbd { display: none; }
  #subMenu .i { flex: none; font-size: 18px; }
  #subMenu > .online { width: auto; padding: 2px 8px; font-size: 11px; white-space: nowrap; }
  .links-btn { display: flex !important; }
  #subMenu .hud-links { display: none; margin-top: 0; }
  #subMenu.links-open .hud-links { display: flex; }
  #subMenu.links-open .links-btn { border-color: #ffd23f; }
  /* お知らせを小さく */
  .toast { font-size: 15px; padding: 7px 14px; }
  .toast.big { font-size: 19px; padding: 8px 16px; }
  #toasts { top: 30%; }
}
@media (max-width: 600px) {
  #subMenu > button, #subMenu .hud-links a { background: rgba(60, 44, 130, .62); border-color: rgba(255, 255, 255, .35); }
}

/* ---- デイリークエスト ---- */
#dailyPanel { width: min(560px, 96vw); }
.daily-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
.daily-top b { color: #ffd23f; }
.card.daily { align-items: center; }
.card.daily .dq-ico { flex: 0 0 48px; height: 48px; display: grid; place-items: center; font-size: 26px; border-radius: 14px; background: rgba(255, 255, 255, .1); }
.card.daily h3 { margin: 0 0 6px; font-size: 15px; }
.card.daily small { color: var(--muted); font-size: 12px; }
.dq-bar { position: relative; height: 18px; border-radius: 999px; background: rgba(0, 0, 0, .35); overflow: hidden; margin-bottom: 4px; }
.dq-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: linear-gradient(90deg, #7a5cff, #b388ff); transition: width .3s; }
.dq-bar span { position: relative; display: block; text-align: center; font-size: 11px; font-weight: 900; line-height: 18px; text-shadow: 0 1px 0 rgba(0, 0, 0, .6); }
.card.daily.done { border-color: rgba(125, 255, 138, .6); }
.card.daily.done .dq-bar i { background: linear-gradient(90deg, #22b544, #8dff99); }
.card.daily.claimed { opacity: .6; }
.card.daily.bonus { border-color: rgba(255, 210, 63, .55); background: linear-gradient(135deg, rgba(255, 210, 63, .14), rgba(255, 255, 255, .03)); }
.dq-ok { font-size: 12px; font-weight: 800; color: #7dff8a; white-space: nowrap; }
#hudDailyBtn { position: relative; }

/* ---- ログインボーナス ---- */
#loginPanel { width: min(600px, 96vw); }
.login-lead { margin: 0 0 12px; text-align: center; font-weight: 800; font-size: 16px; }
.login-lead small { color: var(--muted); font-weight: 600; font-size: 12px; }
.login-lead b { color: #ffd23f; }
.login-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.login-day {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 10px; border-radius: 16px; text-align: center;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14);
}
.login-day small { font-size: 11px; color: var(--muted); font-weight: 800; }
.login-day .ic { font-size: 30px; line-height: 1.2; }
.login-day b { font-size: 12px; line-height: 1.25; }
.login-day span { font-size: 11px; color: #ffd23f; font-weight: 800; word-break: break-all; }
.login-day.got { opacity: .5; }
.login-day.today { border: 2px solid #ffd23f; background: linear-gradient(160deg, rgba(255, 210, 63, .25), rgba(255, 255, 255, .05)); box-shadow: 0 0 18px rgba(255, 210, 63, .35); animation: loginPulse 1.4s ease-in-out infinite; }
.login-day.big { grid-column: span 2; background: linear-gradient(135deg, rgba(179, 136, 255, .3), rgba(255, 210, 63, .18)); }
@keyframes loginPulse { 50% { transform: scale(1.04); } }
.btn.login-claim { display: block; width: 100%; margin-top: 14px; padding: 12px; font-size: 17px; }
.login-line {
  display: flex; align-items: center; gap: 8px; width: 100%; margin-bottom: 10px; padding: 10px 14px; border-radius: 14px; cursor: pointer;
  border: 1px solid rgba(255, 210, 63, .4); background: rgba(255, 210, 63, .1); color: #fff; font-family: inherit; font-weight: 800; font-size: 14px; text-align: left;
}
.login-line span { color: var(--muted); font-weight: 600; font-size: 12px; }
.login-line b { color: #ffd23f; }
.login-line em { margin-left: auto; font-style: normal; color: #ffd23f; }
.login-line.ready { border-color: #ffd23f; box-shadow: 0 0 14px rgba(255, 210, 63, .3); }
@media (max-width: 600px) { .login-grid { grid-template-columns: repeat(3, 1fr); } .login-day.big { grid-column: span 3; } }

/* ---- 横向きのスマホなど、高さが低い画面でも右のボタンがはみ出さないように ---- */
@media (max-height: 520px) and (min-width: 601px) {
  #subMenu { width: 44px; top: calc(max(8px, env(safe-area-inset-top)) + 62px); gap: 4px; align-items: flex-end; }
  #subMenu > button, #subMenu .hud-links a { width: 38px; height: 38px; padding: 0; justify-content: center; border-radius: 50%; }
  #subMenu .t, #subMenu kbd { display: none; }
  #subMenu .i { flex: none; font-size: 16px; }
  #subMenu > .online { width: auto; padding: 2px 8px; font-size: 11px; white-space: nowrap; }
  .links-btn { display: flex !important; }
  #subMenu .hud-links { display: none; margin-top: 0; }
  #subMenu.links-open .hud-links { display: flex; }
  .stat { min-width: 0; padding: 2px 10px 2px 2px; }
  .stat .ico { width: 24px; height: 24px; font-size: 13px; }
  .stat b { font-size: 15px; }
  .stat small { display: none; }
  #stats { gap: 3px; }
}

/* ---- ブーストイベント ---- */
#boostStats { display: contents; }
.stat.boost { border-color: rgba(255, 210, 63, .8); background: linear-gradient(90deg, rgba(255, 170, 0, .45), rgba(20, 12, 48, .6)); animation: evPulse 1.6s ease-in-out infinite; }
.stat.boost b { color: #ffe680; font-variant-numeric: tabular-nums; }
.stat.boost small { color: #fff; font-weight: 800; }
.boost-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 6px 0 8px; }
.boost-pick button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; border-radius: 12px; cursor: pointer; text-align: left;
  border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .06); color: #fff; font-family: inherit; font-weight: 800; font-size: 14px;
}
.boost-pick button small { font-size: 11px; font-weight: 600; color: var(--muted); }
.boost-pick button.active { border-color: #ffd23f; background: rgba(255, 210, 63, .18); box-shadow: 0 0 0 1px #ffd23f inset; }

/* ---- 管理者のイベント（日付つき） ---- */
#eventBanner {
  top: calc(max(14px, env(safe-area-inset-top)) + 44px); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px;
  pointer-events: auto; cursor: pointer; max-width: min(460px, calc(100vw - 380px));
}
.eb-main, .eb-sub { display: flex; align-items: center; gap: 8px; padding: 5px 14px; border-radius: 999px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.eb-main { background: linear-gradient(90deg, rgba(122, 92, 255, .85), rgba(255, 62, 165, .75)); border: 1px solid rgba(255, 255, 255, .45); box-shadow: 0 4px 16px rgba(0, 0, 0, .35); font-size: 14px; }
.eb-main.on { background: linear-gradient(90deg, rgba(255, 170, 0, .9), rgba(255, 62, 165, .85)); animation: evPulse 1.6s ease-in-out infinite; }
.eb-main b { overflow: hidden; text-overflow: ellipsis; }
.eb-main span { font-size: 12px; font-weight: 800; }
.eb-main em, .eb-sub em { font-style: normal; font-weight: 900; color: #fff6c2; font-variant-numeric: tabular-nums; }
.eb-sub { font-size: 12px; font-weight: 800; background: var(--glass); border: 1px solid rgba(255, 255, 255, .2); }
.title-event { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 10px 0 0; }
.title-event .eb-main { font-size: 15px; }
.adm-note { margin: 0 0 6px; text-align: left; }
.adm-dates { flex-wrap: wrap; }
.adm-dates input { min-width: 0; }
#admEvTitle, #admEvDesc { width: 100%; margin-bottom: 6px; }
@media (max-width: 900px) { #eventBanner { max-width: calc(100vw - 360px); } }
@media (max-width: 600px) {
  #eventBanner { top: auto; bottom: calc(150px + env(safe-area-inset-bottom)); max-width: calc(100vw - 24px); }
  .eb-main { font-size: 12px; padding: 4px 10px; }
  .eb-sub { font-size: 11px; }
}

/* ---- 信頼するプレイヤー ---- */
.trust-btn { opacity: .55; }
.trust-btn.on { opacity: 1; }
.adm-row .btn.trust { background: #ffd23f; color: #3b2a00; }

/* ---- 取引 ---- */
#tradePanel { width: min(640px, 96vw); }
#hudTradeBtn { position: relative; border-color: rgba(125, 255, 138, .6) !important; }
.btn.fr-trade { display: block; width: 100%; margin: 0 0 12px; background: linear-gradient(90deg, #22b544, #4cd964); color: #053b10; }
.tr-wait { padding: 16px; margin-bottom: 12px; border-radius: 14px; text-align: center; font-size: 16px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .15); }
.tr-wide { display: block; width: 100%; }
.tr-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tr-col { padding: 8px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .15); min-height: 120px; }
.tr-col.ok { border-color: #7dff8a; box-shadow: 0 0 0 1px #7dff8a inset; }
.tr-col h3 { margin: 0 0 6px; font-size: 14px; }
.tr-col h3 small { color: var(--muted); font-size: 11px; }
.tr-okb { display: inline-block; padding: 0 8px; border-radius: 999px; background: #7dff8a; color: #053b10; font-size: 11px; }
.tr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.tr-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 4px; border-radius: 12px; text-align: center; cursor: pointer; background: rgba(0, 0, 0, .25); border: 1px solid rgba(255, 255, 255, .12); }
.tr-item:hover { border-color: #ffd23f; }
.tr-item .thumb { width: 48px; height: 48px; }
.tr-item b { font-size: 12px; line-height: 1.2; }
.tr-item small { font-size: 10px; color: #ffd23f; }
.tr-item small.rar { color: var(--muted); }
.tr-col .tr-item[data-tr-rm]::after { content: '✕'; position: absolute; top: 2px; right: 6px; font-size: 11px; color: #ff9e80; }
.tr-n { position: absolute; top: 2px; right: 4px; font-style: normal; font-size: 11px; font-weight: 900; color: #fff; background: rgba(0, 0, 0, .5); padding: 0 5px; border-radius: 999px; }
.tr-status { margin: 10px 0 6px; text-align: center; font-weight: 800; font-size: 14px; }
.tr-btns { display: flex; gap: 8px; }
.tr-btns .btn { flex: 1; }
.btn.tr-go { background: linear-gradient(#8dff99, #22b544); color: #053b10; font-size: 17px; }
.tr-grid.pick { max-height: 260px; overflow-y: auto; padding: 2px; }
@media (max-width: 600px) { .tr-cols { grid-template-columns: 1fr; } .tr-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); } }

/* ---- 誕生日 ---- */
.bday-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.bday-row select { font: inherit; font-weight: 800; padding: 6px 8px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .1); color: #fff; }
.bday-row select option { color: #111; }
.bday-row .btn { margin-left: auto; background: linear-gradient(90deg, #ff4fa3, #ffb03f); }
.bday-field small { display: block; margin-top: 4px; color: var(--muted); font-weight: 600; }
.title-bday {
  margin: 0 auto 8px; padding: 8px 16px; border-radius: 999px; font-weight: 900; color: #fff; width: fit-content; max-width: 92vw;
  background: linear-gradient(90deg, #ff4fa3, #ffb03f, #4fc3ff); background-size: 200% 100%; animation: bdShine 3s linear infinite;
  box-shadow: 0 0 18px rgba(255, 79, 163, .6);
}
@keyframes bdShine { to { background-position: -200% 0; } }
#bdayConfetti { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 55; pointer-events: none; }
.bday-panel { border-color: #ff8fd0; box-shadow: 0 0 0 3px rgba(255, 79, 163, .35), 0 0 60px rgba(255, 79, 163, .45); background: linear-gradient(180deg, rgba(70, 18, 60, .97), rgba(24, 14, 48, .97)); }
.bday-panel .panel-body { text-align: center; }
.bd-hb { display: flex; justify-content: center; flex-wrap: wrap; gap: 2px; margin: 4px 0 8px; font-size: clamp(26px, 7vw, 44px); font-weight: 900; }
.bd-hb span { display: inline-block; animation: bdHop 1.2s ease-in-out infinite; animation-delay: calc(var(--i) * .08s); text-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.bd-hb span:nth-child(5n+1) { color: #ff4fa3; } .bd-hb span:nth-child(5n+2) { color: #ffd23f; } .bd-hb span:nth-child(5n+3) { color: #4fc3ff; }
.bd-hb span:nth-child(5n+4) { color: #7dff8a; } .bd-hb span:nth-child(5n) { color: #b388ff; }
.bd-hb .sp { width: .4em; }
@keyframes bdHop { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-12px) rotate(-6deg); } 60% { transform: translateY(0) rotate(4deg); } }
.bd-to { font-size: 17px; margin: 0 0 6px; }
.bd-to b { color: #ffd23f; }
.bd-cake { position: relative; width: 170px; margin: 0 auto; animation: bdPop .7s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes bdPop { from { transform: scale(.3); opacity: 0; } }
.bd-emoji { font-size: 120px; line-height: 1; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .4)); }
.bd-candles { display: flex; justify-content: center; gap: 14px; height: 46px; margin-bottom: -18px; position: relative; z-index: 1; }
.bd-candles i { position: relative; width: 8px; height: 30px; margin-top: 16px; border-radius: 3px; background: repeating-linear-gradient(135deg, #fff 0 5px, #ff4fa3 5px 10px); }
.bd-candles b { position: absolute; left: 50%; top: -18px; width: 12px; height: 18px; margin-left: -6px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 50% 70%, #fff8c4, #ffb300 60%, #ff6d00); box-shadow: 0 0 14px 4px rgba(255, 190, 60, .8); animation: bdFlame .25s ease-in-out infinite alternate; transform-origin: 50% 100%; }
@keyframes bdFlame { from { transform: scale(1, 1) rotate(-3deg); } to { transform: scale(.9, 1.15) rotate(3deg); } }
.bd-cake.blown .bd-candles b { animation: bdOut .5s forwards; }
.bd-cake.blown .bd-candles b::after { content: ''; position: absolute; left: 3px; top: -10px; width: 6px; height: 14px; border-radius: 50%; background: rgba(220, 220, 220, .7); animation: bdSmoke 1.4s ease-out forwards; }
@keyframes bdOut { to { background: transparent; box-shadow: none; } }
@keyframes bdSmoke { from { opacity: .9; transform: translateY(0) scale(.6); } to { opacity: 0; transform: translateY(-34px) scale(1.6); } }
.bd-hint { color: #ffd1ea; font-weight: 800; margin: 10px 0; }
.bd-gifts { margin: 10px 0; text-align: left; }
.bd-gifts h3 { text-align: center; margin: 0 0 6px; color: #ffd23f; }
.bd-gift { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 7px 10px; margin: 5px 0;
  border-radius: 12px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 143, 208, .4); animation: bdPop .5s backwards; }
.bd-gift:nth-child(3) { animation-delay: .12s; } .bd-gift:nth-child(4) { animation-delay: .24s; } .bd-gift:nth-child(5) { animation-delay: .36s; }
.bd-gift span { grid-row: span 2; font-size: 28px; text-align: center; }
.bd-gift small { color: var(--muted); }
.bd-btn { display: block; width: 100%; margin-top: 10px; font-size: 18px; padding: 12px; background: linear-gradient(90deg, #ff4fa3, #ffb03f); }
.stat.boost.bday { border-color: #ff8fd0; background: linear-gradient(90deg, rgba(255, 79, 163, .55), rgba(20, 12, 48, .6)); }
.wlabel .bd-tag { font-weight: 900; font-size: 12px; color: #fff; background: linear-gradient(90deg, #ff4fa3, #ffb03f); border-radius: 999px; padding: 1px 8px; margin-top: 2px; }
