/* Poker Mavens server directory - no jQuery. Colours follow the
   Poker Mavens client default theme. - Claude 2026-11-08 */

:root {
  --page: #c9bba1;
  --title: #2b2118; --title-text: #f1e6d3; --title-hi: #f3d27a;
  --body: #efe9de; --text: #2b2118; --muted: #7a6a55; --subtext: #5a4a36;
  --tab: #6e5a44; --tab-text: #e8dcc8; --tab-on: #4a3a2b; --tab-on-text: #f3d27a;
  --grid: #e4ded8; --grid-text: #2b2118; --grid-head: #c3baa7; --grid-head-text: #2b2118;
  --grid-sel: #2b2118; --grid-sel-text: #e4ded8; --grid-hover: #d8cfc0;
  --btn: #4a3a2b; --btn-text: #e8dcc8; --primary: #2f6b3a; --primary-text: #ffffff;
  --accent: #c9a24a; --edge: rgba(0,0,0,0.18); --input: #ffffff; --input-text: #2b2118;
  --err: #8c2f2a; --scroll: #8a7258; --scroll-hover: #6e5a44;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #17120d;
    --title: #0e0b08; --title-text: #f1e6d3; --title-hi: #f3d27a;
    --body: #2b2118; --text: #e8dcc8; --muted: #a8977f; --subtext: #c9b89e;
    --tab: #3a2d21; --tab-text: #c9b89e; --tab-on: #4a3a2b; --tab-on-text: #f3d27a;
    --grid: #221a13; --grid-text: #e8dcc8; --grid-head: #3a2d21; --grid-head-text: #f1e6d3;
    --grid-sel: #c9a24a; --grid-sel-text: #1b140e; --grid-hover: #33281d;
    --btn: #4a3a2b; --btn-text: #e8dcc8; --primary: #2f6b3a; --primary-text: #ffffff;
    --accent: #c9a24a; --edge: rgba(255,255,255,0.12); --input: #1b140e; --input-text: #e8dcc8;
    --err: #e0857d; --scroll: #6e5a44; --scroll-hover: #8a7258;
  }
}
:root[data-theme="dark"] {
  --page: #17120d;
  --title: #0e0b08; --title-text: #f1e6d3; --title-hi: #f3d27a;
  --body: #2b2118; --text: #e8dcc8; --muted: #a8977f; --subtext: #c9b89e;
  --tab: #3a2d21; --tab-text: #c9b89e; --tab-on: #4a3a2b; --tab-on-text: #f3d27a;
  --grid: #221a13; --grid-text: #e8dcc8; --grid-head: #3a2d21; --grid-head-text: #f1e6d3;
  --grid-sel: #c9a24a; --grid-sel-text: #1b140e; --grid-hover: #33281d;
  --accent: #c9a24a; --edge: rgba(255,255,255,0.12); --input: #1b140e; --input-text: #e8dcc8;
  --err: #e0857d; --scroll: #6e5a44; --scroll-hover: #8a7258;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--page); color: var(--text);
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding: 24px 16px;
}
a { color: inherit; }

/* Scrollbars in the theme colours: scrollbar-color for Chrome/Edge/Firefox,
   ::-webkit-scrollbar for Safari. - Claude 2026-11-08 */
html  { scrollbar-color: var(--scroll) var(--page); }
.grid, .info { scrollbar-color: var(--scroll) var(--grid); }
@supports not (scrollbar-color: auto) {
  ::-webkit-scrollbar { width: 12px; height: 12px; }
  ::-webkit-scrollbar-track { background: var(--page); }
  .grid::-webkit-scrollbar-track, .info::-webkit-scrollbar-track { background: var(--grid); }
  ::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 6px;
                              border: 3px solid transparent; background-clip: padding-box; }
  ::-webkit-scrollbar-thumb:hover { background-color: var(--scroll-hover); }
}
button { font: inherit; }

.wrap { max-width: 960px; margin: 0 auto; border-radius: 10px; overflow: hidden;
        box-shadow: 0 6px 24px rgba(0,0,0,0.25); background: var(--body); }

