/* ==========================================================================
   LyricBingo — Console pages (Account, Recent, Analytics)
   ========================================================================== */

.v2-console-page {
  max-width: 1200px;
}

.v2-console-hero {
  min-height: auto !important;
  padding: clamp(24px, 4vw, 40px) !important;
}

.v2-console-hero .v2-lead {
  max-width: 56ch;
}

.v2-analytics-toolbar h2 {
  margin: 0 0 4px;
  font-family: var(--v2-display);
  font-size: clamp(22px, 2.2vw, 28px);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.v2-analytics-toolbar p.muted {
  margin: 0;
  font-size: 14px;
}

.v2-console-hero .v2-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ── Shared toolbar ── */
.v2-page-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.v2-page-toolbar .v2-pill {
  flex-shrink: 0;
}

/* ── Small buttons ── */
.lb-v2 .v2-btn.sm {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: 12px;
}

.lb-v2 .v2-btn.ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.14);
}

.lb-v2 .v2-pill.sm {
  padding: 5px 10px;
  font-size: 11px;
}

/* ── Recent games list ── */
.v2-event-list {
  border: 1px solid var(--pro-border, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  background: var(--pro-elevated, #181818);
  overflow: hidden;
}

.v2-event-row {
  display: grid;
  grid-template-columns: 88px minmax(160px, 1.4fr) 88px minmax(180px, 1fr) 120px auto;
  gap: 14px;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.v2-event-row:last-child {
  border-bottom: none;
}

.v2-event-row-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--v2-muted);
}

.v2-event-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.v2-event-dot.live {
  background: var(--pro-accent, #1ed760);
  box-shadow: none;
}

.v2-event-dot.ended {
  background: rgba(255, 255, 255, 0.28);
}

.v2-event-row-body strong {
  display: block;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v2-event-row-body span {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  color: var(--v2-muted);
}

.v2-event-row-code code,
.v2-room-code {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.v2-event-row-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
}

.v2-event-row-time {
  font-size: 12px;
  color: var(--v2-muted);
  white-space: nowrap;
}

.v2-event-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

/* ── Analytics data table ── */
.v2-data-table-wrap {
  border: 1px solid var(--pro-border, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  background: var(--pro-elevated, #181818);
  overflow: auto;
}

.v2-data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

.v2-data-table th {
  padding: 14px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--v2-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.v2-data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: middle;
  font-size: 14px;
}

.v2-data-table tbody tr:last-child td {
  border-bottom: none;
}

.v2-data-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.v2-td-main strong {
  display: block;
  font-size: 15px;
}

.v2-td-main span {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--v2-muted);
}

.v2-data-table td.num {
  font-family: var(--v2-font);
  font-size: 18px;
  font-weight: 700;
  color: var(--pro-accent, #1ed760);
  white-space: nowrap;
}

.v2-td-actions {
  white-space: nowrap;
}

.v2-td-actions .v2-btn {
  margin-left: 6px;
}

.v2-td-actions .v2-btn:first-child {
  margin-left: 0;
}

/* ── Venue strip ── */
.v2-venue-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.v2-venue-chip {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
}

.v2-venue-chip strong {
  color: #fff;
  margin-right: 4px;
}


/* ── Stat cards ── */
.v2-console-page .v2-stat-grid .v2-card.v2-stat {
  min-height: 0;
  padding: 20px !important;
}

.v2-console-page .v2-stat-grid .v2-stat h3 {
  font-size: clamp(28px, 3vw, 36px);
}

/* ── Split layout (account) ── */
.v2-console-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}

.v2-console-main,
.v2-console-side {
  display: grid;
  gap: 20px;
}

.v2-console-card {
  padding: 22px !important;
}

.v2-console-card > h2 {
  font-family: var(--v2-display);
  font-size: clamp(22px, 2.2vw, 28px);
  margin: 0 0 16px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Settings list */
.v2-settings-list {
  display: grid;
  gap: 8px;
}

.v2-setting-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.v2-setting-row:hover {
  border-color: var(--pro-border-strong, rgba(255, 255, 255, 0.14));
  background: var(--pro-hover, #282828);
  transform: translateX(2px);
}

.v2-setting-row strong {
  display: block;
  font-size: 15px;
}

.v2-setting-row p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--v2-muted);
  line-height: 1.45;
}

.v2-setting-row > i {
  font-style: normal;
  color: var(--v2-muted);
  font-size: 18px;
}

.v2-setting-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 18px;
  background: var(--pro-accent-dim, rgba(30, 215, 96, 0.14));
  border: 1px solid var(--pro-border, rgba(255, 255, 255, 0.08));
}

/* Recent rows */
.v2-console-rows {
  display: grid;
  gap: 0;
}

.v2-console-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
  color: inherit;
  transition: opacity 0.15s ease;
}

.v2-console-row:last-child {
  border-bottom: none;
}

.v2-console-row:hover {
  opacity: 0.9;
}

.v2-console-row strong {
  display: block;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v2-console-row small {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--v2-muted);
}

.v2-console-row > i {
  font-style: normal;
  color: var(--v2-muted);
}

.v2-console-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.v2-console-card-head h2 {
  margin: 0 !important;
}

.v2-console-card-head a {
  color: var(--pro-accent, #1ed760);
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
}

/* Plan sidebar */
.v2-plan-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--pro-accent-dim, rgba(30, 215, 96, 0.14));
  border: none;
  color: var(--pro-accent, #1ed760);
}

.v2-plan-name {
  display: block;
  margin: 12px 0 4px;
  font-family: var(--v2-display);
  font-size: 32px;
  text-transform: capitalize;
  line-height: 1;
}

.v2-plan-email {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--v2-muted);
}

.v2-plan-features {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.78);
}

