/* Wayward sign-in gate and server notices.
 * Version: 01.05.00
 * Fonts come from fonts.css (generated by build.py); the palette is the Thoth theme.
 */

:root {
  --ww-bg: #f1e9d6; --ww-card: #f9f4e8; --ww-inset: #fffcf3; --ww-line: #cfbf9f; --ww-line2: #e3d6ba;
  --ww-ink: #2a2219; --ww-muted: #6b5d4c; --ww-onink: #f3ecdc; --ww-accent: #a1402e; --ww-gold: #b8913f;
}

/* The raw game template must never flash before the runtime renders it. */
x-dc { display: none !important; }

#ww-gate {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: var(--ww-bg);
  background-image: radial-gradient(circle at 50% 30%, #f8f1df 0, transparent 60%);
  font-family: 'EB Garamond', Georgia, serif; color: var(--ww-ink);
}
#ww-gate[hidden] { display: none; }
.ww-card [hidden] { display: none !important; }

.ww-card {
  width: 100%; max-width: 400px; padding: 36px 32px 28px; background: var(--ww-card);
  border: 1px solid var(--ww-line); box-shadow: inset 0 0 0 4px var(--ww-card), inset 0 0 0 5px var(--ww-line2);
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%, 0 12px);
  display: flex; flex-direction: column; gap: 14px; text-align: center;
}
.ww-mark { width: 44px; height: 44px; margin: 0 auto; fill: var(--ww-gold); }
.ww-card h1 {
  margin: 0; font-family: 'Cormorant SC', Georgia, serif; font-weight: 600;
  font-size: 46px; line-height: 1; letter-spacing: 0.04em;
}
.ww-tag { margin: -6px 0 6px; font-style: italic; font-size: 17px; color: var(--ww-muted); }

.ww-tabs { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--ww-ink); }
.ww-tabs button {
  min-height: 42px; border: 0; background: transparent; color: var(--ww-ink); cursor: pointer;
  font: 600 17px 'Cormorant SC', Georgia, serif; letter-spacing: 0.06em;
}
.ww-tabs button[aria-pressed="true"] { background: var(--ww-ink); color: var(--ww-onink); }

.ww-card form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.ww-card label { display: flex; flex-direction: column; gap: 4px; font: 600 15px 'Cormorant SC', Georgia, serif; letter-spacing: 0.08em; }
.ww-card input {
  font: 17px 'EB Garamond', Georgia, serif; padding: 10px 12px; color: var(--ww-ink);
  background: var(--ww-inset); border: 1px solid var(--ww-line); border-radius: 2px; outline: none;
}
.ww-card input:focus { border-color: var(--ww-gold); box-shadow: 0 0 0 2px rgba(184, 145, 63, 0.25); }
.ww-err { min-height: 1.2em; margin: 0; color: var(--ww-accent); font-style: italic; font-size: 15px; }
.ww-card button[type="submit"] {
  min-height: 50px; border: 0; cursor: pointer; background: var(--ww-ink); color: var(--ww-onink);
  font: 22px 'Cormorant SC', Georgia, serif; letter-spacing: 0.14em; border-radius: 2px;
}
.ww-card button[type="submit"]:hover { background: var(--ww-accent); }
.ww-card button[type="submit"]:disabled { opacity: 0.6; cursor: wait; }
.ww-foot { margin: 4px 0 0; font-size: 14px; font-style: italic; color: var(--ww-muted); }

#ww-notice {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 60;
  width: min(560px, calc(100% - 32px)); padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: var(--ww-ink); color: var(--ww-onink); font: 16px 'EB Garamond', Georgia, serif;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25); border-radius: 2px;
}
#ww-notice[hidden] { display: none; }
.ww-notice-text { flex: 1 1 100%; }
#ww-notice button {
  min-height: 38px; padding: 6px 12px; cursor: pointer; background: transparent; color: var(--ww-onink);
  border: 1px solid var(--ww-onink); font: 600 15px 'Cormorant SC', Georgia, serif; border-radius: 2px;
}
#ww-notice button:hover { background: var(--ww-onink); color: var(--ww-ink); }

