:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  color: #fff5dc;
  background: #151f19;
  --muted: #d3d3bd;
  --gold: #f2cc88;
  --border: #5c624e;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at top, #344731 0%, transparent 65%), #151f19;
}

.topbar {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  padding: 1rem clamp(1rem, 5vw, 4rem);
  min-height: 4.5rem;
  border-bottom: 1px solid var(--border);
}

.brand { letter-spacing: .05em; }
.brand span { color: var(--gold); margin-right: .35rem; }
main { max-width: 65rem; margin: auto; padding: 1.5rem 1rem 4rem; }
p, small { color: var(--muted); }
p { line-height: 1.55; }
h1, h2, h3 { margin: 0; }
h1, h2 { font-family: Georgia, serif; font-weight: normal; }
h1 { font-size: clamp(2.25rem, 7vw, 4rem); line-height: 1.06; }
h2 { font-size: 1.65rem; }
h3 { font-size: 1.05rem; }

.intro { margin: 1.5rem 0 2rem; text-align: center; overflow-wrap: anywhere; }
.eyebrow {
  color: var(--gold);
  font-size: .8rem;
  font-weight: 650;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.panel {
  padding: clamp(1.15rem, 4vw, 2rem);
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: #1e2a21;
  min-width: 0;
}

.login { max-width: 30rem; margin: clamp(1rem, 7vh, 5rem) auto; }
.login h1 { font-size: clamp(2.15rem, 7vw, 3rem); }
.login .eyebrow { margin-top: 0; }
form:not([method="dialog"]) { display: grid; gap: .85rem; }
label { display: grid; gap: .3rem; font-weight: 600; }
input, select, button, .button { font: inherit; }
input, select {
  min-width: 0;
  width: 100%;
  padding: .6rem;
  border: 1px solid var(--border);
  border-radius: .4rem;
  background: #151f19;
  color: inherit;
}

button, .button {
  display: inline-block;
  padding: .65rem .9rem;
  border: 1px solid transparent;
  border-radius: .45rem;
  background: var(--gold);
  color: #262115;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

button:disabled { cursor: default; }
button:hover:not(:disabled), .button:hover { filter: brightness(1.15); }
:focus-visible { outline: 2px solid #fff2c6; outline-offset: 3px; }
.subtle { background: transparent; border-color: var(--border); color: inherit; }
#status { margin: 0 0 1rem; text-align: center; }
#status:empty { display: none; }
#status.error { color: #ffb7a9; }

.doors {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(.4rem, 1.6vw, 1rem);
  padding: 0;
  margin: 0;
}

.doors button {
  display: grid;
  place-content: center;
  gap: .4rem;
  width: 100%;
  min-height: clamp(6rem, 11vw, 9rem);
  padding: .35rem;
  color: #fff1d0;
  background: #793d35;
  border-color: #c8856e;
  box-shadow: inset 0 0 0 3px #0002;
}

.doors button:disabled { background: #263528; color: var(--muted); border-color: var(--border); }
.door-number { font: clamp(1.6rem, 5vw, 3rem)/1 Georgia, serif; }
.door-state { font-size: .73rem; overflow-wrap: anywhere; }

.admin-layout { display: grid; grid-template-columns: 1.35fr 1fr; gap: 1rem; align-items: start; }
.account-layout { display: grid; gap: 1rem; }
.panel h2 { margin-bottom: 1rem; }
.manage-days {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .4rem;
  margin: 1rem 0 1.5rem;
}
.manage-days button { padding: .55rem 0; background: #28382c; color: inherit; border-color: var(--border); }
.manage-days .filled { background: #425a3b; border-color: #b2c58f; }
.manage-days [aria-pressed="true"] { outline: 2px solid var(--gold); }
#preview, #upload-form { margin-top: 1rem; }

dialog {
  max-width: min(92vw, 54rem);
  max-height: 92vh;
  width: max-content;
  min-width: min(92vw, 22rem);
  padding: 1rem;
  background: #1e2a21;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: .8rem;
}
dialog::backdrop { background: #090f0bd9; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
#dialog-image { max-width: 100%; max-height: 67vh; width: auto; height: auto; display: block; margin: 1rem auto; }
#dialog-message:empty { display: none; }

@media (max-width: 42rem) {
  .doors { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .admin-layout { grid-template-columns: 1fr; }
}
@media (max-width: 24rem) {
  .doors { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
