:root {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #182824;
  background: #f4f7f6;
  font-synthesis: none;
  --ink: #182824;
  --muted: #556660;
  --line: #d4dfd9;
  --green: #20604b;
  --paper: #fff;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-size: 15px; line-height: 1.55; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 3px solid #45896d; outline-offset: 3px; }
.centered { min-height: 100vh; min-height: 100svh; display: grid; align-content: center; justify-items: center; padding: 20px; }
.login-panel, .player-panel, .surface, dialog {
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
}
.login-panel, .player-panel { width: min(100%, 370px); padding: 30px; }
.login-panel, #redeem-form, #action-form { display: grid; gap: 18px; }
#register-form, #reset-password-result { display: grid; gap: 16px; }
.login-actions { display: grid; gap: 10px; }
label { display: grid; gap: 6px; font-size: 14px; font-weight: 550; }
input, select, textarea {
  background: white; border: 1px solid #abbdb3; border-radius: 6px; color: var(--ink);
  padding: 10px 12px; min-height: 42px; width: 100%; font-size: 16px; font-weight: 400;
}
input::placeholder { color: #75827a; }
textarea { resize: vertical; }
.primary, .quiet, .link, .navigation button { border-radius: 6px; font-weight: 550; }
.primary, .quiet { min-height: 42px; padding: 9px 17px; border: 1px solid transparent; }
.primary { background: var(--green); color: white; }
.primary:hover { background: #164d3b; }
.quiet { color: var(--ink); background: white; border-color: var(--line); }
.quiet:hover { background: #eff4f1; }
.link { border: 0; padding: 5px 3px; color: var(--green); background: transparent; white-space: nowrap; }
.link:hover { text-decoration: underline; }
.login-panel .primary { margin-top: 4px; }
.workspace { max-width: 1040px; margin: 0 auto; padding: 36px 28px 56px; }
.mast, .list-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
h1, h2, p, dl, dd { margin: 0; }
h1 { font-size: 25px; line-height: 1.28; }
h2 { font-size: 18px; line-height: 1.45; }
.navigation { display: flex; gap: 24px; margin: 22px 0; border-bottom: 1px solid var(--line); }
.navigation button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; padding: 9px 0; color: var(--muted); background: none; }
.navigation button[aria-current] { color: var(--green); border-bottom-color: var(--green); }
.surface { padding: 20px 22px; }
.fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)) auto; align-items: end; gap: 14px; margin-top: 14px; }
#delivery { display: grid; justify-items: start; gap: 10px; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
#delivery label { width: 100%; }
.list { margin-top: 26px; }
.list-head { margin-bottom: 12px; }
table { width: 100%; border-collapse: collapse; background: white; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 11px 12px; overflow-wrap: anywhere; }
th { background: #e9efeb; font-size: 13px; color: var(--muted); font-weight: 550; }
td { font-size: 14px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.account-link { text-decoration: underline; text-underline-offset: 3px; white-space: normal; overflow-wrap: anywhere; }
#card-filters { display: grid; grid-template-columns: auto minmax(160px, 1fr) minmax(130px, .55fr); align-items: end; gap: 14px; margin-bottom: 14px; }
.status-filters { display: flex; gap: 4px; padding: 3px; background: #e7eeea; border-radius: 8px; }
.status-filters .quiet { padding-inline: 12px; background: transparent; border-color: transparent; }
.status-filters .quiet:hover { background: #f4f7f5; }
.status-filters .quiet[aria-pressed="true"] { background: white; color: var(--green); border-color: var(--line); }
.card-used { color: var(--green); font-weight: 550; }
.card-unused { color: var(--muted); }
.mono, time { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
.empty { text-align: center; padding: 24px; color: var(--muted); background: white; }
.message { color: var(--green); overflow-wrap: anywhere; font-size: 14px; }
.message.error { color: #9b3435; }
.message:empty { display: none; }
#admin-message:not(:empty) { margin-bottom: 14px; }
#player-message:not(:empty) { margin-top: 14px; }
.player-panel dl { margin: 18px 0 24px; }
.player-panel dl div { display: flex; gap: 14px; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); }
dt { color: var(--muted); }
dialog { width: min(430px, calc(100% - 32px)); max-height: calc(100% - 32px); color: var(--ink); padding: clamp(18px, 4vw, 26px); overflow-wrap: anywhere; }
dialog::backdrop { background: rgb(21 38 31 / 35%); }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 10px; }
#action-dialog > h2, #profile-dialog > h2 { margin-bottom: 16px; }
.field-hint { color: var(--muted); font-size: 13px; font-weight: 400; }
.password-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; align-items: end; }
.password-field .field-hint { grid-column: 1 / -1; }
.password-field .quiet { min-height: 46px; padding-inline: 12px; }
.password-field .quiet[aria-pressed="true"] { background: #e9efeb; border-color: #abbdb3; }
#profile-dialog { width: min(540px, calc(100% - 32px)); }
#profile-dialog .dialog-actions { margin-top: 18px; }
.profile-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; padding: 16px; background: #f4f7f5; border-radius: 8px; }
.profile-facts dt { font-size: 13px; }
.profile-facts dd { margin-top: 3px; }
#profile-dialog h3 { margin: 20px 0 8px; font-size: 15px; }
@media (max-width: 660px) {
  .workspace { padding: 20px 16px 40px; }
  .fields { grid-template-columns: 1fr; }
  .surface { padding: 16px; }
  #card-filters { grid-template-columns: minmax(0, 1fr) auto; }
  .status-filters { grid-column: 1 / -1; width: fit-content; }
  table, tbody, tr, td { display: block; }
  table { background: transparent; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  tbody { display: grid; gap: 10px; }
  tbody tr { padding: 8px 14px; border: 1px solid var(--line); background: white; border-radius: 8px; }
  td { display: grid; grid-template-columns: 5em minmax(0,1fr); gap: 8px; align-items: baseline; padding: 6px 0; border: 0; }
  td::before { content: attr(data-label); color: var(--muted); font-size: 13px; }
}
@media (max-width: 380px) {
  .login-panel, .player-panel { padding: 22px; }
  #card-filters { grid-template-columns: 1fr; }
}

#copy-dialog label { margin: 16px 0; }

#login-page {
  min-height: 100vh;
  min-height: 100svh;
  padding: 28px 20px;
  background:
    radial-gradient(ellipse at 10% 95%, #dce7cf 0, transparent 42%),
    radial-gradient(ellipse at 100% 0, #e7ebd6 0, transparent 35%),
    #f6f6ee;
}
#login-page .login-panel {
  width: min(100%, 410px);
  gap: 19px;
  padding: clamp(27px, 5vw, 44px);
  border-color: #dde3d6;
  border-radius: 24px;
  background: #fffefa;
  box-shadow: 0 18px 55px rgb(34 54 39 / 9%);
}
.login-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.seed-mark {
  position: relative;
  flex: 0 0 36px;
  height: 36px;
  border-radius: 12px;
  background: #e3ecd9;
}
.seed-mark::before, .seed-mark::after {
  content: '';
  position: absolute;
  background: #355b42;
}
.seed-mark::before {
  width: 9px;
  height: 15px;
  border-radius: 9px 0 8px 0;
  top: 9px;
  left: 16px;
  transform: rotate(19deg);
}
.seed-mark::after {
  width: 7px;
  height: 10px;
  border-radius: 0 7px 0 7px;
  top: 14px;
  left: 10px;
}
#login-title { font-size: 29px; letter-spacing: .04em; color: #203a29; }
#login-page input {
  min-height: 47px;
  border-color: #c3d0c3;
  border-radius: 9px;
  background: #fffefa;
}
#login-page .primary { min-height: 46px; border-radius: 9px; margin: 0; background: #244c36; }
#login-page .primary:hover { background: #183a29; }
#login-page .login-actions .quiet { border-color: transparent; background: transparent; color: #325740; }
#login-page .login-actions .quiet:hover { text-decoration: underline; }
button[aria-busy="true"] { opacity: .8; }

.player-workspace { max-width: 820px; }
.player-mast { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.dashboard-title { display: grid; gap: 8px; margin: 26px 0 16px; }
.dashboard-title h1 { font-size: clamp(26px, 4vw, 34px); }
.membership { color: var(--muted); font-variant-numeric: tabular-nums; }
#dashboard-message:not(:empty) { margin: 0 0 14px; }
.farm-sections { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.farm-section { border-top: 3px solid #749065; }
.farm-section:nth-child(2) { border-top-color: #ac9365; }
.farm-section dl { display: flex; justify-content: space-between; gap: 8px; margin-top: 14px; }
.game-connection { margin-top: 14px; font-size: 14px; color: var(--muted); }
.activation-panel { width: min(100%, 510px); margin: 26px auto; padding: clamp(20px, 4vw, 34px); }
.activation-panel .field-hint { margin: 8px 0 20px; }
#player-global-message:not(:empty) { margin-top: 14px; }

#player-title:focus, #activation-title:focus { outline: none; }

.assistant-entry { display: inline-block; text-decoration: none; margin-top:20px; border-radius:8px; }


.announcement-editor { display: grid; gap: 16px; }
.announcement-editor .list-head { margin-bottom: 0; flex-wrap: wrap; }
.announcement-editor textarea { line-height: 1.7; }
#announcement-count { float: right; font-variant-numeric: tabular-nums; }
.announcement-small-entry { padding: 7px 12px; }
#announcement-dialog, #announcement-preview-dialog { width: min(560px, calc(100% - 32px)); }
.announcement-text { margin-top: 16px; max-height: 55dvh; overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; }

#login-page .login-panel { width: min(100%, 460px); gap: 16px; }
.login-benefits { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 12px; color: #476352; font-size: 12px; }
.login-benefits span { display:flex; align-items:center; gap:6px; }
.login-benefits b { color:#366b49; font-size:16px; width:17px; text-align:center; }
.login-functions { display:grid; gap:7px; padding:12px 14px; border-radius:10px; background:#f0f5ea; color:#35583d; font-size:13px; }
.login-functions span { display:flex; align-items:center; gap:8px; }
.login-functions i { width:19px; font-style:normal; font-size:15px; }
.login-setup-note { font-size:12px; line-height:1.75; color:#607163; }
.login-setup-note strong { display:block; color:#31533e; font-size:13px; margin-bottom:3px; }
.run-badge { display:inline-flex; border-radius:5px; padding:3px 7px; font-size:12px; white-space:nowrap; background:#f0f2f1; color:#65736c; }
.run-badge.running { background:#e5f3e9; color:#21623d; font-weight:600; }
.run-badge.waiting { background:#fff1d7; color:#8a641e; }
#redeem-form { display:grid; gap:12px; }
#invitation-dialog { width:min(520px,calc(100% - 32px)); }
#invitation-dialog>label { margin:16px 0 10px; }
#invitation-code { font-size:22px; letter-spacing:4px; color:var(--green); }
#invitation-message,#invitation-summary { margin-top:10px; }
#invitation-dialog h3 { margin:18px 0 8px; font-size:15px; }

@media(max-width:660px) { .navigation { gap:18px; overflow-x:auto; white-space:nowrap; } .list-head { flex-wrap:wrap; } #accounts-summary { order:3; width:100%; } }

.records-table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 7px; }
.records-table { min-width: 450px; table-layout: fixed; }
.records-table.wide-records { min-width: 860px; }
.records-table th, .records-table td { vertical-align: top; padding: 10px; }
.records-table tr:last-child td { border-bottom: 0; }
.records-table .empty { text-align: center; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 12px; color: var(--muted); font-size: 13px; }
.pagination-size { display: flex; align-items: center; gap: 7px; margin-right: auto; font-size: 13px; white-space: nowrap; }
.pagination select { min-height: 36px; width: auto; padding: 5px 25px 5px 8px; font-size: 13px; }
.pagination .quiet { min-height: 36px; padding: 5px 10px; font-size: 13px; }
.pagination button:disabled { cursor: default; }
.pagination-summary { font-variant-numeric: tabular-nums; white-space: nowrap; }
#invitation-dialog { width: min(650px, calc(100% - 32px)); }
#invitation-dialog h3 { margin: 18px 0 8px; font-size: 15px; }
#profile-invitation-summary { margin-bottom: 10px; }
@media (max-width: 660px) {
  .records-table { display: table; background: white; }
  .records-table thead { display: table-header-group; position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
  .records-table tbody { display: table-row-group; }
  .records-table tr { display: table-row; padding: 0; border: 0; border-radius: 0; }
  .records-table td { display: table-cell; border-bottom: 1px solid var(--line); }
  .records-table td::before { content: none; }
  .pagination { gap: 7px; }
  .pagination-size { flex-basis: 100%; }
}
