/* 数字・英字用の書体（同梱。会場のネット環境に左右されない） */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* =========================================================
   BINGO DROP — デザイントークン
   モノトーンのパネル構成。色（--accent）はゲーム要素だけに使う
   ========================================================= */
:root {
  --bg: #0a0a0a;
  --panel: #141414;
  --panel-2: #1b1b1b;
  --panel-3: #252525;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --text: #f4f4f5;
  --muted: #8b8b90;
  --faint: #55555a;
  --accent: #c6f432;
  --accent-ink: #0a0a0a;
  --good: #3ddc97;
  --warn: #f5c451;
  --bad: #ff5c5c;
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --gap: 12px;
  --font: 'Inter', 'Noto Sans JP', system-ui, -apple-system, 'Hiragino Sans', sans-serif;
  --num: 'Inter', system-ui, sans-serif;
}
[data-preset='party'] {
  --bg: #0d0a12;
  --panel: #17131d;
  --panel-2: #1f1a27;
  --panel-3: #2a2433;
}
[data-preset='mono'] {
  --bg: #f4f4f2;
  --panel: #ffffff;
  --panel-2: #f1f1ef;
  --panel-3: #e6e6e3;
  --line: rgba(0, 0, 0, 0.07);
  --line-2: rgba(0, 0, 0, 0.12);
  --text: #111113;
  --muted: #6b6b70;
  --faint: #a5a5aa;
}

* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; }
[data-preset='mono'] { color-scheme: light; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'palt';
}
a { color: inherit; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5em; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.num { font-family: var(--num); font-weight: 800; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.stack > * + * { margin-top: 12px; }
.label { font-size: 0.75rem; color: var(--muted); font-weight: 500; letter-spacing: 0.02em; }

/* ===== レイアウト：パネル ===== */
.shell { display: grid; grid-template-columns: 260px 1fr; gap: var(--gap); padding: var(--gap); min-height: 100vh; }
.side {
  background: var(--panel);
  border-radius: var(--r-lg);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: var(--gap);
  height: calc(100vh - var(--gap) * 2);
  overflow: auto;
}
.main { background: var(--panel); border-radius: var(--r-lg); padding: 22px 26px 40px; min-width: 0; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--text); display: grid; place-items: center; }
.brand-mark i { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--bg); }
.brand-name { font-weight: 800; font-size: 0.95rem; line-height: 1.05; letter-spacing: -0.01em; }
.nav-group .label { margin-bottom: 6px; display: block; }
.nav-group a, .nav-group button.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 10px;
  margin: 0 -10px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font: inherit;
  font-size: 0.92rem;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
}
.nav-group a:hover, .nav-group button.nav:hover { color: var(--text); background: var(--panel-2); }
.nav-group a.on { color: var(--text); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }

.card { background: var(--panel-2); border-radius: var(--r); padding: 18px 20px; }
.section { padding: 22px 0; border-top: 1px solid var(--line); }
.section:first-of-type { border-top: 0; }
.section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head p { margin: 0; color: var(--muted); font-size: 0.85rem; }