.v2-plan-features li::before {
  content: "✓ ";
  color: var(--v2-lime);
  font-weight: 900;
}

.v2-side-links {
  display: grid;
  gap: 0;
}

.v2-side-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 0;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}

.v2-side-link:last-child {
  border-bottom: none;
}

.v2-side-link:hover {
  color: #fff;
}

/* ── Analytics ── */
.v2-analytics-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.v2-console-search {
  flex: 1;
  min-width: min(100%, 280px);
  max-width: 420px;
  height: 44px;
  border-radius: 500px;
  border: 1px solid transparent;
  background: var(--pro-elevated, #181818);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
}

.v2-console-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--v2-text);
  font-size: 15px;
}

.v2-console-search span {
  opacity: 0.45;
}

.v2-insights-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.v2-insight-card {
  padding: 20px !important;
  min-height: 160px;
}

.v2-insight-card h2 {
  font-family: var(--v2-display);
  font-size: 18px;
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.v2-venue-list {
  display: grid;
  gap: 10px;
}

.v2-venue-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 14px;
}

.v2-venue-list div:last-child {
  border-bottom: none;
}

.v2-venue-list span {
  color: var(--v2-muted);
  font-size: 12px;
  white-space: nowrap;
}

/* Report cards (analytics games) */
.v2-report-list {
  display: grid;
  gap: 14px;
}

.v2-report-card {
  border: 1px solid var(--pro-border, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  padding: 20px;
  background: var(--pro-elevated, #181818);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.v2-report-card:hover {
  border-color: var(--pro-border-strong, rgba(255, 255, 255, 0.14));
  background: var(--pro-hover, #282828);
}

.v2-report-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.v2-report-head h3 {
  margin: 8px 0 4px;
  font-family: var(--v2-display);
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.05;
}

.v2-report-head p {
  margin: 0;
  font-size: 13px;
  color: var(--v2-muted);
}

.v2-report-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.v2-report-stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.v2-report-stats div {
  padding: 12px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}

.v2-report-stats b {
  display: block;
  font-family: var(--v2-font);
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 700;
  line-height: 1;
  color: var(--pro-accent, #1ed760);
}

.v2-report-stats span {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--v2-muted);
}

.v2-report-details {
  margin-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 4px;
}

.v2-report-details summary {
  cursor: pointer;
  padding: 10px 0;
  font-weight: 800;
  font-size: 13px;
  color: var(--v2-muted);
  list-style: none;
}

.v2-report-details summary::-webkit-details-marker {
  display: none;
}

.v2-report-deep {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding-bottom: 8px;
}

.v2-report-deep h4 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--v2-muted);
}

.v2-report-deep p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.78);
}

.v2-upgrade-card {
  text-align: center;
  padding: 40px 28px !important;
}

.v2-upgrade-card h2 {
  margin: 12px 0 8px;
}

.v2-empty-state {
  padding: 32px 20px;
  text-align: center;
}

.v2-empty-state b {
  display: block;
  font-size: 16px;
  margin-bottom: 6px;
}

/* Modals (account) */
.v2-db-modal[hidden] {
  display: none !important;
}

.v2-db-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.v2-db-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
}

.v2-db-modal-card {
  position: relative;
  width: min(620px, 100%);
  max-height: min(820px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid var(--pro-border, rgba(255, 255, 255, 0.08));
  border-radius: 16px;
  background: var(--pro-elevated, #181818);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  padding: 24px;
}

.v2-db-modal-card.wide {
  width: min(900px, 100%);
}

.v2-db-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

@media (max-width: 1100px) {
  .v2-console-split {
    grid-template-columns: 1fr;
  }

  .v2-event-row {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "status code"
      "body body"
      "stats stats"
      "time actions";
  }

  .v2-event-row-status { grid-area: status; }
  .v2-event-row-code { grid-area: code; justify-self: end; }
  .v2-event-row-body { grid-area: body; }
  .v2-event-row-stats { grid-area: stats; }
  .v2-event-row-time { grid-area: time; align-self: center; }
  .v2-event-row-actions { grid-area: actions; justify-self: end; }

  .v2-insights-grid {
    grid-template-columns: 1fr;
  }

  .v2-report-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .v2-report-deep {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .v2-report-head {
    display: grid;
  }

  .v2-report-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .v2-report-actions {
    width: 100%;
  }

  .v2-report-actions .v2-btn {
    flex: 1;
  }
}
