/* GW2 Raid Bingo - the game app. Shares the visual language of the public
   landing site (web/assets/style.css): same dark palette, gold accent, blurple
   buttons, panels and cards - so the two sites feel like one product. */

:root {
  --bg:        #0e1116;
  --bg-soft:   #161b22;
  --panel:     #1b222c;
  --panel-2:   #222b37;
  --border:    #2a3340;
  --ink:       #e6e8ec;
  --ink-soft:  #a9b1bd;
  --ink-dim:   #929aa6;
  --gold:      #d9b96a;
  --gold-soft: #b9974a;
  --green:     #3fb56b;
  --blurple:   #5865F2;
  --danger:    #e5534b;
  --shadow:    0 10px 30px rgba(0, 0, 0, 0.45);
  --radius:    14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  background:
    radial-gradient(1200px 600px at 50% -220px, rgba(217, 185, 106, 0.09), transparent 60%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- top bar ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  background: rgba(14, 17, 22, 0.7); position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand .crest { width: 34px; height: 34px; object-fit: contain; }
.account { font-size: 0.92rem; color: var(--ink-soft); display: flex; align-items: center; gap: 0.6rem; }
.account .avatar { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--gold-soft); object-fit: cover; }
.account .acct-label { font-weight: 600; color: var(--ink); max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.app { max-width: 780px; margin: 0 auto; padding: 22px 20px; }
.loading { color: var(--ink-dim); text-align: center; }
.muted { color: var(--ink-soft); }
.error { color: var(--danger); }

/* ---- buttons (match the landing) ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--blurple); color: #fff; border: 1px solid transparent;
  border-radius: 10px; padding: 0.6rem 1.05rem; font-size: 0.98rem; font-weight: 700;
  cursor: pointer; text-decoration: none;
  transition: transform 0.08s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; background: #4752c4; }
.btn.secondary { background: var(--panel); color: var(--ink); border-color: var(--border); }
.btn.secondary:hover { background: var(--panel); border-color: var(--gold-soft); color: var(--gold); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #cf463f; }
.btn.gold { background: var(--gold); color: #1a1a1a; box-shadow: 0 8px 22px rgba(217, 185, 106, 0.3); }
.btn.gold:hover { background: #e6c884; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ---- login / landing (logged-out) ---- */
.hero { text-align: center; padding: 3rem 1rem; }
.hero .crest-lg { width: 96px; height: 96px; object-fit: contain; margin-bottom: 1rem; }
.hero h1 { font-size: 1.7rem; margin: 0 0 0.5rem; }
.hero p { color: var(--ink-soft); max-width: 44ch; margin: 0.4rem auto 1.4rem; }
.hero .sub-link { display: block; margin-top: 1.2rem; font-size: 0.9rem; color: var(--ink-dim); }

/* ---- panels / rows ---- */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1rem; }
.row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }

/* ---- guild picker ---- */
.picker-item {
  display: flex; align-items: center; gap: 0.8rem; width: 100%; text-align: left;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--ink);
  border-radius: 10px; padding: 0.7rem 0.9rem; margin-bottom: 0.5rem; cursor: pointer; font-size: 1rem;
}
.picker-item:hover { border-color: var(--gold-soft); }
.guild-icon { width: 34px; height: 34px; border-radius: 50%; background: var(--bg-soft); object-fit: cover; }
.badge { font-size: 0.7rem; background: var(--blurple); color: #fff; border-radius: 6px; padding: 0.1rem 0.45rem; }

/* ---- instance tabs ---- */
.tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 1rem; }
.tab { background: var(--panel-2); border: 1px solid var(--border); color: var(--ink-soft); border-radius: 8px; padding: 0.4rem 0.7rem; cursor: pointer; font-size: 0.85rem; }
.tab:hover { color: var(--gold); border-color: var(--gold-soft); }
.tab.active { background: var(--gold); color: #1a1a1a; border-color: var(--gold); font-weight: 700; }

/* ---- board (framed with BINGO across the top and down the left) ---- */
.board-grid {
  display: grid;
  grid-template-columns: auto repeat(5, 1fr);
  gap: 6px;
  margin: 0 auto 2rem;
  max-width: 560px;
}
.bl {
  display: flex; align-items: center; justify-content: center;
  color: var(--gold); font-weight: 800; font-size: 1.05rem;
  min-width: 1.1rem;
}
.cell {
  aspect-ratio: 1 / 1; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px;
  color: var(--ink); font-size: 0.84rem; line-height: 1.2; padding: 5px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  cursor: default; overflow: hidden; word-break: break-word;
}
.cell.marked { background: rgba(63, 181, 107, 0.22); border-color: var(--green); color: #d6f5e2; font-weight: 600; }
.cell.free { background: rgba(217, 185, 106, 0.22); border-color: var(--gold-soft); color: var(--gold); font-weight: 800; }
.cell.playable { cursor: pointer; }
.cell.playable:hover { border-color: var(--gold); }

/* ---- leaders ---- */
.leaders { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.leaders li { display: flex; justify-content: space-between; padding: 0.3rem 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.leaders li:last-child { border-bottom: 0; }

/* ---- manage data ---- */
.jump-bar { margin: 1.2rem 0 1rem; }
.data-group { margin: 1.6rem 0 0.2rem; padding-bottom: 6px; border-bottom: 1px solid var(--border); color: var(--gold); }
.pool-card { padding: 0.9rem 1rem; }
.pool-card > .row:first-child { margin-bottom: 0.5rem; }
.entry-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 0.6rem; }
.entry-row { display: flex; align-items: center; gap: 0.4rem; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px; padding: 0.35rem 0.6rem; }
.entry-text { word-break: break-word; }
.icon-btn { background: transparent; border: 1px solid var(--border); color: var(--ink-soft); border-radius: 6px; width: 28px; height: 28px; cursor: pointer; font-size: 0.95rem; line-height: 1; flex: 0 0 auto; }
.icon-btn:hover { color: var(--gold); border-color: var(--gold-soft); }
.add-row { gap: 0.4rem; }
.text-input {
  flex: 1; min-width: 0; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px;
  color: var(--ink); padding: 0.5rem 0.7rem; font-size: 0.95rem; font-family: inherit;
}
.text-input:focus { outline: none; border-color: var(--gold-soft); }

.app-footer { text-align: center; color: var(--ink-dim); font-size: 0.8rem; padding: 1.5rem 1rem 2rem; }

.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 50; }

@media (max-width: 520px) { .cell { font-size: 0.72rem; } }