/* ===== ボタン・チップ ===== */
.btn {
  appearance: none;
  border: 0;
  background: var(--panel-3);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, transform 0.08s, opacity 0.15s;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1.3;
}
.btn:hover { background: color-mix(in srgb, var(--panel-3) 70%, var(--text) 12%); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--text); color: var(--bg); }
.btn.primary:hover { background: color-mix(in srgb, var(--text) 88%, var(--bg)); }
.btn.accent { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.danger { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.btn.sm { padding: 5px 11px; font-size: 0.8rem; }
.btn.lg { padding: 14px 26px; font-size: 1rem; }
.btn.xl { padding: 20px 32px; font-size: 1.15rem; border-radius: 18px; }
.btn.block { width: 100%; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn {
  border: 0;
  font: inherit;
  font-size: 0.85rem;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.chip-btn:hover { color: var(--text); }
.chip-btn.on { background: var(--panel-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.chip-btn .n { color: var(--faint); margin-left: 4px; font-variant-numeric: tabular-nums; }
.chip-btn.on .n { color: var(--muted); }

.seg { display: inline-flex; background: var(--panel-2); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 0.82rem; font-weight: 600; padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.seg button.on { background: var(--text); color: var(--bg); }

/* ===== 入力 ===== */
input, select, textarea {
  font: inherit;
  font-size: 0.92rem;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  width: 100%;
  transition: border-color 0.15s, background 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: var(--line-2); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--text); background: var(--panel); }
input:disabled, select:disabled { opacity: 0.45; }
input[type='checkbox'], input[type='radio'] { width: 16px; height: 16px; accent-color: var(--text); }
input[type='color'] { padding: 3px; height: 40px; width: 56px; cursor: pointer; }
label.field { display: block; }
label.field > span { display: block; font-size: 0.78rem; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.chk { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; font-size: 0.9rem; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; background: var(--panel-3); color: var(--muted); }
.pill.live { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.pill.live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bad); display: inline-block; }
.dot.on { background: var(--good); }
.dot.wait { background: var(--warn); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.tbl th, .tbl td { padding: 10px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.tbl th { color: var(--muted); font-weight: 500; font-size: 0.75rem; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl input, .tbl select { padding: 7px 9px; }

#toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
#toast div {
  background: var(--text);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  animation: toastIn 0.25s ease-out;
}
#toast div.err { background: var(--bad); color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

.conn {
  position: fixed;
  top: 20px;
  right: 22px;
  z-index: 900;
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--panel-2);
  padding: 4px 10px;
  border-radius: 999px;
}

canvas.fx-layer { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 800; }

/* ===== ビンゴカード ===== */
.bcard { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.bcard .h { text-align: center; font-family: var(--num); font-weight: 800; font-size: 0.85rem; color: var(--muted); letter-spacing: 0.1em; padding-bottom: 2px; }
.bcard .c {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--panel-2);
  font-family: var(--num);
  font-weight: 700;
  font-size: clamp(1.15rem, 6vw, 1.7rem);
  letter-spacing: -0.03em;
  position: relative;
  transition: background 0.3s, color 0.3s, transform 0.3s;
}
.bcard .c.m { background: var(--accent); color: var(--accent-ink); }
.bcard .c.free { font-size: 0.68rem; font-family: var(--font); letter-spacing: 0.08em; font-weight: 800; }
.bcard .c.line { box-shadow: inset 0 0 0 2px var(--text); }
.bcard .c.new { animation: pop 0.6s cubic-bezier(0.2, 1.5, 0.4, 1); }
.bcard .c.wait::after { content: ''; position: absolute; inset: 4px; border-radius: 9px; border: 1.5px dashed var(--accent); animation: blink 1.2s infinite; }
@keyframes pop { 0% { transform: scale(0.5); } 100% { transform: scale(1); } }
@keyframes blink { 50% { opacity: 0.2; } }

/* ===== ルーレット ===== */
.wheel-wrap { position: relative; display: grid; place-items: center; }
.wheel-wrap canvas { width: 100%; height: auto; max-width: 100%; }
.wheel-pointer {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 28px solid var(--text);
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5));
  z-index: 2;
}

.overlay { position: fixed; inset: 0; z-index: 700; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
.conn:empty { display: none; }

.modal { background: var(--panel); border-radius: var(--r-lg); padding: 24px; width: min(440px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), inset 0 0 0 1px var(--line); }
.btn.danger-solid { background: var(--bad); color: #fff; }
.danger-zone { display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 16px 18px; border-radius: var(--r); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 35%, transparent); }
.danger-zone > div { flex: 1; min-width: 240px; }

.acct { background: var(--panel-2); border-radius: 12px; padding: 10px 12px; }
.acct-name { font-weight: 700; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-sub { font-size: .72rem; color: var(--muted); }
.keybox { background: var(--panel-2); border-radius: 10px; padding: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; word-break: break-all; user-select: all; }
.owner { color: var(--text); }

.modebox{margin-top:16px;padding:12px;border:1px solid var(--line);border-radius:14px;text-align:center}

/* ===== BINGO DROP 追加分 ===== */
.banner { border-radius: 14px; padding: 12px 16px; margin-bottom: 16px; font-size: 0.88rem; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: var(--panel-2); }
.banner.bad { background: color-mix(in srgb, var(--bad) 12%, transparent); }
.banner.bad b { color: var(--bad); }
.head .grow { flex: 1; }
.mode-switch button { font-size: 0.85rem; padding: 7px 16px; }
.choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-top: 6px; }
.choice label { display: flex; flex-direction: column; gap: 2px; background: var(--panel-2); border-radius: 14px; padding: 14px 16px; cursor: pointer; box-shadow: inset 0 0 0 1.5px transparent; }
.choice label:has(input:checked) { box-shadow: inset 0 0 0 1.5px var(--accent); }
.choice label:has(input:disabled) { opacity: 0.6; cursor: default; }
.choice input { display: none; }
.choice b { font-size: 1rem; }
.choice small { color: var(--muted); font-size: 0.78rem; }
.choice label:has(input:checked) b::before { content: '● '; color: var(--accent); }
.tbl .sw, .rs-fin .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.acct .btn { width: 100%; }

/* ===== かんたん設定の景品（表ではなく行のグリッド。スマホでも全列が見える） ===== */
.eprz { display: grid; gap: 8px; }
.eprz-head, .eprz-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 72px 40px; gap: 8px; align-items: center; }
.eprz-head { font-size: 0.75rem; color: var(--muted); padding: 0 2px; }
.eprz-row input { width: 100%; min-width: 0; }
.eprz-row input[data-p=rank] { border-left: 5px solid var(--pc, var(--panel-3)); }
.eprz-row .del { padding: 6px 0; width: 40px; }

/* ===== スマホ向けレイアウト ===== */
.m-top { display: none; }
@media (max-width: 760px) {
  .shell { padding: 8px; gap: 8px; grid-template-columns: 1fr; }
  .m-top { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; order: 0; }
  .main { order: 1; padding: 18px 16px 120px; border-radius: 20px; }
  .side { order: 2; border-radius: 20px; }
  .side > .brand { display: none; }
  .head { padding-right: 0 !important; }
  .conn { top: calc(10px + env(safe-area-inset-top)); right: auto; left: 50%; transform: translateX(-50%); }
  .dock { left: 8px !important; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)) !important; transform: none !important; min-width: 0 !important; }
  .links { grid-template-columns: minmax(0, 1fr) auto !important; gap: 4px 10px !important; }
  .links > span.small { grid-column: 1 / -1; margin-top: 8px; }
  .links code { font-size: 0.72rem !important; }
  .qr { width: 160px !important; }
  .eprz-head, .eprz-row { grid-template-columns: 76px minmax(0, 1fr) 54px 34px; gap: 6px; }
  .eprz-row .del { width: 34px; }
  .choice { grid-template-columns: 1fr; }
  .dock .msg { font-size: 0.78rem; }
  .kpis { grid-template-columns: repeat(2, 1fr) !important; }
  .keys { display: none !important; }
  /* 接続中の表示は、つながっている間は出さない（切れたときだけ出す） */
  .conn:has(.dot.on) { display: none; }
  #sec-url > .row { flex-direction: column; align-items: stretch !important; }
  #sec-url .links { width: 100%; }
}

/* ===== 権利抽選のカード ===== */
.tie-cards { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 1.6rem; }
.tc { width: 9.5rem; min-height: 8rem; border-radius: 18px; background: var(--panel-2); box-shadow: inset 0 0 0 2px var(--panel-3); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 12px 8px; transition: transform .12s, background .12s, opacity .4s; animation: pop .5s backwards; position: relative; }
.tc-top { font-family: var(--num); font-size: .8rem; font-weight: 700; color: var(--muted); letter-spacing: .06em; }
.tc-name { font-size: 1.4rem; font-weight: 900; letter-spacing: -0.02em; text-align: center; word-break: break-all; line-height: 1.2; }
.tc-tag { font-family: var(--num); font-weight: 900; font-size: .9rem; letter-spacing: .1em; min-height: 1.1em; }
.tc.lit { background: var(--text); color: var(--bg); transform: scale(1.08); box-shadow: 0 0 0 4px var(--accent), 0 0 40px color-mix(in srgb, var(--accent) 50%, transparent); }
.tc.lit .tc-top { color: var(--bg); }
.tc.win { background: var(--accent); color: var(--accent-ink); transform: scale(1.1); box-shadow: 0 0 0 4px var(--text), 0 0 50px color-mix(in srgb, var(--accent) 60%, transparent); animation: hitc .6s cubic-bezier(.2,1.4,.4,1); }
.tc.win .tc-top { color: var(--accent-ink); }
.tc.dim { opacity: .25; transform: scale(.94); }
.tie-cards.dense .tc { width: 7.5rem; min-height: 6.2rem; }
.tie-cards.dense .tc-name { font-size: 1.1rem; }
@keyframes hitc { 0% { transform: scale(.8) rotate(-4deg); } 100% { transform: scale(1.1); } }
.cfg { display: grid; gap: 8px; }
.cfg > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.cfg b { font-size: 0.9rem; min-width: 13em; }
.cfg code { font-size: 0.78rem; background: var(--panel); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
.bignum-s { font-family: var(--num); font-weight: 900; font-size: 2.2rem; letter-spacing: -0.04em; line-height: 1; }
.days { display: flex; align-items: flex-end; gap: 3px; height: 42px; flex: 1; min-width: 160px; }
.days i { flex: 1; max-width: 14px; min-height: 3px; background: var(--accent); border-radius: 3px 3px 0 0; }

/* ===== 日本語の改行：単語の途中で折り返さない ===== */
.nw { white-space: nowrap; display: inline-block; }
h1, h2, h3, .status, .btn, .pill, .lead, .eyebrow, .tc-name, .rs-big, .ov-sub, .who .nm { word-break: auto-phrase; }
