:root {
  --coal: #22303f;
  --ink: #2a2320;
  --parchment: #f2e3c1;
  --brass: #c89b4e;
  --amber: #ffb84d;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1a1512;
  color: var(--ink);
  font-family: system-ui, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body {
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  overscroll-behavior: none;
}

#game {
  display: block;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: default;
  outline: none;
}

#boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 184, 77, 0.16), transparent 58%),
    radial-gradient(circle at 50% 120%, #2e4055 0%, #1a1512 62%);
  z-index: 10;
  transition: opacity 520ms ease, visibility 520ms ease;
}

#boot.hidden {
  opacity: 0;
  visibility: hidden;
}

.boot-card {
  text-align: center;
  color: var(--parchment);
}

.boot-gear {
  font-size: 40px;
  color: var(--brass);
  animation: spin 4s linear infinite;
  line-height: 1;
}

#boot h1 {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.18em;
  font-size: clamp(28px, 5vw, 52px);
  margin: 14px 0 6px;
  color: #e8c877;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
}

#boot p {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #e3cfa3;
  opacity: 0.75;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--parchment);
  background: #1a1512;
  z-index: 20;
}

/* Local-account dialog: parchment card over a brass-veiled backdrop. */
.account-dialog {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 184, 77, 0.08), transparent 62%),
    rgba(16, 12, 9, 0.72);
  backdrop-filter: blur(2px);
}

.account-dialog[hidden] { display: none; }

.account-card {
  width: min(380px, 100%);
  padding: 22px 24px 20px;
  border-radius: 8px;
  border: 1px solid #8c6b38;
  background:
    linear-gradient(160deg, #f7ebcd 0%, #ecdcb8 58%, #e0cda3 100%);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  color: var(--ink);
}

.account-eyebrow {
  margin: 0 0 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: rgba(42, 35, 32, 0.5);
}

.account-card h2 {
  margin: 0 0 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  letter-spacing: 0.14em;
  color: #43301a;
}

.account-field {
  display: block;
  margin-bottom: 12px;
}

.account-field span {
  display: block;
  margin-bottom: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(42, 35, 32, 0.6);
}

.account-field input {
  width: 100%;
  padding: 9px 11px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: #fbf4e2;
  border: 1px solid #b99a63;
  border-radius: 4px;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}

.account-field input:focus {
  border-color: #7a5a2e;
  box-shadow: 0 0 0 2px rgba(200, 155, 78, 0.32);
}

.account-error {
  min-height: 16px;
  margin: 2px 0 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: #9d2f22;
}

.account-actions {
  display: flex;
  gap: 10px;
}

.account-actions button {
  flex: 1;
  padding: 10px 12px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid #7a5a2e;
}

.account-primary {
  background: linear-gradient(#e5bd6b, #c89b4e);
  color: #2b1f10;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.account-secondary {
  background: rgba(42, 35, 32, 0.06);
  color: #43301a;
}

.account-actions button:disabled { opacity: 0.6; cursor: default; }

.account-hint {
  margin: 12px 0 0;
  font-size: 10.5px;
  line-height: 1.45;
  color: rgba(42, 35, 32, 0.55);
}
