:root {
  --green-950: #103d31;
  --green-900: #0d4f3a;
  --green-700: #147a58;
  --green-600: #1b9168;
  --green-100: #dff3e9;
  --green-50: #f1faf6;
  --gold-600: #b87509;
  --gold-400: #f0b83c;
  --gold-100: #fff0c8;
  --ink: #17332b;
  --muted: #63766f;
  --line: #dfe9e4;
  --paper: #ffffff;
  --canvas: #f6f8f5;
  --danger: #b63a38;
  --shadow: 0 16px 42px rgba(17, 63, 49, 0.08);
  --radius: 22px;
  --display: "Bricolage Grotesque", ui-rounded, system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .62; }
a { color: var(--green-700); text-underline-offset: 3px; }
[hidden] { display: none !important; }

.shell { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.hero { background: var(--green-950); color: white; overflow: hidden; position: relative; }
.hero::after {
  content: "";
  position: absolute;
  width: 290px;
  height: 290px;
  border: 54px solid rgba(255, 255, 255, .045);
  border-radius: 50%;
  right: -105px;
  top: -130px;
}
.hero__inner { min-height: 310px; position: relative; padding: 30px 0 44px; z-index: 1; }
.brand {
  color: white;
  display: inline-block;
  font-family: var(--display);
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -1.4px;
  text-decoration: none;
}
.brand span { color: var(--gold-400); }
.hero__copy { margin-top: 45px; max-width: 710px; }
.eyebrow, .kicker {
  color: var(--gold-400);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
  margin: 0 0 7px;
}
h1, h2, h3 { font-family: var(--display); letter-spacing: -.035em; line-height: 1.05; margin: 0; }
h1 { font-size: clamp(42px, 7vw, 70px); }
h2 { font-size: clamp(25px, 3vw, 33px); }
h3 { font-size: 19px; }
.hero__lead { color: #cde3da; font-size: 17px; margin: 14px 0 0; max-width: 650px; }
.season-card {
  align-items: center;
  background: #1b5a48;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 14px;
  display: flex;
  gap: 12px;
  max-width: min(100%, 520px);
  min-width: 0;
  padding: 13px 17px;
  position: absolute;
  right: 0;
  top: 31px;
}
.season-card > div { min-width: 0; }
.season-card__icon { background: var(--gold-100); border-radius: 10px; padding: 8px; }
.season-card strong, .season-card span { display: block; }
.season-card strong { font-size: 13px; }
#prize-text { overflow-wrap: anywhere; }
.season-card div > span { color: #bcd6cc; font-size: 11px; margin-top: 1px; }

.main-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, .8fr);
  margin-top: -24px;
  padding-bottom: 30px;
  position: relative;
  z-index: 2;
}
.main-column {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}
.card {
  background: var(--paper);
  border: 1px solid rgba(20, 81, 62, .07);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 30px;
}
.log-card { border-top: 5px solid var(--gold-400); }
.standings-card { border-top: 5px solid var(--green-600); }
.section-heading { align-items: flex-start; display: flex; justify-content: space-between; gap: 18px; }
.section-heading--rule { border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.section-heading .kicker { color: var(--green-700); }
.section-intro { color: var(--muted); margin: 10px 0 22px; }
.time-pill {
  background: var(--green-100);
  border-radius: 999px;
  color: var(--green-700);
  flex: none;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 9px;
}
.section-icon { font-size: 28px; }

form { margin: 0; min-width: 0; }
.form-row { display: grid; gap: 13px; grid-template-columns: 1fr .7fr; min-width: 0; }
.field { display: grid; gap: 6px; margin-bottom: 15px; min-width: 0; }
.field > span { color: var(--green-950); font-size: 12px; font-weight: 700; }
.field small { color: var(--muted); font-size: 10px; font-weight: 500; }
input, select {
  appearance: none;
  background-color: #fbfcfb;
  border: 1px solid #cadbd3;
  border-radius: 11px;
  color: var(--ink);
  min-height: 48px;
  min-width: 0;
  max-width: 100%;
  outline: none;
  padding: 0 13px;
  width: 100%;
}
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--green-700) 50%), linear-gradient(135deg, var(--green-700) 50%, transparent 50%);
  background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  padding-right: 34px;
}
input:focus, select:focus { border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(27, 145, 104, .12); }
.selected-value {
  color: var(--muted);
  display: block;
  font-size: 11px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  padding-inline: 3px;
}
.points-preview {
  align-items: center;
  background: var(--gold-100);
  border-radius: 11px;
  color: #75500b;
  display: flex;
  font-size: 13px;
  font-weight: 700;
  justify-content: space-between;
  margin: -4px 0 15px;
  padding: 10px 13px;
}
.custom-points { animation: pop-in .18s ease-out; }

