/* 互動賓果房間 */

:root {
  --bg: #0b0f14;
  --panel: #111827;
  --line: #374151;
  --text: #f3f4f6;
  --muted: #9ca3af;
  --brand: #00d4ff;
  --ok: #22c55e;
  --warn: #f1c40f;
  --danger: #ef4444;
}

* { box-sizing: border-box; }

body.bingo-body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

.bingo-wrap {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 1rem 0.85rem 2.5rem;
}

.bingo-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.bingo-top h1 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--brand);
  font-weight: 800;
}

.bingo-top a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
}
.bingo-top a:hover { color: var(--brand); }

.bingo-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.05rem;
  margin-bottom: 1rem;
}

.bingo-panel h2 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  font-weight: 700;
}

.bingo-muted {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
  margin: 0 0 0.85rem;
}

.bingo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.bingo-input {
  flex: 1 1 10rem;
  min-width: 0;
  height: 2.6rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  padding: 0 0.85rem;
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: inherit;
}

.bingo-select {
  height: 2.6rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  padding: 0 0.7rem;
  font-family: inherit;
}

.bingo-btn {
  appearance: none;
  border: 0;
  border-radius: 10px;
  height: 2.6rem;
  padding: 0 1rem;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: transform 0.12s, opacity 0.12s;
}
.bingo-btn:active { transform: scale(0.97); }
.bingo-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.bingo-btn--primary { background: var(--brand); color: #041018; }
.bingo-btn--warn { background: var(--warn); color: #111; }
.bingo-btn--ok { background: var(--ok); color: #041018; }
.bingo-btn--danger {
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, 0.45);
}

.bingo-room-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex-shrink: 0;
}

.bingo-room-actions .bingo-btn {
  height: 2.2rem;
  padding: 0 0.75rem;
  font-size: 0.82rem;
}

.bingo-alert {
  display: none;
  margin-bottom: 0.85rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fecaca;
  font-size: 0.9rem;
}
.bingo-alert.is-on { display: block; }

.bingo-room-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.bingo-room-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.bingo-room-list strong {
  display: block;
  font-size: 0.95rem;
}
.bingo-room-list span {
  color: var(--muted);
  font-size: 0.78rem;
}

.bingo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  margin-bottom: 0.85rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.bingo-meta b { color: var(--text); font-weight: 700; }
.bingo-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.14em;
  color: var(--brand);
  font-weight: 800;
}

.bingo-board-shell {
  width: 100%;
  max-width: 640px;
  margin: 0 auto 1rem;
  aspect-ratio: 1 / 1;
  background: #000;
  border: 4px solid #333;
  padding: 4px;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.45);
}

#bingo-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
  width: 100%;
  height: 100%;
  gap: 1px;
  background: #222;
}

.bingo-cell {
  position: relative;
  background: #111;
  overflow: hidden;
  cursor: default;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.bingo-cell.is-markable { cursor: pointer; }
.bingo-cell.is-markable:hover { outline: 1px solid rgba(0, 212, 255, 0.55); outline-offset: -1px; }
.bingo-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  pointer-events: none;
}
.bingo-cell__empty {
  color: #444;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.bingo-cell__mark {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.bingo-cell.is-marked .bingo-cell__mark { display: flex; }
.bingo-cell__mark::after {
  content: "";
  width: 62%;
  height: 62%;
  border-radius: 999px;
  border: 3px solid rgba(239, 68, 68, 0.95);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35) inset;
  background: radial-gradient(circle at 50% 50%, rgba(239, 68, 68, 0.25), transparent 70%);
}

.bingo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: center;
  margin-top: 0.25rem;
}

.bingo-hint {
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0.5rem 0 0;
}

.bingo-loading {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-weight: 700;
}
.bingo-loading.is-on { display: flex; }

[hidden] { display: none !important; }
