:root {
  color-scheme: dark;
  font-family: "Inter", system-ui, sans-serif;
  color: #f3f5fb;
  background: #10141e;
  font-synthesis: none;
  --muted: #aab4c7;
  --stroke: #343e53;
  --accent: #d5e892;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: radial-gradient(ellipse at 10% 0%, #202a3d, transparent 62%), #10141e;
  min-height: 100svh;
}
a { color: inherit; }
button, input, select { font: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.shell {
  width: min(100% - 3rem, 76rem);
  min-height: 100svh;
  margin: auto;
  display: flex;
  flex-direction: column;
}
.site-header {
  min-height: 5.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--stroke);
}
.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  font-weight: 650;
  font-size: .95rem;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
  border-radius: .7rem;
  background: var(--accent);
  color: #1d2912;
  font-weight: 850;
}
.launcher, .admin { padding: clamp(2rem, 7vw, 5rem) 0 4rem; }
h1 { margin: 0; font-size: clamp(2.75rem, 7vw, 5.5rem); line-height: 1; letter-spacing: -.065em; }
.state { color: var(--muted); line-height: 1.5; margin: 1.25rem 0; }
.state:empty { margin: 0; }
.tile-grid {
  list-style: none;
  padding: 0;
  margin: 2.25rem 0 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
.tile-grid:empty { margin: 0; }
[data-color="blue"] { --hue: 224; }
[data-color="green"] { --hue: 137; }
[data-color="purple"] { --hue: 267; }
[data-color="orange"] { --hue: 25; }
[data-color="pink"] { --hue: 331; }
[data-color="teal"] { --hue: 175; }
.tile {
  display: flex;
  isolation: isolate;
  flex-direction: column;
  justify-content: space-between;
  gap: .75rem;
  aspect-ratio: 16 / 10;
  min-height: 8rem;
  height: 100%;
  padding: clamp(.85rem, 2vw, 1.4rem);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  border: 1px solid hsl(var(--hue) 44% 51%);
  border-radius: 1.25rem;
  background: linear-gradient(135deg, hsl(var(--hue) 49% 38%), hsl(var(--hue) 48% 19%));
  transition: transform .16s ease, box-shadow .16s ease;
}
.tile::before {
  position: absolute;
  content: "";
  z-index: -1;
  width: 80%;
  aspect-ratio: 1;
  top: -30%;
  right: -25%;
  border: 1px solid #ffffff2c;
  border-radius: 50%;
  box-shadow: 0 0 0 1.2rem #ffffff0b, 0 0 0 2.5rem #ffffff0a, 0 0 0 3.8rem #ffffff07;
}
.tile:hover, .tile:focus-visible { transform: translateY(-4px) scale(1.025); z-index: 1; box-shadow: 0 .8rem 1.8rem #0007; }
.tile-icon { font-size: clamp(1.5rem, 3vw, 2.5rem); line-height: 1; }
.tile-name { font-size: clamp(1rem, 2vw, 1.35rem); font-weight: 720; overflow-wrap: anywhere; }
.tile-arrow { position: absolute; top: .85rem; right: 1rem; color: #fff; }
footer {
  border-top: 1px solid var(--stroke);
  color: var(--muted);
  padding: 1.25rem 0;
  margin-top: auto;
  font-size: .8rem;
}
.back-link { font-size: .92rem; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.admin-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.admin h1 { font-size: clamp(2rem, 5vw, 4.5rem); }
button, .button {
  display: inline-block;
  text-decoration: none;
  background: var(--accent);
  color: #19220e;
  padding: .6rem 1rem;
  border: 1px solid transparent;
  border-radius: .7rem;
  font-weight: 650;
  cursor: pointer;
}
button:disabled { cursor: default; opacity: .55; }
.secondary { background: #1d2635; border-color: #46526a; color: #f3f5fb; }
.danger { background: #4b252c; color: #ffdee2; border-color: #895158; margin-right: auto; }
.table-wrap {
  overflow-x: auto;
  margin-top: 1.65rem;
  border: 1px solid var(--stroke);
  border-radius: .85rem;
  background: #1a2130;
}
table { border-collapse: collapse; width: 100%; text-align: left; }
th, td { padding: .8rem 1rem; border-bottom: 1px solid var(--stroke); }
th { color: var(--muted); font-size: .9rem; }
td { max-width: 22rem; overflow-wrap: anywhere; }
tr:last-child td { border-bottom: 0; }
.public-link { display: inline-block; margin-top: 1rem; }
.account-email, .field-hint { color: var(--muted); font-size: .875rem; }
.account-email:empty { display: none; }
.address { display: flex; align-items: center; gap: .35rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.tile-graphic { width: 100%; height: 100%; object-fit: contain; position: absolute; inset: 0; padding: .95rem .95rem 2.5rem; }
.with-graphic { justify-content: end; }
.with-graphic .tile-name, .with-graphic .tile-arrow { z-index: 1; }
dialog {
  color: inherit;
  background: #1a2130;
  border: 1px solid #46526a;
  border-radius: 1.15rem;
  width: min(36rem, 100% - 2rem);
  padding: clamp(1rem, 4vw, 2rem);
}
dialog::backdrop { background: #080a11bf; }
form, label { display: grid; gap: .5rem; }
form { gap: 1rem; }
form h2 { margin: 0 0 .25rem; font-size: 1.7rem; }
input, select {
  width: 100%;
  min-width: 0;
  color: inherit;
  background: #10141e;
  border: 1px solid #46526a;
  border-radius: .5rem;
  padding: .55rem .7rem;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.checkbox { display: flex; align-items: center; align-self: end; min-height: 2.5rem; }
.checkbox input { width: auto; accent-color: var(--accent); }
.form-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: .5rem; }
form .state { margin: 0; }
@media (max-width: 58rem) { .tile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 38rem) {
  .shell { width: calc(100% - 2rem); }
  .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
}
@media (prefers-reduced-motion: reduce) {
  .tile { transition: none; }
  .tile:hover, .tile:focus-visible { transform: none; }
}
.order-cell { white-space: nowrap; }
.move { min-width: 2.3rem; padding: .4rem; }
.move + .move { margin-left: .35rem; }
.tile-section { margin-top: 2.25rem; }
.tile-section h2 { margin: 0 0 .85rem; font-size: clamp(1.2rem, 3vw, 1.65rem); }
.tile-section .tile-grid { margin-top: 0; }
