@font-face {
  font-family: Inter;
  src: url("./inter.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("./space-grotesk.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "Barlow Condensed";
  src: url("./barlow-condensed.woff2") format("woff2");
  font-style: italic;
  font-weight: 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family: Inter, system-ui, sans-serif;
  color: #fbf7ed;
  background: #10100f;
  --surface: #1b1a17;
  --panel: #151513;
  --edge: #353128;
  --muted: #c6beb0;
  --gold: #ffc414;
  --gold-light: #ffd875;
  --training: #9fdbb4;
  --match: #ffd26b;
  --display: "Space Grotesk", Inter, system-ui, sans-serif;
  --headline: "Barlow Condensed", "Arial Narrow", var(--display);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, p { margin: 0; }
:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 4px; }

.skip-link {
  position: fixed;
  z-index: 2;
  top: 1rem;
  left: 1rem;
  padding: .75rem 1rem;
  border-radius: .5rem;
  color: #17130a;
  background: var(--gold-light);
  transform: translateY(-180%);
}

.skip-link:focus { transform: none; }

.layout {
  display: grid;
  grid-template-columns: 15.75rem minmax(0, 1fr);
  min-height: 100svh;
}

.sidebar {
  background: #141412;
  border-right: 1px solid var(--edge);
  padding: 1.85rem 1rem;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: .7rem;
  width: fit-content;
  margin: 0 .55rem 2.35rem;
  font: italic 800 2.1rem/.9 var(--headline);
  letter-spacing: .04em;
}

.wordmark-stripe {
  width: .3rem;
  height: 1.65rem;
  background: var(--gold);
  transform: skewX(-15deg);
}

.teams { display: grid; gap: .35rem; }
.eyebrow {
  color: var(--muted);
  font-size: .8125rem;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.nav-title { margin: 0 .65rem .55rem; }

.team {
  position: relative;
  display: flex;
  align-items: center;
  gap: .65rem;
  min-height: 3rem;
  padding: .55rem .7rem;
  border: 1px solid transparent;
  border-radius: .5rem;
  color: var(--muted);
  text-decoration: none;
  font-size: .875rem;
  line-height: 1.3;
  font-weight: 600;
}

.team:hover { background: #24211a; color: #fbf7ed; }
.team[aria-current] {
  border-color: #635122;
  border-left-color: var(--gold);
  background: #2c2515;
  color: #fff0c7;
}

.game-icon {
  flex: 0 0 1.75rem;
  width: 1.75rem;
  height: 1.75rem;
  padding: .12rem;
  object-fit: contain;
}

.game-icon--valorant { padding: .25rem; }

.main { min-width: 0; }
.main:focus { outline: none; }

.calendar-icon, .clock-icon {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  color: var(--gold-light);
}

.calendar-icon {
  width: 1rem;
  height: .9rem;
  margin-top: .15rem;
  border: 1.5px solid currentColor;
  border-radius: .17rem;
}

.calendar-icon::before {
  content: "";
  position: absolute;
  inset: .21rem 0 auto;
  border-top: 1px solid currentColor;
}

.calendar-icon::after {
  content: "";
  position: absolute;
  top: -.22rem;
  left: .18rem;
  width: .1rem;
  height: .27rem;
  border-radius: 2px;
  background: currentColor;
  box-shadow: .38rem 0 currentColor;
}

.content {
  max-width: 76rem;
  margin-inline: auto;
  padding: clamp(1rem, 3.5vw, 3rem);
}

.account-bar { display: grid; justify-items: end; gap: .4rem; margin-bottom: .85rem; }
.account-actions, .schedule-actions, .editor-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
}
.account-actions { justify-content: end; }

.action-button {
  min-height: 2.75rem;
  padding: .55rem .85rem;
  border: 1px solid #63512c;
  border-radius: .45rem;
  background: #211e18;
  color: #ffebba;
  font-size: .875rem;
  font-weight: 700;
}
.action-button:hover { border-color: var(--gold-light); background: #322719; }
.action-button--primary { border-color: var(--gold); color: #181308; background: var(--gold); }
.action-button--primary:hover { background: var(--gold-light); }
.action-button--danger { color: #ffb8ad; border-color: #795049; background: #281917; }

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .9fr);
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
  min-height: clamp(14rem, 23vw, 19rem);
  padding: clamp(1.2rem, 3.6vw, 3.3rem);
  border: 1px solid #5a4821;
  border-radius: .7rem;
  overflow: hidden;
  background:
    linear-gradient(105deg, #171512 18%, transparent 73%),
    repeating-linear-gradient(126deg, transparent 0 24px, #ffc41414 24px 25px, transparent 25px 39px),
    radial-gradient(ellipse at 81% 47%, #4e3b17, #211c13 63%, #161510);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: .27rem;
  background: var(--gold);
  pointer-events: none;
}

.hero h1 {
  font: italic 800 clamp(3.25rem, 6.6vw, 6.15rem)/.86 var(--headline);
  letter-spacing: -.025em;
  text-transform: uppercase;
}

.hero h1 span { display: block; color: var(--gold); }

.hero-logo {
  display: block;
  justify-self: center;
  width: min(100%, clamp(11rem, 24vw, 21rem));
  height: auto;
  filter: drop-shadow(0 .7rem .7rem #0c0805b0);
}

.week {
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px solid var(--edge);
  border-radius: .9rem;
  background: var(--panel);
}

.week-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .65rem;
  margin: .1rem .2rem .85rem;
}

.week-header h2 { font: 700 clamp(1.1rem, 2vw, 1.375rem)/1.2 var(--display); }
.week-controls { display: flex; flex: 0 0 auto; align-items: center; gap: .35rem; }

.today-button, .week-button, .close-button {
  min-width: 2.75rem;
  min-height: 2.75rem;
  border-radius: .45rem;
  border: 1px solid #514431;
  background: #211e18;
  display: inline-grid;
  place-items: center;
}

.today-button {
  padding-inline: .7rem;
  color: var(--gold-light);
  font-weight: 650;
  font-size: .875rem;
}

.today-button:hover, .week-button:hover, .close-button:hover {
  background: #312817;
  border-color: #9f7935;
}

.chevron {
  display: block;
  width: .45rem;
  height: .45rem;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: translateX(-.11rem) rotate(45deg);
}

.chevron--left { transform: translateX(.11rem) rotate(-135deg); }

.week-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .55rem; }

.day {
  display: grid;
  justify-items: center;
  gap: .1rem;
  padding: .65rem .08rem .45rem;
  border: 1px solid var(--edge);
  border-radius: .45rem;
  background: var(--surface);
}

.day:hover { background: #292318; border-color: #795f32; }
.day[aria-pressed="true"] { background: var(--gold); border-color: var(--gold-light); color: #181308; }
.day-weekday { font-size: .8125rem; line-height: 1.3; color: var(--muted); font-weight: 600; }
.day[aria-pressed="true"] .day-weekday { color: #3c2e0e; }
.day-number { font: 700 clamp(1.25rem, 2.4vw, 1.7rem)/1.1 var(--display); }
.day-markers { height: .5rem; display: flex; align-items: end; gap: .2rem; }
.day-dot { width: .3rem; height: .3rem; border-radius: 50%; background: var(--match); }
.day-dot--training { background: var(--training); }
.day[aria-pressed="true"] .day-dot { background: #412b04; }
.day[aria-pressed="true"] .day-dot--training { background: #245338; }

.schedule { margin-top: 1.65rem; }
.schedule-header { display: flex; justify-content: space-between; align-items: end; gap: .65rem; margin-bottom: .85rem; }
.schedule-header .eyebrow { margin-bottom: .3rem; color: var(--gold-light); }
.schedule-header h2 { font: 700 clamp(1.3rem, 2.6vw, 1.9rem)/1.14 var(--display); letter-spacing: -.032em; }
.timezone { display: flex; align-items: center; gap: .4rem; font-size: .8125rem; color: var(--muted); white-space: nowrap; padding-bottom: .15rem; }

.clock-icon { width: .875rem; height: .875rem; border: 1.5px solid currentColor; border-radius: 50%; }
.clock-icon::before { content: ""; position: absolute; top: .16rem; left: .3rem; width: .2rem; height: .23rem; border-left: 1px solid currentColor; border-bottom: 1px solid currentColor; }
.events { display: grid; gap: .6rem; }

.event {
  width: 100%;
  display: grid;
  grid-template-columns: 5.8rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: .85rem 1.1rem;
  border: 1px solid var(--edge);
  border-left: 3px solid var(--training);
  border-radius: .65rem;
  text-align: start;
  background: var(--surface);
}

.event--match { border-left-color: var(--match); }
.event:hover {
  background: #242018;
  border-top-color: #6e5835;
  border-right-color: #6e5835;
  border-bottom-color: #6e5835;
}

.event-time {
  padding-block: .45rem;
  border-right: 1px solid var(--edge);
  font: 700 clamp(1.15rem, 2vw, 1.5rem)/1 var(--display);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.event-info { display: grid; justify-items: start; gap: .25rem; }
.event-type { font-size: .8125rem; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; }
.event-type--training { color: var(--training); }
.event-type--match { color: var(--match); }
.event-title { font-size: 1rem; font-weight: 650; line-height: 1.35; }
.event-details { font-size: .875rem; color: var(--gold-light); font-weight: 600; white-space: nowrap; }
.event:hover .event-details { text-decoration: underline; }

.empty {
  display: flex;
  min-height: 5.5rem;
  align-items: center;
  gap: .8rem;
  padding: 1.1rem;
  border: 1px dashed #514431;
  border-radius: .65rem;
  color: var(--muted);
  background: var(--panel);
}

.event-dialog {
  width: min(29rem, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  padding: 1.55rem;
  border: 1px solid #665332;
  border-radius: .9rem;
  background: var(--surface);
}

.event-dialog::backdrop { background: #080705cf; }
.event-dialog h2 { font: 700 1.75rem/1.1 var(--display); margin: .5rem 2.75rem .6rem 0; }
.event-dialog--wide { width: min(43rem, calc(100% - 2rem)); }
.dialog-when { color: var(--gold-light); margin-bottom: 1rem; }
#dialog-description { color: var(--muted); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.dialog-controls { position: absolute; top: .75rem; right: .75rem; }
.close-button { font-size: 1.5rem; line-height: 1; }
.dialog-action { margin-top: 1rem; }
.dialog-intro { color: var(--muted); line-height: 1.5; margin-bottom: .9rem; }
.fields, .users-list { display: grid; gap: .85rem; }
.fields label, .account-code { display: grid; min-width: 0; gap: .35rem; font-size: .875rem; font-weight: 650; }
.fields input, .fields select, .fields textarea, .account-code input {
  width: 100%;
  min-width: 0;
  min-height: 2.75rem;
  padding: .6rem .65rem;
  color: inherit;
  font: 400 1rem/1.35 Inter, system-ui, sans-serif;
  border: 1px solid #574936;
  border-radius: .35rem;
  background: #14130f;
}
.fields select {
  appearance: none;
  padding-inline-end: 2rem;
  background:
    linear-gradient(45deg, transparent 50%, var(--gold-light) 50%) calc(100% - .99rem) center / .29rem .29rem no-repeat,
    linear-gradient(135deg, var(--gold-light) 50%, transparent 50%) calc(100% - .7rem) center / .29rem .29rem no-repeat,
    #14130f;
}
.fields textarea { resize: vertical; }
.fields > button { justify-self: start; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.user-access { align-items: end; }
.user-form { padding: .85rem; border: 1px solid var(--edge); border-radius: .5rem; }
.form-help, .form-message { color: var(--muted); font-size: .875rem; line-height: 1.45; overflow-wrap: anywhere; }
.form-message:empty { display: none; }
.form-message[role="alert"], .form-message.is-error { color: #ffb8ad; }
.account-role { color: var(--gold-light); font-weight: 650; margin: .85rem 0; }
.account-code { margin-top: .65rem; }
.noscript { margin-top: 1rem; color: var(--muted); }

@media (max-width: 850px) {
  .layout { grid-template-columns: 12.8rem minmax(0, 1fr); }
  .sidebar { padding-inline: .75rem; }
  .team { gap: .5rem; }
  .week-days { gap: .35rem; }
  .schedule-header { align-items: start; flex-direction: column; }
}

@media (max-width: 670px) {
  .layout { display: block; }
  .sidebar { padding: .9rem .9rem .75rem; border-right: 0; border-bottom: 1px solid var(--edge); }
  .wordmark { margin: 0 0 .75rem .2rem; font-size: 1.65rem; gap: .5rem; }
  .wordmark-stripe { height: 1.15rem; width: .22rem; }
  .teams { display: flex; flex-wrap: wrap; gap: .35rem; }
  .nav-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .team { min-height: 2.75rem; padding: .4rem .48rem; font-size: .8125rem; border-color: var(--edge); }
  .game-icon { width: 1.15rem; height: 1.15rem; flex-basis: 1.15rem; padding: 0; }
  .game-icon--valorant { padding: .12rem; }
  .content { padding: .85rem .9rem 1.5rem; }
  .hero { min-height: 10.75rem; padding: 1rem; gap: .55rem; }
  .hero h1 { font-size: clamp(2.25rem, 10vw, 3.85rem); }
  .hero-logo { width: min(100%, 13rem); }
  .week { margin-top: .95rem; padding: .65rem; border-radius: .75rem; }
  .week-header { margin: 0 0 .6rem; }
  .week-days { gap: .25rem; }
  .day { padding: .5rem .05rem .35rem; border-radius: .4rem; }
  .day-weekday { font-size: .75rem; }
  .schedule { margin-top: 1.15rem; }
  .event { grid-template-columns: 3.65rem minmax(0, 1fr); padding: .7rem .65rem; gap: .1rem .65rem; }
  .event-time { grid-row: 1 / 3; }
  .event-details { grid-column: 2; font-size: .8125rem; }
}

@media (max-width: 360px) {
  .content, .sidebar { padding-inline: .65rem; }
  .hero { padding-inline: .75rem; }
  .hero h1 { font-size: clamp(1.85rem, 9.7vw, 2.2rem); }
  .week-header { gap: .35rem; }
  .week-controls { gap: .2rem; }
  .today-button { padding-inline: .45rem; }
}

@media (max-width: 440px) {
  .user-form .field-row { grid-template-columns: minmax(0, 1fr); }
  .event-dialog { padding: 1.2rem; }
}
