:root {
  color-scheme: light;
  --ink: #18221f;
  --muted: #5e6b66;
  --line: #d6e0dc;
  --soft: #edf7f3;
  --panel: #ffffff;
  --green: #0e7c72;
  --green-strong: #075f58;
  --gold: #d49419;
  --red: #b42318;
  --blue: #2563eb;
  --sky: #bfe5f2;
  --floor: #f5d9a5;
  --shadow: 0 18px 48px rgba(18, 36, 32, 0.12);
  font-family: "Pacifico", cursive;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(191, 229, 242, 0.85), rgba(247, 250, 248, 0.96) 42%),
    repeating-linear-gradient(90deg, rgba(14, 124, 114, 0.08) 0 1px, transparent 1px 96px),
    #f7faf8;
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.admin-dot {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 20;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: transparent;
}

.admin-dot:focus-visible {
  outline: 2px solid var(--gold);
  background: var(--gold);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 18px clamp(18px, 4vw, 52px);
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand-lockup,
.meet-status,
.workspace-top,
.browser-head,
.dialog-actions,
.top-actions,
.row-actions,
.announcement-card,
.status-pill {
  display: flex;
  align-items: center;
}

.brand-lockup {
  gap: 12px;
}

.mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
}

.kicker {
  margin: 0 0 2px;
  color: var(--green-strong);
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.25rem, 2.4vw, 1.65rem);
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.5rem, 3vw, 2.4rem);
}

h3 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.meet-status {
  gap: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

main {
  padding: clamp(18px, 4vw, 48px);
}

.hero {
  position: relative;
  min-height: calc(100vh - 132px);
  display: grid;
  align-content: center;
  gap: 28px;
  overflow: hidden;
  padding: clamp(22px, 6vw, 72px);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(217, 244, 249, 0.95) 0%, rgba(241, 248, 245, 0.92) 48%, rgba(231, 236, 230, 0.96) 100%);
  box-shadow: var(--shadow);
}

.track-visual {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 1;
}

.arena-lights {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 16% 9%, rgba(255, 247, 205, 0.92) 0 2.5%, transparent 7%),
    radial-gradient(circle at 50% 7%, rgba(255, 247, 205, 0.78) 0 2%, transparent 6%),
    radial-gradient(circle at 84% 10%, rgba(255, 247, 205, 0.88) 0 2.5%, transparent 7%),
    linear-gradient(180deg, rgba(37, 99, 235, 0.12), transparent 34%);
}

.crowd {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 12%;
  height: 10%;
  border-radius: 8px 8px 2px 2px;
  background:
    repeating-linear-gradient(90deg, #0e7c72 0 20px, #d49419 20px 34px, #2563eb 34px 52px, #f8fafc 52px 62px),
    linear-gradient(180deg, rgba(24, 34, 31, 0.15), transparent);
  box-shadow: 0 8px 0 rgba(24, 34, 31, 0.08);
  opacity: 0.42;
}

.rink-floor {
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: 8%;
  height: 62%;
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.32), transparent 18% 82%, rgba(255, 255, 255, 0.28)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.22) 0 2px, transparent 2px 48px),
    var(--floor);
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.28), 0 24px 70px rgba(20, 37, 34, 0.18);
  transform: perspective(900px) rotateX(8deg);
}

.track-shadow,
.track-line {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 15%;
  height: 68%;
  border-radius: 999px;
}

.track-shadow {
  background: rgba(66, 46, 20, 0.12);
  filter: blur(12px);
  transform: translateY(14px);
}

.track-line {
  border: 18px solid rgba(14, 124, 114, 0.42);
}

.middle-track {
  inset: 23% 15% auto;
  height: 52%;
  border-width: 9px;
  border-color: rgba(255, 255, 255, 0.76);
}

.inner-track {
  inset: 31% 23% auto;
  height: 36%;
  border-width: 10px;
  border-color: rgba(212, 148, 25, 0.5);
}

.infield {
  position: absolute;
  left: 32%;
  right: 32%;
  top: 38%;
  height: 24%;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: rgba(7, 95, 88, 0.45);
  background: rgba(255, 255, 255, 0.34);
  font-size: clamp(1.6rem, 4vw, 4.3rem);
}

.rail {
  position: absolute;
  left: 4%;
  right: 4%;
  height: 8px;
  border-radius: 999px;
  background: rgba(24, 34, 31, 0.2);
}

.rail-top {
  top: 8%;
}

.rail-bottom {
  bottom: 8%;
}

.skater-orbit {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 13%;
  height: 52%;
  border-radius: 999px;
  animation: raceOrbit 13s linear infinite;
}

.orbit-b {
  inset-inline: 17%;
  bottom: 18%;
  height: 43%;
  animation-duration: 15s;
  animation-delay: -5s;
}

.orbit-c {
  inset-inline: 22%;
  bottom: 22%;
  height: 35%;
  animation-duration: 17s;
  animation-delay: -9s;
}

.skater {
  position: absolute;
  top: 44%;
  right: -10px;
  width: 54px;
  height: 48px;
  transform: rotate(-12deg);
  filter: drop-shadow(0 10px 5px rgba(24, 34, 31, 0.22));
}

.skater span {
  position: absolute;
  display: block;
}

.helmet {
  top: 0;
  left: 24px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f8fafc;
  box-shadow: inset 0 -3px 0 rgba(24, 34, 31, 0.16);
}

.body {
  top: 14px;
  left: 19px;
  width: 26px;
  height: 15px;
  border-radius: 999px 999px 7px 7px;
  background: var(--green);
  transform: rotate(14deg);
}