/* Title bar */
.titlebar { background: var(--title); color: var(--title-text); padding: 14px 20px;
            display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.titlebar h1 { margin: 0; font-size: 1.35em; font-weight: 600; letter-spacing: 0.01em; }
.titlebar h1 .suit { color: var(--title-hi); margin-right: 6px; }
.titlebar .sub { color: var(--tab-text); opacity: 0.8; font-size: 0.95em; }

/* Tabs */
.tabs { display: flex; background: var(--title); padding: 0 12px; gap: 4px; overflow-x: auto; }
.tabs button { background: var(--tab); color: var(--tab-text); border: 0; cursor: pointer;
               padding: 9px 18px; border-radius: 8px 8px 0 0; white-space: nowrap;
               width: 9.75em; }
.tabs button:hover { filter: brightness(1.12); }
.tabs button[aria-selected="true"] { background: var(--tab-on); color: var(--tab-on-text); }
.tabs .count { opacity: 0.75; font-size: 0.9em; margin-left: 4px; }

.pane { padding: 20px; }
.pane[hidden] { display: none; }

.welcome { max-width: 760px; }
.welcome h2 { font-size: 1.1em; margin: 18px 0 4px; color: var(--subtext); }
.welcome h2:first-child { margin-top: 0; }
.welcome p { margin: 0 0 10px; }
.welcome .deal { font-weight: 600; margin-top: 18px; color: var(--subtext); }

/* Server list */
.listhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.listhead .note { color: var(--muted); font-size: 0.9em; flex: 1; min-width: 200px; }
.listhead .stamp { color: var(--muted); font-size: 0.85em; }

/* The list takes what the window has left after the ~400px around it (title,
   tabs, info box, buttons, footer), so the page itself never scrolls. - Claude 2026-11-09 */
.grid { border: 1px solid var(--edge); border-radius: 6px; overflow: auto;
        max-height: max(12em, calc(100vh - 400px));
        background: var(--grid); }
table { width: 100%; border-collapse: collapse; color: var(--grid-text); }
thead th { position: sticky; top: 0; background: var(--grid-head); color: var(--grid-head-text);
           text-align: left; font-weight: 600; padding: 7px 12px; cursor: pointer;
           user-select: none; white-space: nowrap; }
thead th.num, td.num { text-align: right; }
thead th[aria-sort="ascending"]::after { content: " \25B2"; font-size: 0.7em; }
thead th[aria-sort="descending"]::after { content: " \25BC"; font-size: 0.7em; }
tbody td { padding: 6px 12px; border-top: 1px solid var(--edge); cursor: pointer; }
tbody tr:hover td { background: var(--grid-hover); }
tbody tr[aria-selected="true"] td { background: var(--grid-sel); color: var(--grid-sel-text); }
td.site { font-weight: 500; overflow-wrap: anywhere; }
td .lock { font-size: 0.85em; margin-left: 6px; opacity: 0.8; }
.empty { padding: 28px 12px; text-align: center; color: var(--muted); }
.empty.err { color: var(--err); }

.info { height: calc(3em + 18px); overflow-y: auto; margin: 10px 0; padding: 8px 12px; border: 1px solid var(--edge);
        border-radius: 6px; background: var(--grid); font-size: 0.93em; overflow-wrap: anywhere; }
.info b { margin-right: 4px; }
.info .dim { color: var(--muted); }

.buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { background: var(--btn); color: var(--btn-text); border: 0; border-radius: 6px;
       padding: 8px 18px; cursor: pointer; }
.btn:hover { filter: brightness(1.15); }
.btn.primary { background: var(--primary); color: var(--primary-text); }
.btn:disabled { opacity: 0.5; cursor: default; filter: none; }

.footer { text-align: center; color: var(--muted); font-size: 0.85em; padding: 14px 16px 0; }

/* Password dialog */
dialog { border: 0; border-radius: 10px; padding: 0; width: min(360px, calc(100vw - 32px));
         background: var(--body); color: var(--text); box-shadow: 0 10px 40px rgba(0,0,0,0.4); }
dialog::backdrop { background: rgba(0,0,0,0.45); }
dialog .dtitle { background: var(--title); color: var(--title-text); padding: 10px 16px; font-weight: 600; }
dialog .dbody { padding: 16px; }
dialog .dsite { font-weight: 600; margin: 0 0 10px; overflow-wrap: anywhere; }
dialog label { display: block; margin-bottom: 4px; font-size: 0.93em; }
dialog input { width: 100%; padding: 7px 9px; border: 1px solid var(--edge); border-radius: 5px;
               background: var(--input); color: var(--input-text); font: inherit; }
dialog input:focus { outline: 2px solid var(--accent); outline-offset: 0; }
dialog .derr { color: var(--err); font-size: 0.9em; min-height: 1.4em; margin: 6px 0 0; }
dialog .buttons { justify-content: flex-end; padding: 0 16px 16px; }

/* Phone: rows become cards */
@media (max-width: 600px) {
  body { padding: 0; }
  .wrap { border-radius: 0; box-shadow: none; min-height: 100vh; }
  .titlebar { padding: 12px 16px; }
  .tabs { padding: 0 8px; }
  .tabs button { padding: 9px 12px; width: auto; flex: 1 1 0; }
  .pane { padding: 16px; }
  .grid { max-height: none; border: 0; background: transparent; overflow: visible; }
  thead { display: none; }
  table, tbody, tr, td { display: block; width: 100%; }
  tbody tr { background: var(--grid); border: 1px solid var(--edge); border-radius: 8px;
             margin-bottom: 8px; padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 2px 14px; }
  tbody tr[aria-selected="true"] { background: var(--grid-sel); }
  tbody td { border: 0; padding: 0; width: auto; background: transparent !important;
             font-size: 0.9em; color: inherit; }
  tbody tr[aria-selected="true"] td { color: var(--grid-sel-text); }
  td.site { flex: 1 0 100%; font-size: 1em; }
  td[data-label]:not(.site)::before { content: attr(data-label) ": "; opacity: 0.7; }
  td.num { text-align: left; }
  .empty { background: var(--grid); border-radius: 8px; }
  .info { height: auto; min-height: 3.2em; }
  .buttons .btn { flex: 1; }
}
