/* Event Guide — RULES / MARK SCHEME / HELP sheets + the RULES and MARK
   SCHEME HUD chips. Shares the guide chrome family (backdrop, gen3-frame1
   panel, red × close) defined in hackathon-credits.css; the sheet body is a
   "super simple 1. 2. 3. 4." numbered paper list — readability first
   (Marshall 7/25). */

/* ============================================================================
   THE ONE navigation — a single top icon bar for the whole event guide.
   Marshall's 7/25 fix: the build had TWO navs (this top bar was missing, and a
   duplicate tab row lived inside each panel). Now there is exactly ONE tab
   list in the DOM — this bar — pinned to the top edge above whichever panel is
   open, matching his CREDITS/SCHEDULE mockups: dark-blue bar, icon+label tabs,
   the ACTIVE tab lit yellow. Every tab is one click from anywhere.
   ========================================================================== */
:root {
  --guide-topnav-h: 56px;
}

.guide-topnav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 62; /* above the panel backdrops (z 60) */
  display: flex;
  align-items: stretch;
  gap: 4px;
  height: var(--guide-topnav-h);
  padding: 6px 8px;
  background: linear-gradient(180deg, #17457e 0%, #0f335f 100%);
  border-bottom: 3px solid #0a2547;
  box-shadow: 0 3px 0 rgba(10, 37, 71, .5), inset 0 2px 0 rgba(255, 255, 255, .12);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.guide-topnav::-webkit-scrollbar { display: none; }

.guide-topnav-tab {
  display: inline-flex;
  flex: 1 1 0;
  min-width: max-content;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px 12px;
  color: #dbe7f6;
  font: 800 12px/1 'PokeText', ui-monospace, monospace;
  letter-spacing: .04em;
  white-space: nowrap;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.guide-topnav-icon {
  font-size: 16px;
  line-height: 1;
  filter: saturate(1.1);
}

.guide-topnav-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, .1);
}

/* ACTIVE tab = yellow chip, exactly like his mockups */
.guide-topnav-tab.is-active {
  color: #3a2a06;
  background: linear-gradient(180deg, #ffe066 0%, #f8cd4c 100%);
  border-color: #b8860b;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .6), 0 2px 0 #b8860b;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, .4);
}

.guide-topnav-tab:focus-visible {
  outline: 3px solid #ffcd4c;
  outline-offset: 2px;
}

.guide-topnav-close {
  flex: 0 0 auto;
  width: 40px;
  margin-left: 4px;
  color: #fff;
  font: 900 24px/1 system-ui, sans-serif;
  background: #E82010;
  border: 2px solid #0a2547;
  border-radius: 8px;
  box-shadow: inset 0 0 0 2px #f8b870, 0 2px 0 #7a1010;
  cursor: pointer;
}

.guide-topnav-close:focus-visible {
  outline: 3px solid #ffcd4c;
  outline-offset: 2px;
}

/* every guide panel scrolls BELOW the fixed top bar — clear its height */
.sheet-panel,
.credits-panel,
.prizes-panel,
.schedule-panel {
  padding-top: calc(var(--guide-topnav-h) + 14px);
}

/* The top bar's × is the ONE close control — the old per-panel × is a
   duplicate; keep it in the DOM (focus/keyboard trap still reference it) but
   hide it so the guide chrome reads clean, like his CREDITS/SCHEDULE mockups. */
.sheet-close,
.credits-close,
.prizes-close,
.schedule-close {
  display: none;
}

@media (max-width: 760px) {
  :root { --guide-topnav-h: 50px; }
  .guide-topnav { padding: 5px 6px; gap: 3px; }
  .guide-topnav-tab { padding: 5px 8px; gap: 5px; font-size: 11px; }
  .guide-topnav-icon { font-size: 15px; }
  .guide-topnav-label { display: none; } /* icons-only strip on phones — the active tab still reads via aria + color */
  .guide-topnav-tab.is-active .guide-topnav-label { display: inline; } /* keep the active label visible so the current tab is unmistakable */
  .guide-topnav-close { width: 36px; }
}

.hackathon-sheet button:focus-visible,
.hackathon-sheet textarea:focus-visible {
  outline: 3px solid #ffcd4c;
  outline-offset: 2px;
}

.hackathon-sheet {
  --u: 2px;
  position: absolute;
  inset: 0;
  z-index: 60;
  padding: clamp(8px, 2vw, 20px);
  overflow: hidden;
  color: #606060;
  font-family: 'PokeDialogue', 'PokeText', "Courier New", monospace;
  background:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, .05) 3px 4px),
    linear-gradient(180deg,
      #000 0 4%,
      #7a1818 4% 9%,
      #10283A 9% 91%,
      #7a1818 91% 96%,
      #000 96% 100%);
}

.sheet-panel {
  position: relative;
  width: min(100%, 900px);
  height: 100%;
  margin: 0 auto;
  padding: clamp(10px, 2vw, 20px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #7373AC #DED5DE;
}

.sheet-masthead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 12px;
  border-bottom: 3px double #B8B8B0;
}

.sheet-kicker {
  margin: 0 0 4px;
  color: #C74637;
  font: 800 10px/1.2 'PokeText', ui-monospace, monospace;
  letter-spacing: .18em;
}

.sheet-masthead h2 {
  margin: 0;
  color: #424242;
  font: 800 clamp(20px, 3.4vw, 30px)/1.15 'PokeText', ui-monospace, monospace;
  letter-spacing: .03em;
  text-shadow: 2px 2px 0 #D0D0C8;
}

