/* Competition — the same editorial section system as the rest of the site. */
.competition-page .hero .damp {
  background: none;
}
.competition-page .hero .damp2 {
  background: none;
}
.competition-page .hero canvas { opacity: 1; }
.competition-page .hero .left, .competition-page .rsec .t {
  text-shadow: 0 0 6px #fff, 0 0 12px #fff;
}
.competition-page .heroflex .left { min-width: 0; }
.competition-result {
  padding: 2.1rem var(--pad) 3.2rem;
  text-align: center;
}
.result-label, .competition-kicker {
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .05em;
  color: var(--ink-faint);
}
.result-line {
  display: flex;
  justify-content: center;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .35rem .8rem;
  margin-top: .8rem;
  font: italic clamp(1.35rem, 2.6vw, 2rem)/1.4 var(--serif);
  color: var(--ink-soft);
}
.result-line > span:not(.result-separator) { white-space: nowrap; }
.result-line strong {
  color: #cb9300;
  font-weight: 400;
  font-style: italic;
}
.result-separator { color: var(--ink); }
.competition-copy .pd { color: var(--accent); }
.competition-main { padding: 0 var(--pad) clamp(4rem, 8vw, 8rem); }
.competition-entry {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 5rem);
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}
.competition-copy h2 {
  margin: .9rem 0 1rem;
  font-weight: 300;
  font-size: clamp(1.7rem, 3.2vw, 2.7rem);
  letter-spacing: -.045em;
  line-height: 1.04;
}
.competition-course {
  margin-bottom: 1rem;
  color: var(--ink-soft);
  font: italic clamp(1.15rem, 1.7vw, 1.45rem)/1.5 var(--serif);
}
.competition-description { max-width: 54ch; font-size: 1.05rem; color: var(--ink-soft); line-height: 1.7; }
.competition-links { display: flex; flex-wrap: wrap; gap: .8rem 2rem; margin-top: 1.2rem; }
.competition-links a {
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--rule-mid);
  font: .8rem/1.6 var(--mono);
  transition: border-color .2s;
}
.competition-links a:hover { border-color: var(--ink); }
.competition-links a span { margin-left: .25rem; }
.competition-facts { padding-top: .15rem; }
.competition-facts dl { margin-top: 1.4rem; }
.competition-facts dl > div { padding: 1rem 0; border-top: 1px solid var(--rule); }
.competition-facts dt { font: .75rem/1.5 var(--mono); color: var(--ink-faint); margin-bottom: .45rem; }
.competition-facts dd { font-size: 1.25rem; line-height: 1.4; }
.fact-detail { display: block; margin-top: .3rem; font: .75rem/1.65 var(--mono); color: var(--ink-faint); overflow-wrap: anywhere; }
.competition-source { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--rule); font: .75rem/1.7 var(--mono); color: var(--ink-faint); }
@media (max-width: 820px) {
  .competition-entry { grid-template-columns: 1fr; gap: 3rem; }
  .competition-facts dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.5rem; }
}
@media (max-width: 540px) {
  .competition-copy h2 { font-size: clamp(1.8rem, 7.7vw, 2.6rem); }
}