.skater-b .body,
.skater-b .wheel {
  background: var(--blue);
}

.skater-c .body,
.skater-c .wheel {
  background: var(--gold);
}

.arm,
.leg {
  height: 5px;
  border-radius: 999px;
  background: #18221f;
}

.arm-a {
  top: 20px;
  left: 9px;
  width: 20px;
  transform: rotate(-20deg);
}

.arm-b {
  top: 22px;
  left: 39px;
  width: 17px;
  transform: rotate(28deg);
}

.leg-a {
  top: 31px;
  left: 13px;
  width: 24px;
  transform: rotate(22deg);
}

.leg-b {
  top: 32px;
  left: 30px;
  width: 25px;
  transform: rotate(-22deg);
}

.wheel {
  bottom: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid #18221f;
}

.wheel-a {
  left: 17px;
}

.wheel-b {
  right: 2px;
}

@keyframes raceOrbit {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .skater-orbit {
    animation: none;
  }

  .orbit-a {
    transform: rotate(18deg);
  }

  .orbit-b {
    transform: rotate(148deg);
  }

  .orbit-c {
    transform: rotate(262deg);
  }
}

.hero-copy,
.role-grid {
  position: relative;
  z-index: 1;
}

.hero-copy h2 {
  max-width: 760px;
  font-size: clamp(2.6rem, 8vw, 6.5rem);
  line-height: 1.08;
  text-shadow: 0 5px 20px rgba(255, 255, 255, 0.8);
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(145px, 1fr));
  gap: 12px;
}

.role-card {
  min-height: 118px;
  padding: 18px;
  text-align: left;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(18, 36, 32, 0.08);
}

.role-card span {
  display: block;
  margin-bottom: 10px;
  font-size: 1.05rem;
  font-weight: 400;
}

.role-card small {
  color: var(--muted);
  line-height: 1.4;
}

.workspace,
.admin-view {
  display: grid;
  gap: 18px;
}

.workspace-top {
  justify-content: space-between;
  gap: 16px;
}

.top-actions {
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.workspace-layout {
  display: grid;
  grid-template-columns: minmax(240px, 330px) 1fr;
  gap: 18px;
  min-height: 620px;
}

.race-browser,
.race-detail,
.admin-grid > section,
.closed-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(18, 36, 32, 0.06);
}

.race-browser {
  padding: 14px;
}

.browser-head {
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}

.race-list {
  display: grid;
  gap: 8px;
}

.race-file {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  width: 100%;
  min-height: 70px;
  padding: 12px;
  text-align: left;
  border-radius: 8px;
  background: #f8fbfa;
  color: var(--ink);
  border: 1px solid transparent;
}

.race-file.active {
  border-color: var(--green);
  background: var(--soft);
}

.file-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 42px;
  border-radius: 5px;
  background: #dbeafe;
  color: var(--blue);
  font-weight: 900;
}

.race-file strong,
.race-file small {
  display: block;
}

.race-file small {
  margin-top: 4px;
  color: var(--muted);
}

.race-detail {
  overflow: hidden;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.status-pill {
  gap: 6px;
  width: max-content;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--green-strong);
  font-size: 0.82rem;
  font-weight: 800;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 830px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  background: #fbfdfc;
  color: #35423f;
  font-size: 0.8rem;
  text-transform: uppercase;
}

td input,
td select,
.dialog-card input,
.dialog-card select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
}

.row-actions {
  gap: 6px;
}

button,
.ghost-button {
  min-height: 38px;
  padding: 9px 13px;
  border-radius: 7px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
}

.ghost-button,
.small-button.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.small-button {
  min-height: 32px;
  padding: 7px 10px;
  font-size: 0.84rem;
}

.danger {
  background: var(--red);
}

.empty-state {
  padding: 38px;
  color: var(--muted);
}

.closed-panel {
  padding: 18px;
  color: var(--red);
  font-weight: 800;
}

.announcement-stack {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.announcement-card {
  justify-content: space-between;
  gap: 18px;
  padding: clamp(18px, 3vw, 30px);
  border: 2px solid var(--gold);
  border-radius: 8px;
  background: #fff9e8;
}

.announcement-card strong {
  display: block;
  font-size: clamp(1.6rem, 4vw, 3rem);
}

.announcement-card span {
  display: block;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.4rem);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(250px, 360px) 1fr;
  gap: 18px;
}

.admin-grid > section {
  padding: 18px;
}

.access-list,
.audit-log {
  display: grid;
  gap: 10px;
}

.access-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.audit-log {
  max-height: 560px;
  overflow: auto;
}

.audit-item {
  padding: 12px;
  border-left: 4px solid var(--green);
  background: #f8fbfa;
}

.audit-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

dialog {
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(21, 36, 33, 0.34);
}

.dialog-card {
  min-width: min(620px, calc(100vw - 28px));
  padding: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: #36423f;
  font-weight: 750;
}

.dialog-actions {
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.error {
  margin: 10px 0 0;
  color: var(--red);
  font-weight: 800;
}

@media (max-width: 950px) {
  .role-grid,
  .workspace-layout,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .role-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-layout {
    min-height: auto;
  }
}

@media (max-width: 620px) {
  .app-header,
  .workspace-top,
  .detail-head {
    align-items: flex-start;
    flex-direction: column;
  }

  main {
    padding: 12px;
  }

  .hero {
    min-height: auto;
    padding: 24px;
  }

  .role-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .role-card {
    min-height: 92px;
  }
}