/* An arena challenge from another god: shown on every page until answered. */
#ww-duel {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 65;
  width: min(560px, calc(100% - 32px)); padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: var(--ww-card); color: var(--ww-ink); border: 1px solid var(--ww-accent); border-left-width: 5px;
  font: 16px 'EB Garamond', Georgia, serif; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25); border-radius: 2px;
}
#ww-duel[hidden] { display: none; }
.ww-duel-text { flex: 1 1 100%; }
#ww-duel button {
  min-height: 40px; padding: 6px 16px; cursor: pointer; background: var(--ww-ink); color: var(--ww-onink);
  border: 1px solid var(--ww-ink); font: 600 16px 'Cormorant SC', Georgia, serif; border-radius: 2px;
}
#ww-duel button + button { background: transparent; color: var(--ww-ink); }
#ww-duel button:hover { background: var(--ww-accent); border-color: var(--ww-accent); color: var(--ww-onink); }
#ww-duel button:disabled { opacity: 0.5; cursor: default; }

/* ---------- gate extras ---------- */
.ww-msg { margin: 0; font-style: italic; color: var(--ww-muted); font-size: 15px; }
.ww-msg:empty { display: none; }
.ww-link {
  align-self: center; background: none; border: 0; padding: 4px; cursor: pointer;
  color: var(--ww-muted); font: italic 15px 'EB Garamond', Georgia, serif; text-decoration: underline;
}
.ww-link:hover { color: var(--ww-accent); }

#ww-flash {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 70;
  width: min(520px, calc(100% - 32px)); padding: 12px 16px; text-align: center;
  background: var(--ww-ink); color: var(--ww-onink); font: 16px 'EB Garamond', Georgia, serif;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25); border-radius: 2px;
}
#ww-flash[hidden] { display: none; }

#ww-admin-pill {
  position: fixed; right: 16px; bottom: 16px; z-index: 40; padding: 8px 14px; min-height: 40px; cursor: pointer;
  background: var(--ww-gold); color: var(--ww-ink); border: 1px solid var(--ww-ink); border-radius: 20px;
  font: 600 15px 'Cormorant SC', Georgia, serif; letter-spacing: 0.08em; box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
}