/* Same palette, prompt and cursor as the ticker. */
.leaderboard-terminal { --terminal-result-inset: .5rem; min-width: 0; border: 1px solid var(--ink); background: var(--ink); color: #e9e7e2; font: .71rem/1.65 var(--mono); letter-spacing: .04em; }
.terminal-bar, .terminal-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1.15rem; color: #a3a39e; }
.terminal-bar { border-bottom: 1px solid #30302e; }
.terminal-bar > span:first-child { color: #e9e7e2; }
.terminal-dot { display: inline-block; width: 5px; height: 5px; background: var(--accent); border-radius: 50%; margin-right: .4rem; vertical-align: middle; }
.terminal-status { font-size: .63rem; text-align: right; }
.terminal-output { padding: 1.2rem 1.15rem;  overflow-wrap: anywhere; }
.terminal-command { color: #e9e7e2; margin-bottom: .9rem; line-height: 1.9; white-space: nowrap; letter-spacing: 0; }
.terminal-prompt { color: var(--accent); }
.terminal-cursor { display: inline-block; width: .55ch; background: var(--accent); margin-left: 1px; animation: cblink 1s step-end infinite; color: transparent; }
.terminal-muted { color: #a3a39e; font-size: .66rem; }
.terminal-output table { width: calc(100% - var(--terminal-result-inset)); border-collapse: collapse; margin: .9rem 0 .9rem var(--terminal-result-inset); font-size: .66rem; table-layout: fixed; letter-spacing: 0; }
.terminal-output caption { text-align: left; font-size: .63rem; color: #a3a39e; margin-bottom: .5rem; }
.terminal-output th { text-align: left; font-weight: 400; color: #a3a39e; border-bottom: 1px solid #30302e; }
.terminal-output th, .terminal-output td { padding: .25rem .15rem; }
.terminal-output th:first-child { width: 2rem; }
.terminal-output th:last-child, .terminal-output td:last-child { width: 3.1rem; text-align: right; }
.terminal-yours { color: #70c8f4; }
.terminal-yours .flap-card { --card-bg: #18303b; --card-line: #0c202a; }
.terminal-result { color: #70c8f4; margin: .65rem 0; }
.terminal-filter { margin: 1.8rem 0 .85rem; color: #a3a39e; font-size: .65rem; }
.terminal-error { color: #e6a98e; margin-top: 1rem; }
.terminal-footer { border-top: 1px solid #30302e; font-size: .64rem; flex-wrap: wrap; }
.terminal-footer button { border: 0; background: none; color: #e9e7e2; font: inherit; cursor: pointer; padding: .2rem; }
.terminal-footer button:disabled { opacity: .4; cursor: wait; }
.terminal-footer button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.terminal-note { margin: 0; padding: 0 1.15rem 1rem; color: #a3a39e; font-size: .62rem; line-height: 1.7; }
.terminal-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.flap-word { display: inline-flex; gap: 1px; max-width: 100%; flex-wrap: wrap; }
.flap-card { --card-bg: #252523; --card-line: #0c0c0b; display: inline-block; position: relative; width: .69em; height: 1.8em; perspective: 160px; font-variant-numeric: tabular-nums; }
.flap-card > span { position: absolute; left: 0; width: 100%; height: 50%; overflow: hidden; background: var(--card-bg); backface-visibility: hidden; }
.flap-card > span > span { position: absolute; left: 0; width: 100%; height: 1.8em; line-height: 1.8em; text-align: center; }
.flap-upper, .flap-old-top { top: 0; border-radius: 2px 2px 0 0; box-shadow: inset 0 -1px var(--card-line); }
.flap-lower, .flap-old-bottom, .flap-new-bottom { bottom: 0; border-radius: 0 0 2px 2px; box-shadow: inset 0 1px var(--card-line); }
.flap-lower > span, .flap-old-bottom > span, .flap-new-bottom > span { bottom: 0; }
.flap-old-top { z-index: 3; transform-origin: bottom; animation: flap-close .56s ease-in var(--delay) both; }
.flap-old-bottom { z-index: 2; animation: flap-clear 0s linear calc(var(--delay) + .56s) forwards; }
.flap-new-bottom { z-index: 4; transform-origin: top; animation: flap-open .64s cubic-bezier(.16,.7,.3,1) calc(var(--delay) + .56s) both; }
@keyframes flap-close { from { transform: rotateX(0); } to { transform: rotateX(-90deg); filter: brightness(.5); } }
@keyframes flap-open { from { transform: rotateX(90deg); filter: brightness(.5); } to { transform: rotateX(0); filter: brightness(1); } }
@keyframes flap-clear { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .terminal-cursor { animation: none; } .flap-old-top, .flap-old-bottom, .flap-new-bottom { display: none; } }
@media (max-width: 1000px) and (min-width: 821px) { .competition-entry { grid-template-columns: 1fr 1fr; gap: 1.8rem; } }
@media (max-width: 540px) { .terminal-output { padding: 1rem .75rem; } .terminal-bar, .terminal-footer { padding: .8rem .75rem; } .terminal-output table { font-size: .6rem; } }

.terminal-source-link { display: inline-block; margin-top: .75rem; color: #70c8f4; border-bottom: 1px solid #365768; font-size: .66rem; }
.terminal-board-section + .terminal-board-section { margin-top: 1.1rem; }
.terminal-confirm button { display: inline; background: none; border: 0; padding: 0; font: inherit; color: #e9e7e2; text-align: left; cursor: pointer; text-decoration: underline; text-decoration-color: #555550; text-underline-offset: .22em; }
.terminal-confirm button:hover { color: #70c8f4; }
.terminal-confirm button:disabled { opacity: .55; cursor: wait; }
.terminal-confirm button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.terminal-confirmation { margin-inline-start: var(--terminal-result-inset); }
.terminal-confirmation:empty { display: none; }

/* Personal's first photo ends at 1.2 / 2.2 of its grid minus its 2rem gap.
   Reuse that boundary exactly; put the description's breathing room inside it. */
@media (min-width: 821px) {
  .competition-entry { max-width: none; grid-template-columns: calc((100% - 2rem) * 6 / 11) minmax(0, 1fr); gap: 0; }
  .competition-copy { padding-right: 2rem; }
}

.terminal-copy { padding: 0; background: none; border: 0; color: #70c8f4; font: inherit; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.terminal-copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.terminal-copy-code { display: block; width: 100%; min-height: 12rem; padding: 1rem; background: var(--ink); color: #e9e7e2; font: .7rem/1.5 var(--mono); }

/* Reserve the complete board area before typing or API responses arrive. */
.terminal-output { height: 26rem; overflow: visible; }
.terminal-footer .terminal-copy { color: #70c8f4; text-decoration: underline; }

.terminal-heading { width: 100%; box-sizing: border-box; padding-inline-start: var(--terminal-result-inset); display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .6rem; min-width: 0; }
.terminal-heading .terminal-dot { flex: 0 0 5px; margin: 0; }
.terminal-heading .terminal-copy { margin-left: auto; font-size: .62rem; text-align: right; }
.terminal-bar .terminal-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }



/* A warm metallic highlight across the complete personal result rows. */
.terminal-yours { color: #fff0ad; background: rgba(245, 199, 72, .09); font-weight: 700; }
.terminal-yours .flap-card { --card-bg: #40331b; --card-line: #211a0d; }
.terminal-yours .flap-card > span > span { background: linear-gradient(110deg, #f4cf60 0%, #ffe89a 30%, #fffde0 45%, #ffffff 50%, #fff3b6 55%, #f5ce5b 75%, #ffe89a 100%); background-size: 250% 100%; background-clip: text; -webkit-background-clip: text; color: transparent; filter: drop-shadow(0 0 2px rgba(255, 219, 114, .45)); animation: leaderboard-gold-shine 6s ease-in-out infinite; }
@keyframes leaderboard-gold-shine { 0%, 25% { background-position: 100% 50%; } 65%, 100% { background-position: 0% 50%; } }
@media (prefers-reduced-motion: reduce) { .terminal-yours .flap-card > span > span { animation: none; background-position: 50% 50%; } }
