/* PROTOCOL v3.3 admin panel (app/admin-panel.js): full-screen over the lobby, lobby look. Tables become cards on a phone. */
.lobby-admin { position: absolute; top: max(12px, env(safe-area-inset-top)); left: 12px; z-index: 2; min-height: 44px; padding: 8px 14px; font-size: 14px;
  background: rgba(6,14,24,0.85); color: #ffd27a; border-color: rgba(255,210,122,0.5); }

.admin { position: fixed; inset: 0; z-index: 21000; overflow-y: auto; -webkit-overflow-scrolling: touch; color: var(--ink);
  background: radial-gradient(120% 80% at 50% 0%, #133250 0%, #08121e 55%, #04070d 100%);
  padding: max(12px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); box-sizing: border-box; touch-action: manipulation; }
.admin *, .admin *::before, .admin *::after { box-sizing: border-box; }
.admin-head { position: sticky; top: calc(-1 * max(12px, env(safe-area-inset-top))); z-index: 3; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  max-width: 1200px; margin: 0 auto; padding: 10px 0; background: linear-gradient(180deg, #0f2740 70%, rgba(15,39,64,0)); }
.admin-title { font-size: 26px; font-weight: 800; color: #eaf6ff; text-shadow: 0 2px 18px rgba(80,170,255,0.45); margin-right: auto; }
.admin-tabs .seg-btn { min-width: 96px; }
.admin-close { min-height: 44px; }
.admin-body { max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.admin-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.admin-tools .lobby-link { align-self: auto; }
.admin-updated { color: var(--ink-dim); font-size: 13px; }

.admin-table { width: 100%; border-collapse: separate; border-spacing: 0 6px; font-size: 15px; }
.admin-table th { text-align: left; color: var(--ink-dim); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 4px 10px; }
.admin-table td { padding: 10px; vertical-align: middle; background: rgba(10,22,36,0.75); border-top: 1px solid rgba(160,200,235,0.18); border-bottom: 1px solid rgba(160,200,235,0.18); }
.admin-table td:first-child { border-left: 1px solid rgba(160,200,235,0.18); border-radius: 12px 0 0 12px; }
.admin-table td:last-child { border-right: 1px solid rgba(160,200,235,0.18); border-radius: 0 12px 12px 0; }
.admin-table tr.is-self td { border-color: rgba(89,183,255,0.5); }
.admin-table tr.is-over td { opacity: 0.6; }
.admin-empty { text-align: center; color: var(--ink-dim); }
.admin-cell-name { overflow-wrap: anywhere; }
.admin-you { color: #8ccaff; font-weight: 600; }
.admin-code { letter-spacing: 0.12em; color: #fff3c4; }
.admin .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #4a5866; vertical-align: middle; }
.admin .dot.is-on { background: #49d17a; box-shadow: 0 0 8px rgba(73,209,122,0.7); }
.admin-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; color: var(--ink-dim); border: 1px solid rgba(160,200,235,0.3); }
.admin-badge.is-admin { color: #2a1600; background: linear-gradient(180deg, #ffd27a, #e79a2d); border-color: transparent; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.admin-table td.admin-actions { display: table-cell; text-align: right; white-space: normal; }
.admin-act { min-height: 44px; padding: 8px 12px; font-size: 14px; margin: 2px 0 2px 4px; }
.lobby-btn.is-danger-ghost { color: #ffb4a6; border-color: rgba(255,140,120,0.5); }
.lobby-btn.is-danger { background: linear-gradient(180deg, #ff8a72, #d4482c); color: #2a0800; border-color: transparent; }
.admin-seats { display: flex; flex-direction: column; gap: 2px; }
.admin-seat.is-open { color: var(--ink-dim); font-style: italic; }
.admin-life { color: #ffd27a; font-weight: 800; }
.admin-status { font-weight: 800; }
.admin-status.is-playing { color: #49d17a; }
.admin-status.is-waiting { color: #ffd27a; }
.admin-status.is-closed, .admin-status.is-finished { color: var(--ink-dim); }

.admin-server { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.admin-stat { padding: 10px 14px; border-radius: 12px; background: rgba(10,22,36,0.75); border: 1px solid rgba(160,200,235,0.18); }
.admin-stat .lobby-label { margin-top: 0; font-size: 11px; }
.admin-stat-value { font-size: 20px; font-weight: 800; overflow-wrap: anywhere; }
.admin-meter { height: 6px; margin-top: 6px; border-radius: 3px; background: rgba(160,200,235,0.18); overflow: hidden; }
.admin-meter > div { height: 100%; background: #49d17a; transition: width 400ms ease; }
.admin-meter.is-warm > div { background: #ffd27a; }
.admin-meter.is-hot > div { background: #ff8a72; }

.admin-scrim { position: fixed; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(2,6,12,0.7); }
.admin-dialog-card { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: 16px;
  background: var(--panel); border: 1px solid var(--panel-edge, rgba(160,200,235,0.3)); box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
.admin-dialog-title { font-size: 20px; font-weight: 800; overflow-wrap: anywhere; }
.admin-dialog-msg { font-size: 15px; line-height: 1.4; }
.admin-dialog-msg.is-dim, .admin-hint { color: var(--ink-dim); font-size: 13px; }
.admin-hint { margin-top: -6px; }
.admin-dialog-buttons { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.admin-dialog-error:empty { display: none; }
.admin-pw { font-family: ui-monospace, Menlo, monospace; font-size: 17px; letter-spacing: 0.04em; color: #fff3c4; }
.admin-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 700; cursor: pointer; }
.admin-check input { width: 22px; height: 22px; }

/* phone: every row is a card, every cell a label/value line */
@media (max-width: 760px) {
  .admin-title { font-size: 22px; }
  .admin-tabs { order: 3; width: 100%; }
  .admin-tabs .seg-btn { flex: 1 1 0; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
  .admin-table thead { display: none; }
  .admin-table { border-spacing: 0; }
  .admin-table tr { margin-bottom: 10px; padding: 8px 12px; border-radius: 12px; background: rgba(10,22,36,0.75); border: 1px solid rgba(160,200,235,0.18); }
  .admin-table tr.is-self { border-color: rgba(89,183,255,0.5); }
  .admin-table td, .admin-table td:first-child, .admin-table td:last-child { background: none; border: 0; border-radius: 0; padding: 5px 0; display: flex; gap: 12px; justify-content: space-between; align-items: baseline; text-align: right; }
  .admin-table td::before { content: attr(data-label); color: var(--ink-dim); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; text-align: left; flex: 0 0 auto; }
  .admin-table td.admin-empty::before { content: none; }
  .admin-table td.admin-actions { display: flex; flex-wrap: wrap; justify-content: stretch; padding-top: 8px; }
  .admin-table td.admin-actions::before { content: none; }
  .admin-act { flex: 1 1 auto; margin: 0; }
  .admin-seats { align-items: flex-end; }
}
