@charset "UTF-8";

:root {
  color-scheme: dark;
  --bg: #0d1017;
  --surface: #141821;
  --raised: #1b202c;
  --line: #ffffff16;
  --text: #f4f1eb;
  --muted: #a3a8b5;
  --orange: #ffae63;
  --purple: #b9a0fb;
  --green: #92d1a2;
  --red: #ff9d9d;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6; }
h1, h2, p { margin: 0; }
h1 { font-size: 28px; letter-spacing: -.035em; line-height: 1.3; }
h2 { margin-bottom: 7px; font-size: 17px; line-height: 1.4; }
a { color: var(--orange); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 600; }
input, select, textarea {
  min-width: 0;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ffffff26;
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
select {
  appearance: none;
  -webkit-appearance: none;
  height: 44px;
  padding: 0 40px 0 12px;
  line-height: normal;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23a3a8b5' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
  cursor: pointer;
}
select:disabled { cursor: not-allowed; }
input::placeholder, textarea::placeholder { color: #737b8c; }
input:disabled, select:disabled, textarea:disabled { opacity: .6; }
button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, a:focus-visible, .action-dialog:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}

/* Shared frame and compact identity. */
.page-shell { max-width: 1184px; margin: 0 auto; padding: 0 32px; }
.page-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; }
.brand-mark { display: block; width: 36px; height: 36px; flex: none; object-fit: contain; border-radius: 8px; }
.brand strong { display: block; font-size: 15px; line-height: 1.45; }
.brand-caption { display: block; color: var(--muted); font-size: 11px; letter-spacing: .06em; }
.account { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 13px; }
.account .button { min-height: 36px; padding: 6px 12px; font-size: 12px; }
.muted, .field-note { color: var(--muted); }
.field-note { margin-top: 7px; font-size: 12px; line-height: 1.6; }
.section-label { font-size: 12px; font-weight: 600; letter-spacing: .1em; color: var(--purple); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.loading-text { padding: 48px 0; color: var(--muted); }
.page-footer { display: flex; justify-content: center; gap: 9px; padding: 28px 0; color: #828b9b; font-size: 11px; }

/* Authentication is intentionally a single, focused card. */
.login-panel { max-width: 460px; margin: 64px auto 80px; padding: 30px; }
.login-panel h1 { margin: 10px 0; font-size: 25px; }
.login-panel form { margin-top: 23px; }
.login-panel .button { width: 100%; margin-top: 20px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .15s ease;
}
.button-primary { background: var(--orange); color: #211508; }
.button-primary:hover:not(:disabled) { background: #ffbc7e; }
.button-subtle { color: var(--text); background: var(--raised); border-color: #ffffff1c; }
.button-subtle:hover:not(:disabled) { background: #262d3c; }
.button-danger { color: var(--red); background: #ff9d9d14; border-color: #ff9d9d30; }
.button-danger:hover:not(:disabled) { background: #ff9d9d24; }
.button-small { min-height: 34px; padding: 5px 11px; font-size: 12px; }

/* Snapshot summary. The status describes the last read, not a live connection. */
.dashboard-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 27px 0 18px; }
.dashboard-heading .muted { margin-top: 5px; font-size: 13px; }
.dashboard-heading .button { flex: none; }
.dashboard-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.connection { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.connection-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: currentColor; }
.connection[data-state="connected"] { color: var(--green); }
.connection[data-state="disconnected"] { color: var(--red); }
.connection[data-state="loading"] { color: var(--orange); }
.update-summary { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; color: var(--muted); font-size: 11px; }
.snapshot-label { padding: 1px 7px; border: 1px solid var(--line); border-radius: 5px; color: #c2c7d1; background: #ffffff04; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.stat { display: flex; flex-direction: column; min-height: 141px; padding: 18px 21px; }
.stat-label { color: var(--muted); font-size: 12px; }
.stat strong { margin: 7px 0 6px; font-size: 28px; font-weight: 650; line-height: 1.25; letter-spacing: -.025em; }
.stat-note { color: var(--muted); font-size: 11px; }
.status-explanation { margin: 9px 1px 22px; color: #828b9b; font-size: 11px; }
.message { margin: 15px 0; padding: 12px 15px; border: 1px solid #ff9d9d35; border-radius: 8px; background: #ff9d9d0c; color: var(--red); overflow-wrap: anywhere; font-size: 13px; }
.message[data-type="success"] { color: var(--green); background: #92d1a20b; border-color: #92d1a22b; }
.message[data-type="info"] { color: var(--muted); background: var(--raised); border-color: var(--line); }
.dashboard-tabs { display: flex; gap: 6px; margin-bottom: 18px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.dashboard-tab { min-height: 40px; padding: 8px 17px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; }
.dashboard-tab:hover { color: var(--text); background: var(--raised); }
.dashboard-tab[aria-selected="true"] { color: var(--orange); background: #ffae6310; border-color: #ffae632b; }
.tab-panel:focus-visible { outline: 2px solid var(--orange); outline-offset: 5px; border-radius: 10px; }
.section-status { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: -4px 0 13px; }
.section-status .field-note { margin: 0; font-size: 11px; }

/* Players share the same avatar and name treatment in both lists. */
.list-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 21px 23px; }
.list-heading h2 { margin-bottom: 0; }
.online-panel { overflow: hidden; margin-bottom: 18px; }
.online-panel .list-heading { padding-bottom: 17px; }
.online-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.online-player { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; padding: 13px 23px; border-top: 1px solid var(--line); }
.online-player:nth-child(even) { border-left: 1px solid var(--line); }
.online-player strong { font-size: 14px; overflow-wrap: anywhere; }
.player-identity { display: flex; align-items: center; gap: 11px; min-width: 0; }
.player-identity > strong, .player-identity > span { min-width: 0; overflow-wrap: anywhere; }
.avatar-shell { position: relative; display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; overflow: hidden; border: 1px solid #ffffff16; border-radius: 7px; background: #262638; }
.avatar-fallback { color: var(--purple); font-size: 12px; font-weight: 650; text-transform: uppercase; }
.player-avatar { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; opacity: 0; }
.player-avatar.is-loaded { opacity: 1; }
.stat-note[data-stale="true"], #updated-at[data-stale="true"], #settings-status[data-stale="true"] { color: var(--orange); }
.empty-state { padding: 32px 23px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; font-size: 13px; }
.online-panel .empty-state { padding: 25px; }

/* World actions. */
.daily-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.control-card { min-width: 0; padding: 23px; }
.control-card > .muted { font-size: 13px; }
.daily-form { margin-top: 18px; }
.daily-form > .button { margin-top: 16px; }
.daily-form textarea { resize: vertical; min-height: 100px; max-height: 260px; }
.weather-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.save-card .field-note { margin-top: 16px; }
.save-card > .button { margin-top: 23px; }

/* Whitelist management. */
.add-panel { margin-bottom: 18px; padding: 23px; }
.add-panel .muted { font-size: 13px; }
.add-form { display: flex; align-items: flex-start; gap: 14px; margin-top: 18px; }
.input-group { flex: 1; max-width: 510px; }
.add-form > .button { min-height: 42px; margin-top: 28px; }
.list-panel { overflow: hidden; }
.search-group { flex-shrink: 0; width: 270px; max-width: 100%; }
.search-group label { color: var(--muted); font-size: 11px; font-weight: 400; }
.search-group input { padding: 8px 11px; font-size: 13px; }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { background: #ffffff03; color: var(--muted); font-size: 11px; font-weight: 500; }
th, td { padding: 13px 23px; border-top: 1px solid var(--line); }
th:first-child { width: 75%; }
th.action-heading, td.actions { text-align: right; white-space: nowrap; }
td.player-name { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.confirmation-actions { display: flex; gap: 8px; flex: none; }

/* Difficulty and confirmation controls. */
.settings-panel { padding: 23px; }
.settings-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.settings-heading .muted { font-size: 13px; }
.settings-heading > .button { flex: none; }
.setting-form { min-width: 0; margin-top: 14px; padding: 22px 0 0; border-top: 1px solid var(--line); }
.setting-label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.setting-label label { margin: 0; }
.current-value { color: var(--muted); font-size: 12px; white-space: nowrap; }
.setting-form > .field-note { margin: 9px 0 14px; }
.setting-control { display: flex; align-items: center; gap: 10px; }
.setting-control > select { min-width: 0; flex: 1; }
.setting-control > .button { min-height: 44px; padding-inline: 12px; }
.action-dialog { width: calc(100% - 36px); max-width: 460px; padding: 26px; border: 1px solid #ffffff30; border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: 0 24px 80px #0009; }
.action-dialog::backdrop { background: #05070bc9; backdrop-filter: blur(4px); }
.action-dialog h2 { margin-bottom: 12px; }
.action-dialog .muted { font-size: 14px; overflow-wrap: anywhere; }
.action-dialog .confirmation-actions { justify-content: flex-end; flex-wrap: wrap; margin-top: 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 16px; top: 10px; z-index: 5; transform: translateY(-150%); padding: 8px 14px; background: var(--raised); }
.skip-link:focus { transform: none; }

@media (max-width: 680px) {
  .page-shell { padding: 0 18px; }
  .page-header { min-height: 68px; }
  .brand strong { font-size: 14px; }
  .brand-mark { width: 32px; height: 32px; }
  .account { gap: 8px; }
  .account > span { display: none; }
  .account .button { min-height: 35px; padding: 6px 10px; }
  .dashboard-heading { gap: 12px; padding: 23px 0 17px; }
  .dashboard-heading h1 { font-size: 24px; }
  .dashboard-heading .muted { font-size: 12px; }
  .dashboard-heading .button { padding: 7px 10px; font-size: 12px; }
  .dashboard-toolbar { align-items: flex-start; flex-direction: column; gap: 7px; }
  .update-summary { justify-content: flex-start; }
  .stats-grid { grid-template-columns: 1fr; gap: 8px; }
  .stat { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 16px; min-height: 76px; padding: 14px 16px; }
  .stat-label { grid-column: 1; grid-row: 1; font-size: 12px; }
  .stat strong { grid-column: 2; grid-row: 1 / 3; align-self: center; margin: 0; font-size: 25px; text-align: right; }
  .stat-note { grid-column: 1; grid-row: 2; font-size: 12px; overflow-wrap: anywhere; }
  #world-time-note { display: none; }
  .status-explanation { margin-bottom: 18px; font-size: 11px; }
  .dashboard-tabs { gap: 5px; }
  .dashboard-tab { flex: 1; padding: 8px 10px; font-size: 12px; }
  .section-status { align-items: flex-start; flex-direction: column; gap: 3px; }
  .daily-grid { grid-template-columns: 1fr; gap: 16px; }
  .control-card, .add-panel, .settings-panel { padding: 20px; }
  .list-heading { align-items: stretch; flex-direction: column; gap: 16px; padding: 20px; }
  .online-list { grid-template-columns: 1fr; }
  .online-player { padding: 12px 20px; }
  .online-player:nth-child(even) { border-left: 0; }
  .online-panel .list-heading { flex-direction: row; align-items: center; gap: 12px; }
  .online-panel .list-heading > .button { flex: none; padding: 7px 10px; font-size: 11px; }
  .daily-form > .button, .save-card > .button { width: 100%; }
  .add-form { display: block; }
  .add-form > .button { width: 100%; margin-top: 12px; }
  .input-group { max-width: none; }
  .search-group { width: 100%; }
  th, td { padding: 12px 17px; }
  .settings-heading { align-items: center; gap: 15px; }
  .settings-heading > .button { padding: 7px 10px; font-size: 12px; }
  .setting-form { padding-top: 20px; }
  .setting-label { flex-wrap: wrap; gap: 5px 12px; }
  .setting-control > .button { font-size: 12px; }
  .login-panel { margin: 42px auto 64px; padding: 25px 22px; }
  .login-panel h1 { font-size: 23px; }
  .action-dialog { padding: 22px; }
  .action-dialog .confirmation-actions > .button { flex: 1; }
  .page-footer { flex-wrap: wrap; gap: 5px 8px; font-size: 10px; }
}

@media (max-width: 380px) {
  .page-shell { padding: 0 13px; }
  .dashboard-heading { align-items: flex-start; flex-direction: column; }
  .online-panel .list-heading { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

@media (forced-colors: active) {
  select { appearance: auto; -webkit-appearance: auto; padding-inline-end: 12px; background-image: none; }
}