.button {
  align-items: center;
  border: 0;
  border-radius: 11px;
  display: inline-flex;
  font-weight: 700;
  gap: 12px;
  justify-content: center;
  min-height: 46px;
  padding: 0 17px;
}
.button--primary { background: var(--green-700); color: white; }
.button--primary:hover { background: var(--green-900); transform: translateY(-1px); }
.button--wide { justify-content: space-between; width: 100%; }
.button--quiet { background: #edf3f0; color: var(--ink); }
.button--danger { background: #f7e4e3; color: var(--danger); }
.button--small { min-height: 36px; padding: 0 11px; font-size: 12px; }

.standings { margin-top: 19px; }
.standing-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: 36px 1fr auto;
  min-height: 54px;
}
.standing-row:last-child { border-bottom: 0; }
.standing-row--leader { background: var(--green-50); border-radius: 11px; border: 0; margin: 0 -10px 5px; padding: 0 10px; }
.avatar {
  align-items: center;
  background: var(--green-100);
  border-radius: 50%;
  color: var(--green-700);
  display: flex;
  font-family: var(--display);
  font-size: 12px;
  font-weight: 800;
  height: 32px;
  justify-content: center;
  position: relative;
  width: 32px;
}
.medal { font-size: 18px; position: absolute; right: -9px; top: -8px; }
.standing-name { font-weight: 650; }
.standing-points { font-variant-numeric: tabular-nums; text-align: right; }
.standing-points strong { color: var(--green-950); font-family: var(--display); font-size: 22px; }
.standing-points span { color: var(--muted); display: block; font-size: 9px; font-weight: 700; letter-spacing: .08em; margin-top: -5px; }
.skeleton { animation: pulse 1.4s infinite; background: #edf2ef; border-radius: 9px; height: 44px; margin: 8px 0; }

.feed, .points-table { margin-top: 2px; }
.main-column--primary .points-table {
  column-gap: 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.feed-item { display: grid; gap: 12px; grid-template-columns: 42px 1fr auto; padding: 20px 0; border-bottom: 1px solid var(--line); }
.main-grid > *, .section-heading > *, .feed-item > *, .standing-row > *, .admin-row > * { min-width: 0; }
.standing-name, .feed-item, .points-row, .admin-row { overflow-wrap: anywhere; }
.feed-item:last-child { border-bottom: 0; }
.feed-item .avatar { height: 38px; width: 38px; }
.feed-meta { color: var(--muted); font-size: 11px; margin-top: 2px; }
.feed-description { color: #455d55; margin: 8px 0 0; overflow-wrap: anywhere; }
.feed-actions { align-items: flex-end; display: flex; flex-direction: column; gap: 9px; }
.delete-link { background: transparent; border: 0; color: var(--muted); font-size: 11px; padding: 2px; text-decoration: underline; text-underline-offset: 2px; }
.delete-link:hover { color: var(--danger); }
.score {
  border-radius: 999px;
  display: inline-flex;
  flex: none;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  min-width: 39px;
  padding: 4px 8px;
  justify-content: center;
}
.score--1 { background: #e4f1ff; color: #25639c; }
.score--3 { background: #e8e5fb; color: #5b4ab2; }
.score--5 { background: #e0f4e9; color: #187148; }
.score--10 { background: var(--gold-100); color: #875200; }
.score--custom { background: #f1e9f7; color: #764b93; }
.score--pending { background: #edf0ee; color: #53635d; }
.empty-state { color: var(--muted); padding: 46px 12px; text-align: center; }
.empty-state span { display: block; font-size: 35px; margin-bottom: 8px; }
.empty-state p { margin: 0; }

.points-row { align-items: center; border-bottom: 1px solid var(--line); display: grid; gap: 12px; grid-template-columns: auto 1fr; padding: 12px 0; }
.points-row:last-child { border-bottom: 0; }
.points-row span:last-child { font-size: 13px; }
.trust-note { align-items: center; background: var(--green-50); border-radius: 12px; color: var(--green-700); display: flex; font-size: 12px; gap: 10px; margin: 17px 0 0; padding: 12px; }

.footer { align-items: center; color: var(--muted); display: flex; font-size: 12px; justify-content: space-between; padding-bottom: 30px; }
.admin-link { background: transparent; border: 0; color: #53635d; font-size: 11px; padding: 8px; }
.toast {
  animation: toast-in .25s ease-out;
  background: var(--green-950);
  border-radius: 12px;
  bottom: 22px;
  box-shadow: 0 12px 40px rgba(0,0,0,.2);
  color: white;
  font-weight: 700;
  left: 50%;
  padding: 13px 18px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 20;
}

.dialog { border: 0; border-radius: 20px; color: var(--ink); padding: 0; box-shadow: 0 25px 80px rgba(8, 43, 32, .28); }
.dialog::backdrop { background: rgba(10, 39, 31, .65); backdrop-filter: blur(3px); }
.dialog--small { max-width: 410px; padding: 30px; text-align: center; width: calc(100% - 32px); }
.dialog--small p { color: var(--muted); }
.dialog__emoji { font-size: 36px; }
.dialog__actions { display: flex; gap: 10px; justify-content: center; margin-top: 22px; }
.dialog--admin { max-height: min(90vh, 900px); max-width: 980px; overflow: auto; width: calc(100% - 30px); }
.dialog__topbar { align-items: center; background: var(--green-950); color: white; display: flex; justify-content: space-between; padding: 23px 28px; position: sticky; top: 0; z-index: 2; }
.dialog__topbar .kicker { margin: 0 0 5px; }
.icon-button { background: rgba(255,255,255,.1); border: 0; border-radius: 50%; color: white; font-size: 26px; height: 40px; width: 40px; }
.admin-login { margin: 50px auto; max-width: 390px; padding: 0 24px; }
.form-error { color: var(--danger); font-size: 12px; min-height: 20px; }
.admin-wrap { padding: 26px; }
.admin-section { border-bottom: 1px solid var(--line); padding: 9px 0 30px; }
.admin-section:last-child { border-bottom: 0; }
.admin-section__head { align-items: center; display: flex; justify-content: space-between; margin-bottom: 15px; }
.admin-list { display: grid; gap: 8px; }
.admin-row { align-items: center; background: var(--green-50); border-radius: 10px; display: grid; gap: 8px; grid-template-columns: 1fr 90px auto auto; padding: 8px; }
.admin-row--employee { grid-template-columns: 1fr auto auto; }
.admin-row--entry { align-items: end; grid-template-columns: 1fr 1.1fr 135px 80px; }
.admin-row input, .admin-row select { background-color: white; min-height: 40px; }
.admin-row .field { margin: 0; }
.admin-row__actions { display: flex; gap: 6px; grid-column: 1 / -1; justify-content: flex-end; }
.inline-form { display: flex; gap: 8px; margin-top: 10px; }
.inline-form input { min-height: 42px; }
.settings-grid { display: grid; gap: 10px; grid-template-columns: 1fr 180px auto; }
.checkbox { align-items: center; display: inline-flex; gap: 6px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.checkbox input { accent-color: var(--green-700); min-height: auto; width: auto; }

@keyframes pulse { 50% { opacity: .48; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

@media (max-width: 820px) {
  .shell { width: min(100% - 28px, 650px); }
  .hero__inner { min-height: 0; padding-top: 22px; }
  .hero__copy { margin-top: 35px; }
  .season-card {
    inset: auto;
    margin-top: 24px;
    max-width: none;
    position: relative;
    width: 100%;
  }
  .main-grid { grid-template-columns: 1fr; margin-top: -18px; }
  .main-column { display: contents; }
  .main-column--primary .points-table { display: block; }
  .standings-card { grid-row: 2; }
  .feed-card { grid-row: 3; }
  .points-card { grid-row: 4; }
  .admin-row, .admin-row--employee, .admin-row--entry { grid-template-columns: 1fr 100px; }
  .admin-row .field:first-child { grid-column: 1 / -1; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  body { font-size: 14px; }
  .shell { width: calc(100% - 22px); }
  .hero__inner { min-height: 406px; }
  .hero__lead { font-size: 15px; }
  .card { border-radius: 17px; padding: 22px 18px; }
  .main-grid { gap: 13px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .feed-item { grid-template-columns: 36px 1fr auto; gap: 9px; }
  .feed-item .avatar { height: 33px; width: 33px; }
  .section-heading { align-items: center; }
  .dialog__topbar, .admin-wrap { padding-inline: 18px; }
  .inline-form { flex-direction: column; }
  .admin-row, .admin-row--employee, .admin-row--entry { grid-template-columns: 1fr; }
  .admin-row .field:first-child { grid-column: auto; }
  .dialog__actions { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; scroll-behavior: auto !important; transition: none !important; }
}