/* ---------- account and admin panels ---------- */
.ww-modal {
  position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-start; justify-content: center;
  padding: 24px 16px; overflow-y: auto; background: rgba(42, 34, 25, 0.55);
  font-family: 'EB Garamond', Georgia, serif; color: var(--ww-ink);
}
.ww-sheet {
  width: 100%; max-width: 560px; background: var(--ww-card); border: 1px solid var(--ww-line);
  box-shadow: inset 0 0 0 4px var(--ww-card), inset 0 0 0 5px var(--ww-line2), 0 10px 40px rgba(0, 0, 0, 0.3);
}
.ww-sheet.ww-wide { max-width: 980px; }
.ww-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 6px; }
.ww-sheet-head h2 { margin: 0; font: 600 28px 'Cormorant SC', Georgia, serif; letter-spacing: 0.03em; }
.ww-x { width: 40px; height: 40px; border: 0; background: none; cursor: pointer; font-size: 28px; color: var(--ww-muted); }
.ww-x:hover { color: var(--ww-accent); }
.ww-sheet-body { padding: 4px 22px 22px; display: flex; flex-direction: column; gap: 4px; }
.ww-sec { padding: 14px 0; border-top: 1px solid var(--ww-line2); }
.ww-sec h3 { margin: 0 0 6px; font: 600 19px 'Cormorant SC', Georgia, serif; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.ww-sec p { margin: 0 0 6px; font-size: 16px; }
.ww-note { color: var(--ww-muted); font-style: italic; font-size: 15px; }
.ww-ok { color: #4f6b3a; }
.ww-bad { color: var(--ww-accent); }
.ww-form { display: flex; flex-direction: column; gap: 8px; }
.ww-form label { display: flex; flex-direction: column; gap: 3px; font: 600 14px 'Cormorant SC', Georgia, serif; letter-spacing: 0.08em; }
.ww-form input, .ww-search input {
  font: 16px 'EB Garamond', Georgia, serif; padding: 9px 11px; color: var(--ww-ink);
  background: var(--ww-inset); border: 1px solid var(--ww-line); border-radius: 2px; outline: none;
}
.ww-form input:focus, .ww-search input:focus { border-color: var(--ww-gold); }
.ww-form-msg { min-height: 0; margin: 2px 0 0; font-style: italic; font-size: 15px; }
.ww-form-msg:empty { display: none; }
.ww-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ww-btn {
  min-height: 42px; padding: 8px 14px; cursor: pointer; border-radius: 2px;
  background: var(--ww-ink); color: var(--ww-onink); border: 1px solid var(--ww-ink);
  font: 600 16px 'Cormorant SC', Georgia, serif; letter-spacing: 0.04em;
}
.ww-btn:hover { background: var(--ww-accent); border-color: var(--ww-accent); }
.ww-btn.ww-quiet { background: transparent; color: var(--ww-ink); }
.ww-btn.ww-quiet:hover { background: var(--ww-ink); color: var(--ww-onink); }
.ww-btn:disabled { opacity: 0.55; cursor: wait; }
.ww-danger h3, .ww-danger .ww-btn { color: var(--ww-accent); }
.ww-danger .ww-btn { background: transparent; border-color: var(--ww-accent); }
.ww-danger .ww-btn:hover { background: var(--ww-accent); color: var(--ww-onink); }
.ww-badge {
  font: 600 12px 'Cormorant SC', Georgia, serif; letter-spacing: 0.1em; padding: 2px 8px; border-radius: 10px;
  background: var(--ww-gold); color: var(--ww-ink);
}
.ww-badge-bad { background: var(--ww-accent); color: var(--ww-onink); }
.ww-badge-quiet { background: var(--ww-line2); }

.ww-tabs2 { display: flex; flex-wrap: wrap; gap: 0; border-bottom: 1px solid var(--ww-line); margin-bottom: 12px; }
.ww-tabs2 button {
  padding: 8px 16px; min-height: 40px; border: 0; background: none; cursor: pointer; color: var(--ww-muted);
  font: 600 17px 'Cormorant SC', Georgia, serif; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.ww-tabs2 button[aria-selected="true"] { color: var(--ww-ink); border-bottom-color: var(--ww-gold); }
.ww-search { display: flex; gap: 8px; margin-bottom: 8px; }
.ww-search input { flex: 1; min-width: 0; }
.ww-user { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--ww-line2); flex-wrap: wrap; }
.ww-user-main { flex: 1 1 280px; min-width: 0; }
.ww-user-name { font-size: 18px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.ww-user-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex: 1 1 260px; }
.ww-mini {
  min-height: 34px; padding: 4px 10px; cursor: pointer; border-radius: 2px; background: transparent;
  color: var(--ww-ink); border: 1px solid var(--ww-line); font: 14px 'EB Garamond', Georgia, serif;
}
.ww-mini:hover { border-color: var(--ww-ink); }
.ww-mini-danger { color: var(--ww-accent); }
.ww-mini-danger:hover { border-color: var(--ww-accent); }
.ww-mail { padding: 10px 0; border-top: 1px solid var(--ww-line2); }
.ww-mail summary { cursor: pointer; font-size: 16px; }
.ww-mail pre { white-space: pre-wrap; word-break: break-word; font: 15px 'EB Garamond', Georgia, serif; background: var(--ww-inset); padding: 10px 12px; border: 1px solid var(--ww-line2); margin: 8px 0 0; }
.ww-mail a { color: var(--ww-accent); }

/* Is the divine name free? A ✓ or ✗ inside the field while signing up. */
.ww-field { position: relative; display: flex; }
.ww-field input { flex: 1; min-width: 0; padding-right: 38px; }
.ww-check {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none;
  font: 700 20px 'EB Garamond', Georgia, serif; line-height: 1;
}
.ww-check[data-state="ok"] { color: #4f6b3a; }
.ww-check[data-state="bad"] { color: var(--ww-accent); }
.ww-name-hint { font: italic 400 14px 'EB Garamond', Georgia, serif; letter-spacing: 0; color: var(--ww-accent); }
.ww-name-hint:empty { display: none; }

/* Show or hide the password while typing it. */
.ww-eye {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%); min-height: 34px; padding: 2px 10px;
  border: 0; background: none; cursor: pointer; color: var(--ww-muted); font: 600 14px 'Cormorant SC', Georgia, serif; letter-spacing: 0.06em;
}
.ww-eye:hover, .ww-eye:focus-visible { color: var(--ww-accent); }
.ww-field input[name="password"] { padding-right: 64px; }
.ww-pw-hint { font: italic 400 14px 'EB Garamond', Georgia, serif; letter-spacing: 0; color: var(--ww-muted); text-align: left; }
.ww-pw-hint:empty { display: none; }

/* Account panel: devices, history, tokens, the app. */
.ww-list { display: flex; flex-direction: column; }
.ww-item { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 8px 0; border-top: 1px solid var(--ww-line2); flex-wrap: wrap; }
.ww-item:first-child { border-top: 0; }
.ww-item-main { flex: 1 1 240px; min-width: 0; font-size: 16px; overflow-wrap: anywhere; }
.ww-form select { font: 16px 'EB Garamond', Georgia, serif; padding: 9px 11px; color: var(--ww-ink); background: var(--ww-inset); border: 1px solid var(--ww-line); border-radius: 2px; min-height: 42px; }
.ww-form label.ww-tick { flex-direction: row; align-items: flex-start; gap: 8px; font: 16px 'EB Garamond', Georgia, serif; letter-spacing: 0; }
.ww-form label.ww-tick input { margin-top: 5px; }
.ww-secret {
  display: block; font: 14px ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; background: var(--ww-inset);
  border: 1px solid var(--ww-gold); padding: 10px 12px; margin: 6px 0; overflow-wrap: anywhere; user-select: all; white-space: pre-wrap;
}
details.ww-more summary { cursor: pointer; font-size: 16px; color: var(--ww-muted); }
details.ww-more[open] summary { margin-bottom: 6px; }

/* Sign-up: the news opt-in, and the honeypot field only bots fill in */
#ww-gate .ww-news { display: flex; flex-direction: row; gap: 10px; align-items: flex-start; font: 15px/1.4 'EB Garamond', Georgia, serif; letter-spacing: 0; color: var(--ww-muted, #6b5d4c); cursor: pointer; }
#ww-gate .ww-news[hidden] { display: none; }
#ww-gate .ww-news input { width: auto; padding: 0; margin: 3px 0 0; flex: none; accent-color: var(--ww-ink); }
#ww-gate .ww-hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Admin: email templates, broadcasts, sign-up guard */
.ww-tpl { display: grid; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--ww-line, #d8cbb0); }
.ww-tpl-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; justify-content: space-between; }
.ww-tpl-group { margin: 18px 0 2px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--ww-muted, #6b5d4c); }
.ww-form textarea, .ww-sheet textarea { width: 100%; min-height: 220px; box-sizing: border-box; font: 15px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 8px; border: 1px solid var(--ww-line, #d8cbb0); background: #fffdf7; color: inherit; resize: vertical; }
.ww-vars { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.ww-var { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; padding: 2px 6px; border: 1px solid var(--ww-line, #d8cbb0); background: #f7f0df; cursor: pointer; color: inherit; }
.ww-check-row { display: flex; gap: 8px; align-items: center; }
.ww-check-row input { width: auto; margin: 0; }
.ww-preview { width: 100%; height: 460px; border: 1px solid var(--ww-line, #d8cbb0); background: #f1e9d6; }
.ww-progress { height: 6px; background: #eadfc6; margin: 6px 0; }
.ww-progress > span { display: block; height: 100%; background: var(--ww-accent, #a1402e); }
.ww-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 16px; }
.ww-stats { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 4px 0 12px; }
.ww-stats b { font-size: 22px; display: block; }