.sheet-intro {
  margin: 7px 0 0;
  color: #606060;
  font-size: 15px;
  text-shadow: 1px 1px 0 #E8E8E0;
}

.sheet-close {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  padding: 0;
  color: #F8F8F8;
  font: 900 26px/28px system-ui, sans-serif;
  background: #E82010;
  border: 2px solid #102f44;
  border-radius: 4px;
  box-shadow: inset 0 0 0 2px #F8B870, 2px 2px 0 #102f44;
  cursor: pointer;
}

/* the big readable list — white sticker rows on the paper panel. Two kinds
   (Marshall 7/25 mockup): numbered STRICT rules get a red circle badge; lead
   and context lines are softer full-width notes with no badge. */
.sheet-lines {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.sheet-lines li {
  color: #424242;
  font-size: clamp(15px, 2.2vw, 19px);
  line-height: 1.45;
  text-shadow: 1px 1px 0 #E8E8E0;
  border-radius: 6px;
}

/* ---- numbered rule row: [①] rule text ---- */
.sheet-line-rule {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 12px 14px;
  background: #FFFFFF;
  border: 2px solid #B8B8B0;
  box-shadow: inset 0 0 0 2px #EFEFE7, 2px 2px 0 rgba(16, 47, 68, .25);
}

.sheet-line-badge {
  display: grid;
  width: 28px;
  height: 28px;
  place-content: center;
  color: #F8F8F8;
  font: 900 14px/1 'PokeText', ui-monospace, monospace;
  background: #E82010;
  border: 2px solid #293131;
  border-radius: 50%;
  box-shadow: inset 0 -4px 0 rgba(41, 49, 49, .22);
  text-shadow: none;
}

.sheet-line-text { min-width: 0; }

/* ---- lead / context note: soft yellow tint, no badge (mockup) ---- */
.sheet-line-note {
  padding: 11px 14px;
  color: #5A4B22;
  background: linear-gradient(180deg, #FFF8DC 0%, #FFFDF2 100%);
  border: 2px solid #E4CF86;
  box-shadow: inset 0 0 0 2px #FFFDF2, 2px 2px 0 rgba(184, 134, 11, .2);
}

.sheet-line-note::before {
  content: "♥";
  margin-right: 8px;
  color: #C74637;
  font-size: .82em;
}

/* submissions row (RULES sheet) */
.sheet-submit-row {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sheet-submit-note {
  margin: 0;
  font-size: 13px;
  color: #606060;
  text-shadow: 1px 1px 0 #E8E8E0;
}

/* shared framed A-button action */
.sheet-action-button {
  min-height: 38px;
  padding: 8px 14px;
  color: #102f44;
  font: 800 12px/1 'PokeText', ui-monospace, monospace;
  letter-spacing: .04em;
  background: #F8F8F8;
  border: 2px solid #102f44;
  border-radius: 4px;
  box-shadow: inset 0 0 0 2px #DED5DE, 3px 3px 0 #102f44;
  cursor: pointer;
}

/* organizer editor */
.sheet-editor { margin-top: 18px; }

.sheet-editor-form {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.sheet-editor-text {
  width: 100%;
  padding: 10px 12px;
  color: #424242;
  font: 500 15px/1.5 'PokeDialogue', 'PokeText', monospace;
  background: #FFFFFF;
  border: 2px solid #102f44;
  border-radius: 6px;
  box-shadow: inset 0 0 0 2px #EFEFE7;
  resize: vertical;
}

.sheet-editor-hint,
.sheet-editor-status {
  margin: 0;
  font-size: 12px;
  color: #606060;
  text-shadow: 1px 1px 0 #E8E8E0;
}

.sheet-editor-status { color: #18A048; }

.sheet-editor-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---- HUD chips (top row: [MARK SCHEME][RULES][TEAM PORTAL][EVENT GUIDE]) */
.hackathon-sheet-chip {
  position: absolute;
  top: 10px;
  z-index: 58;
  min-height: 36px;
  padding: 7px 10px;
  color: #102f44;
  font: 800 11px/1 'PokeText', ui-monospace, monospace;
  letter-spacing: .03em;
  background: #F8F8F8;
  border: 2px solid #102f44;
  border-radius: 4px;
  box-shadow: inset 0 0 0 2px #DED5DE, 3px 3px 0 #102f44;
  cursor: pointer;
}

.hackathon-sheet-chip::before {
  content: "▪";
  margin-right: 5px;
  color: #E82010;
}

.hackathon-sheet-chip:focus-visible {
  outline: 3px solid #ffcd4c;
  outline-offset: 2px;
}

.hackathon-sheet-chip-rules { right: 386px; min-width: 76px; }
.hackathon-sheet-chip-mark { right: 474px; min-width: 116px; }

/* small screens: the guide nav inside the panels still reaches every
   sheet — the two extra chips would collide with the route mark */
@media (max-width: 1020px) {
  .hackathon-sheet-chip { display: none; }
}

@media (max-width: 760px) {
  .hackathon-sheet { --u: 1.5px; padding: 4px; }
  .sheet-panel { padding: calc(var(--guide-topnav-h) + 10px) 8px 14px; }
  .sheet-lines li { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .hackathon-sheet *, .hackathon-sheet-chip { scroll-behavior: auto !important; }
}
