:root {
  --ink: #0d2233;
  --sea: #123a52;
  --foam: #e9f1f2;
  --brass: #d6a54a;
  --brass-dark: #a87a2a;
  --parch: #f4ead3;
  --parch-edge: #d9c69c;
  --text: #2b2418;
  --err: #a5321f;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Crimson Pro', Georgia, serif;
  background: radial-gradient(ellipse at 50% 20%, #1d5675 0%, var(--sea) 45%, var(--ink) 100%);
  color: var(--foam);
  min-height: 100vh;
  overflow-x: hidden;
}
#sea { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
.wrap { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; gap: 24px; }
.brand { text-align: center; }
.compass { width: 72px; height: 72px; margin: 0 auto 8px; color: var(--brass); animation: drift 18s ease-in-out infinite; }
@keyframes drift { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
h1 { font-family: 'Cinzel', Georgia, serif; font-weight: 700; font-size: clamp(2.2rem, 6vw, 3.6rem); letter-spacing: .06em; margin: 0; color: var(--parch); text-shadow: 0 2px 0 rgba(0,0,0,.35), 0 0 30px rgba(214,165,74,.25); }
.tag { margin: 6px 0 0; font-size: 1.15rem; opacity: .85; max-width: 32ch; margin-inline: auto; }
.card {
  width: min(400px, 100%);
  background: linear-gradient(180deg, var(--parch), #efe1c2);
  color: var(--text);
  border-radius: 6px;
  padding: 22px 24px 18px;
  box-shadow: 0 0 0 1px var(--parch-edge), 0 0 0 5px rgba(13,34,51,.55), 0 0 0 6px var(--brass-dark), 0 24px 60px rgba(0,0,0,.45);
}
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 16px; border-bottom: 2px solid var(--parch-edge); }
.tabs button { font: 600 1.05rem 'Cinzel', Georgia, serif; background: none; border: 0; padding: 8px 4px 10px; color: #7b6a4a; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--brass-dark); }
label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 12px; color: #4a3f2c; }
input { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; font: 1.05rem 'Crimson Pro', Georgia, serif; color: var(--text); background: #fffaf0; border: 1px solid var(--parch-edge); border-radius: 4px; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus { border-color: var(--brass-dark); box-shadow: 0 0 0 3px rgba(214,165,74,.3); }
.primary { width: 100%; margin-top: 6px; padding: 12px; font: 700 1.1rem 'Cinzel', Georgia, serif; letter-spacing: .05em; color: var(--ink); background: linear-gradient(180deg, #e8bd63, var(--brass)); border: 1px solid var(--brass-dark); border-radius: 4px; cursor: pointer; box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 2px 0 var(--brass-dark); }
.primary:hover { filter: brightness(1.05); }
.primary:active { transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.4); }
.primary:disabled { opacity: .6; cursor: wait; }
.error { min-height: 1.3em; margin: 0 0 6px; color: var(--err); font-weight: 600; }
.fine { margin: 12px 0 0; font-size: .9rem; color: #7b6a4a; text-align: center; }
footer { font-size: .9rem; opacity: .6; }
footer a { color: inherit; }

select { display: block; width: 100%; margin-top: 4px; padding: 9px 10px; font: 1.02rem 'Crimson Pro', Georgia, serif; color: var(--text); background: #fffaf0; border: 1px solid var(--parch-edge); border-radius: 4px; }
select:focus { border-color: var(--brass-dark); outline: none; box-shadow: 0 0 0 3px rgba(214,165,74,.3); }
.hint { font-weight: 400; color: #8a7a58; }
.links { display: flex; justify-content: space-between; margin: 10px 0 0; font-size: .95rem; }
.links a { color: #6b5426; }
.question { margin: 0 0 10px; padding: 10px 12px; background: rgba(214,165,74,.15); border-left: 3px solid var(--brass-dark); border-radius: 3px; font-weight: 600; color: var(--ink); }
.ok { color: #2f7a35; font-weight: 600; }
[hidden] { display: none !important; }
.share a { color: #6b5426; font-weight: 600; word-break: break-all; }

/* ---------- server browser ---------- */
.card.browser { width: min(760px, 100%); padding: 20px 22px 16px; }
.b-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; border-bottom: 2px solid var(--parch-edge); padding-bottom: 8px; }
.b-head h2, .browser h3 { font-family: 'Cinzel', Georgia, serif; color: var(--ink); margin: 0; }
.b-head h2 { font-size: 1.35rem; }
.browser h3 { font-size: 1.05rem; margin: 18px 0 2px; }
.b-who { font-size: .95rem; color: #6b5a3a; }
.b-who a, .b-head a { color: #6b5426; }
.b-bar { display: flex; justify-content: space-between; align-items: center; margin: 10px 0 6px; color: #6b5a3a; font-size: .95rem; }
button.small { font: 600 .9rem 'Crimson Pro', Georgia, serif; padding: 5px 12px; border-radius: 4px; border: 1px solid var(--brass-dark); background: #fff6e2; color: var(--ink); cursor: pointer; }
button.small:hover { background: #fdecc6; }
button.small:disabled { opacity: .55; cursor: wait; }
button.link { background: none; border: 0; color: #8a6a3a; cursor: pointer; font-size: 1rem; padding: 0 4px; }
.b-cols, .b-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px 92px 84px; gap: 12px; align-items: center; }
.b-cols { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: #8a7a58; padding: 0 12px 4px; }
.b-list { display: flex; flex-direction: column; gap: 8px; }
.b-row { background: #fffaf0; border: 1px solid var(--parch-edge); border-radius: 5px; padding: 10px 12px; }
.b-row.last { border-color: var(--brass-dark); box-shadow: 0 0 0 2px rgba(214,165,74,.25); }
.b-row.full { opacity: .7; }
.b-name { font: 700 1.05rem 'Cinzel', Georgia, serif; color: var(--ink); display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.b-desc { font-size: .95rem; color: #4a3f2c; margin-top: 1px; }
.b-tags { font-size: .82rem; color: #8a7a58; margin-top: 3px; }
.pill { font: 600 .7rem 'Crimson Pro', Georgia, serif; text-transform: uppercase; letter-spacing: .06em; padding: 1px 7px; border-radius: 9px; background: rgba(13,34,51,.08); color: #5a4a2c; }
.pill.mine { background: rgba(47,122,53,.14); color: #2f7a35; }
.pill.bad { background: rgba(165,50,31,.12); color: var(--err); }
.b-players { font-size: .95rem; color: #4a3f2c; font-variant-numeric: tabular-nums; }
.b-players b { font-size: 1.1rem; color: var(--ink); }
.meter { height: 5px; background: rgba(13,34,51,.12); border-radius: 3px; margin-top: 4px; overflow: hidden; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, #4f9a57, var(--brass)); }
.ping { font-variant-numeric: tabular-nums; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; color: #7b6a4a; }
.ping.good { color: #2f7a35; } .ping.ok { color: #9a6b00; } .ping.bad { color: var(--err); }
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.bars i { width: 3px; background: currentColor; opacity: .22; border-radius: 1px; }
.bars i:nth-child(1) { height: 4px; } .bars i:nth-child(2) { height: 7px; } .bars i:nth-child(3) { height: 10px; } .bars i:nth-child(4) { height: 14px; }
.bars.b1 i:nth-child(-n+1), .bars.b2 i:nth-child(-n+2), .bars.b3 i:nth-child(-n+3), .bars.b4 i { opacity: 1; }
.b-go { text-align: right; }
a.join { display: inline-block; font: 700 .95rem 'Cinzel', Georgia, serif; color: var(--ink); text-decoration: none; padding: 7px 14px; border-radius: 4px; background: linear-gradient(180deg, #e8bd63, var(--brass)); border: 1px solid var(--brass-dark); box-shadow: 0 2px 0 var(--brass-dark); }
a.join:hover { filter: brightness(1.06); }
.b-empty { margin: 4px 0; color: #8a7a58; font-style: italic; }
.b-empty.bad { color: var(--err); font-style: normal; }
.b-remote-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; color: #4a3f2c; margin-top: 4px; }
.b-add { display: flex; gap: 8px; margin-top: 10px; }
.b-add input { margin: 0; }
.browser .error { margin-top: 8px; }
p.share { margin: 0; text-align: center; color: var(--foam); opacity: .9; font-size: 1rem; }
p.share a { color: var(--brass); font-weight: 600; word-break: break-all; }
@media (max-width: 600px) {
  .b-cols { display: none; }
  .b-row { grid-template-columns: 1fr auto; grid-template-areas: "info info" "players go" "ping go"; row-gap: 6px; }
  .b-info { grid-area: info; } .b-players { grid-area: players; } .b-ping { grid-area: ping; } .b-go { grid-area: go; align-self: center; }
  .b-players { display: flex; align-items: center; gap: 8px; } .meter { width: 80px; margin: 0; }
}

.notice { margin: 0 0 14px; padding: 10px 12px; border-radius: 4px; background: rgba(47,122,53,.12); border-left: 3px solid #2f7a35; color: #24562a; font-weight: 600; }
.notice.bad { background: rgba(165,50,31,.1); border-left-color: var(--err); color: var(--err); }
.secondary { width: 100%; margin: 0 0 10px; padding: 10px; font: 600 1rem 'Crimson Pro', Georgia, serif; color: var(--ink); background: #fffaf0; border: 1px solid var(--brass-dark); border-radius: 4px; cursor: pointer; }
.secondary:hover { background: #fff3da; }
.secondary:disabled { opacity: .6; cursor: wait; }
.or { margin: 4px 0 10px; text-align: center; color: #7b6a4a; font-style: italic; }
