
/* ================= THE CONTACT MAP (contactslim.py) ===================== */
/* It sits where the enquiry form sat, in the wider of .cwrap's two
   columns, so the page keeps the proportions it already had. The height
   is a ratio rather than a number, so it is the same shape on a phone as
   on a desktop, and it stops growing past 560px on a tall window. */
html body .cmap{position:relative;border-radius:18px;overflow:hidden;
  background:rgba(255,255,255,.04);aspect-ratio:4 / 3;max-height:560px;}
html body .cmap-f{display:block;width:100%;height:100%;border:0;
  filter:saturate(.92);}
/* the link out, sitting on the map's own bottom edge rather than under
   it, so the panel reads as one object */
html body .cmap-go{position:absolute;left:14px;bottom:14px;
  display:inline-flex;align-items:center;gap:8px;
  padding:10px 16px 9px;border-radius:999px;
  background:#0b0f2e;color:#fff;text-decoration:none;
  font-size:13.5px;font-weight:700;letter-spacing:.2px;
  box-shadow:0 6px 20px rgba(0,0,0,.28);}
html body .cmap-go:hover{background:#141a4e;}
html body .cmap-go:focus-visible{outline:2px solid #00eecc;outline-offset:3px;}
@media (max-width:1080px){
  html body .cmap{aspect-ratio:3 / 2;}
}

/* Self-hosted pixel font for the arcade. Use on the website instead of Google Fonts.
   Press Start 2P, SIL Open Font License (fonts/OFL-LICENSE.txt). Path is relative to this file. */
@font-face{
  font-family:"Press Start 2P";
  src:url("/assets/puzzles/shared/fonts/press-start-2p-latin-400-normal.woff2") format("woff2");
  font-weight:400; font-style:normal; font-display:swap;
}

/* CE Arcade: shared styles for the Cornelius Puzzles and Challenges page.
   Everything is scoped under .cea. Layout: a hub of bento cards, and a game view
   that is the Santa game's bento (game tile two thirds, three info tiles one third).
   Hooks: --cea-height (desktop height of the game view), --cea-sans (body font). */

.cea{
  --deep:#0b0f2e; --navy:#1e2855; --panel:#141840; --panel-2:#1a2050; --line:#26306a;
  --aqua:#00eecc; --aqua-dk:#00a894; --sky:#3ec9ff; --grey:#b2b2b2; --ink:#c8cfe6; --white:#ffffff;
  --fault:#e0283c;
  --pixel:"Press Start 2P", ui-monospace, Menlo, monospace;
  --sans:var(--cea-sans, Gotham, "Helvetica Neue", Arial, system-ui, sans-serif);
  --gap:12px; --r:6px;
  color:var(--white); font-family:var(--sans); color-scheme:dark;
  display:grid; gap:var(--gap); outline:none;
}
.cea *, .cea *::before, .cea *::after{box-sizing:border-box}
.cea [hidden]{display:none!important}
.cea button{font:inherit}

/* bar above both views */
.cea-bar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}
.cea-crumbs{display:flex;align-items:center;gap:10px;min-width:0;font-family:var(--pixel);font-size:10px;line-height:1.5}
.cea-crumbs a{color:var(--grey);text-decoration:none}
.cea-crumbs a:hover{color:var(--white)}
.cea-crumbs b{font-weight:400;color:var(--aqua)}
.cea-bar-right{display:flex;align-items:center;gap:10px}

.cea-tile{background:var(--panel);border-radius:var(--r);box-shadow:inset 0 0 0 1px var(--line);padding:18px;min-width:0;min-height:0}
.cea-tile h2,.cea-tile h3{font-family:var(--pixel);font-weight:400;font-size:11px;line-height:1.4;margin:0;color:var(--aqua);display:flex;justify-content:space-between;align-items:baseline;gap:8px;letter-spacing:0;text-transform:none}
.cea-tile h2 span{font-size:8px;color:var(--grey)}

.cea-btn{font-family:var(--pixel)!important;font-size:10px;letter-spacing:.04em;line-height:1.3;padding:13px 16px;background:var(--aqua);color:var(--deep);border:0;border-radius:0;cursor:pointer;box-shadow:0 4px 0 var(--aqua-dk);transition:transform .08s;text-decoration:none;display:inline-block;text-align:center}
.cea-btn:active{transform:translateY(2px);box-shadow:0 2px 0 var(--aqua-dk)}
.cea-btn.ghost{background:transparent;color:var(--white);box-shadow:inset 0 0 0 2px var(--white)}
.cea-btn.small{font-size:8px;padding:9px 11px}
.cea-btn:disabled{opacity:.55;cursor:default}
.cea-icon-btn{font-family:var(--pixel)!important;font-size:8px;letter-spacing:.06em;line-height:1;background:transparent;color:var(--white);border:0;border-radius:0;box-shadow:inset 0 0 0 2px var(--line);padding:8px 10px;cursor:pointer}
.cea-icon-btn[aria-pressed="true"]{color:var(--aqua);box-shadow:inset 0 0 0 2px var(--aqua)}
.cea :focus-visible{outline:2px solid var(--white);outline-offset:3px}

/* ---------- hub ---------- */
.cea-hub{display:grid;gap:var(--gap)}
.cea-intro{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:var(--gap)}
.cea-intro .lead{display:grid;gap:10px;align-content:center;
  background:radial-gradient(ellipse 70% 80% at 0% 110%,rgba(0,238,204,.18),transparent 70%),radial-gradient(ellipse 55% 70% at 100% -10%,rgba(62,201,255,.14),transparent 70%),var(--panel)}
.cea-intro h1{font-family:var(--pixel);font-weight:400;font-size:clamp(16px,2.4vw,26px);line-height:1.45;margin:0;text-wrap:balance}
.cea-intro h1 em{font-style:normal;color:var(--aqua)}
.cea-intro p{margin:0;max-width:60ch;color:var(--ink);font-size:15px;line-height:1.6}
.cea-month{display:grid;gap:8px;align-content:center}
.cea-month .big{font-family:var(--pixel);font-size:clamp(14px,1.8vw,20px);line-height:1.4;color:var(--white)}
.cea-month .sub{font-size:13.5px;line-height:1.5;color:var(--ink);margin:0}
.cea-month .count{font-family:var(--pixel);font-size:9px;color:var(--aqua)}

.cea-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:var(--gap)}
.cea-card{display:grid;grid-template-rows:auto 1fr auto;gap:12px;padding:12px;text-decoration:none;color:inherit;position:relative;transition:box-shadow .15s}
.cea-card:hover{box-shadow:inset 0 0 0 1px var(--aqua)}
.cea-card .thumb{width:100%;aspect-ratio:4/3;background:var(--deep);border-radius:3px;display:block;image-rendering:pixelated}
.cea-card .meta{display:grid;gap:6px;padding:0 4px;align-content:start}
.cea-card h2{font-size:12px;color:var(--white)}
.cea-card p{margin:0;font-size:13.5px;line-height:1.5;color:var(--ink)}
.cea-card .row{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:0 4px 4px}
.cea-card .stat{font-family:var(--pixel);font-size:8px;line-height:1.7;color:var(--grey)}
.cea-card .stat b{font-weight:400;color:var(--white)}
.cea-card.wide{grid-column:1/-1;grid-template-columns:minmax(0,300px) minmax(0,1fr) auto;grid-template-rows:auto;align-items:center;gap:20px}
.cea-card.wide .thumb{aspect-ratio:2/1;height:100%;min-height:120px}
.cea-card.wide .row{flex-direction:column;align-items:flex-end;padding:0 8px 0 0}
@media (max-width:640px){.cea-card.wide{grid-template-columns:minmax(0,1fr);gap:12px}.cea-card.wide .row{flex-direction:row;align-items:center;padding:0 4px 4px}}
.cea-badge{position:absolute;top:20px;left:20px;font-family:var(--pixel);font-size:8px;padding:5px 7px;background:var(--aqua);color:var(--deep)}
.cea-badge.soon{background:var(--navy);color:var(--grey);box-shadow:inset 0 0 0 1px var(--line)}
.cea-card.locked{opacity:.7;pointer-events:none}

/* ---------- game view ---------- */
.cea-view{height:var(--cea-height, clamp(560px, calc(100svh - 150px), 860px));display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:var(--gap)}
.cea-game{position:relative;container-type:size;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:14px;overflow:hidden;
  background:radial-gradient(ellipse 70% 60% at 8% 105%,rgba(0,238,204,.20),transparent 70%),radial-gradient(ellipse 60% 55% at 100% -5%,rgba(62,201,255,.16),transparent 70%),var(--panel)}
.cea-screen-wrap{--ar:.75;--sw:min(calc(100cqw - 12px),calc((100cqh - 134px) * var(--ar)));width:var(--sw);display:grid;gap:8px}
.cea-stripe{height:10px;background:repeating-linear-gradient(-45deg,var(--aqua) 0 8px,transparent 8px 16px)}
.cea-hud{display:flex;justify-content:space-between;gap:8px;font-family:var(--pixel);font-size:8px;line-height:1.6;color:var(--grey);min-height:30px}
.cea-hud div{display:grid;gap:2px;min-width:0}
.cea-hud div:nth-child(2){text-align:center}
.cea-hud div:last-child{text-align:right}
.cea-hud b{font-weight:400;font-size:11px;color:var(--white);font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cea-screen{position:relative;width:100%;aspect-ratio:var(--ar);background:var(--deep);box-shadow:0 0 0 4px var(--navy),0 0 0 6px var(--aqua),0 22px 60px rgba(0,238,204,.16);touch-action:none;user-select:none;-webkit-user-select:none;overflow:hidden}
.cea-stage{position:absolute;inset:0}
.cea-stage canvas{display:block;width:100%;height:100%}
.cea-stage canvas.pixel{image-rendering:pixelated;image-rendering:crisp-edges}
.cea-under{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;width:max(100%,min(100cqw - 12px,440px));justify-self:center}
.cea-hint{font-family:var(--pixel);font-size:8px;line-height:1.9;color:var(--grey);margin:0;flex:1 1 150px;min-width:0}
.cea-ctrls{display:flex;gap:8px;flex:0 0 auto;margin-left:auto}
.cea-ov-col{display:grid;gap:10px;width:min(100%,240px)}
.cea-ov-col .cea-btn{width:100%;font-size:10px}
.cea .cea-overlay{overflow-y:auto;justify-content:flex-start}
.cea-overlay > :first-child{margin-top:auto}
.cea-overlay > :last-child{margin-bottom:auto}
.cea-overlay.cea-pause{background:rgba(11,15,46,.97)}
.cea-back{font-family:var(--pixel);font-size:8px;line-height:1.5;color:var(--grey);text-decoration:none;padding:12px 8px;letter-spacing:.04em}
.cea-back:hover{color:var(--white)}
.cea-mute{flex:0 0 auto;display:inline-flex;align-items:center;gap:8px;min-height:36px;padding:0 10px;font-family:var(--pixel)!important;font-size:8px;letter-spacing:.06em;line-height:1;background:transparent;color:var(--aqua);border:0;border-radius:0;box-shadow:inset 0 0 0 2px var(--line);cursor:pointer;-webkit-tap-highlight-color:transparent}
.cea-mute:hover{box-shadow:inset 0 0 0 2px var(--aqua)}
.cea-mute:focus-visible{outline:2px solid var(--aqua);outline-offset:2px}
.cea-mute[aria-pressed="true"]{color:var(--grey)}
.cea-mute svg{display:block;flex:0 0 auto}
.cea-hint .touch{display:none}
@media (pointer:coarse){.cea-hint .keys{display:none}.cea-hint .touch{display:inline}.cea-keys-only{display:none}}

.cea-overlay{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:16px;text-align:center;background:rgba(11,15,46,.88);z-index:5}
.cea-ov-title{font-family:var(--pixel);font-size:clamp(13px,3.4cqh,22px);line-height:1.5;margin:0;color:var(--white)}
.cea-ov-title em{font-style:normal;color:var(--aqua)}
.cea-ov-text{margin:0;max-width:32ch;font-size:14px;line-height:1.55;color:var(--ink)}
.cea-ov-small{font-family:var(--pixel);font-size:8px;line-height:1.8;color:var(--grey);letter-spacing:.04em;margin:0}
.cea-ov-score{font-family:var(--pixel);font-size:clamp(20px,5cqh,34px);color:var(--aqua);font-variant-numeric:tabular-nums}
.cea-modes{display:grid;gap:10px;width:min(100%,280px)}
.cea-mode{display:grid;gap:6px;padding:12px;background:var(--panel);box-shadow:inset 0 0 0 1px var(--line);text-align:left;cursor:pointer;border:0;color:var(--white)}
.cea-mode:hover{box-shadow:inset 0 0 0 2px var(--aqua)}
.cea-mode b{font-family:var(--pixel);font-weight:400;font-size:10px;color:var(--aqua)}
.cea-mode span{font-size:13px;line-height:1.4;color:var(--ink)}
.cea-save{display:flex;gap:8px;align-items:stretch;justify-content:center;flex-wrap:wrap;margin:0}
.cea-save label{font-family:var(--pixel);font-size:8px;color:var(--grey);width:100%}
.cea-initials{width:5.2em;font-family:var(--pixel)!important;font-size:16px;text-align:center;text-transform:uppercase;background:var(--deep);color:var(--white);border:0;border-radius:0;box-shadow:inset 0 0 0 2px var(--aqua);padding:8px 4px}
.cea-ov-row{display:flex;gap:8px;flex-wrap:wrap;justify-content:center}

.cea-side{display:grid;grid-template-rows:minmax(200px,1fr) auto minmax(0,auto);gap:var(--gap);min-height:0;min-width:0}
.cea-side > .cea-tile:last-child{overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--line) transparent}
.cea-lb-tile{display:flex;flex-direction:column;gap:12px}
.cea-tabs{display:flex;gap:6px}
.cea-tab{font-family:var(--pixel)!important;font-size:8px;line-height:1.3;padding:8px 9px;background:transparent;color:var(--grey);border:0;box-shadow:inset 0 0 0 1px var(--line);cursor:pointer}
.cea-tab[aria-selected="true"]{color:var(--deep);background:var(--aqua);box-shadow:none}
.cea-lb{list-style:none;margin:0;padding:0;display:grid;align-content:start;gap:2px;flex:1;min-height:0;overflow-y:auto}
.cea-lb li{display:grid;grid-template-columns:28px 1fr auto;gap:8px;align-items:center;padding:7px 10px;margin:0;background:rgba(30,40,85,.6);border-radius:3px;font-family:var(--pixel);font-size:10px;line-height:1.4;font-variant-numeric:tabular-nums;color:var(--white)}
.cea-lb li::before,.cea-lb li::marker{content:none}
.cea-lb li .rk{color:var(--grey)}
.cea-lb li.gold .rk{color:var(--aqua)}
.cea-lb li.you{box-shadow:inset 3px 0 0 var(--aqua);background:rgba(0,238,204,.10)}
.cea-lb li.empty{display:block;font-family:var(--sans);font-size:14px;line-height:1.5;color:var(--ink);background:transparent;padding:2px 0}
.cea-lb-note{margin:0;font-size:12px;line-height:1.5;color:var(--grey)}
.cea-points{display:grid;gap:7px;margin:12px 0 0}
.cea-points div{display:flex;justify-content:space-between;align-items:center;gap:12px;font-size:13.5px;line-height:1.4;color:var(--ink)}
.cea-points dt{margin:0;font-weight:400}
.cea-points dd{margin:0;font-family:var(--pixel);font-size:9px;color:var(--white);white-space:nowrap;text-align:right}
.cea-rules{margin:12px 0 0;padding-left:18px;display:grid;gap:5px;font-size:13.5px;line-height:1.45;color:var(--ink)}
.cea-rules li{margin:0}

@media (max-width:820px){
  .cea-intro{grid-template-columns:minmax(0,1fr)}
  .cea-view{height:auto;grid-template-columns:minmax(0,1fr)}
  .cea-game{container-type:inline-size;padding:14px 12px 16px}
  .cea-screen-wrap{--sw:min(calc(100cqw - 12px),max(240px,calc((100svh - 330px) * var(--ar))))}
  .cea-side{grid-template-rows:auto}
  .cea-lb{overflow:visible}
}
@media (prefers-reduced-motion:reduce){.cea-btn,.cea-card{transition:none}}
@media (max-width:420px){.cea-points div{flex-wrap:wrap;justify-content:flex-start;column-gap:12px;row-gap:2px}.cea-points dd{white-space:normal;text-align:left}}


/* ===== Puzzles and Challenges (arcade.py) ===== */
/* THE PAGE AROUND THE ARCADE, which is all this is. Everything
   inside .cea is the engine's own and is not touched here, with the
   two exceptions named below.
   A SLIM BAND, for the reason santa.py gives: every pixel the title
   takes is a pixel off the game screen, and the top padding has to
   clear two fixed bars rather than one. The nav runs to 128px and
   the capabilities rail sits under it from 138 to 186. */
html body .ar-top{padding:200px 0 20px;}
html body .ar-top .ar-row{display:flex;align-items:flex-end;
  justify-content:space-between;gap:28px;flex-wrap:wrap;}
html body .ar-top .pill{margin-bottom:12px;}
html body .ar-top h1{font-family:'Gotham','Inter',Arial,sans-serif;
  font-weight:900;text-transform:uppercase;letter-spacing:-1.1px;
  font-size:clamp(26px,3.2vw,40px);line-height:1.04;margin:0;color:#fff;}
html body .ar-top .ind-a{color:var(--aqua,#00eecc);}
html body .ar-top p{margin:0;max-width:52ch;
  font-size:14.5px;line-height:1.6;color:rgba(255,255,255,.66);}
html body .ar-wrap{padding:0 0 96px;}

/* EXCEPTION ONE: NO SITE PADDING INSIDE THE ARCADE. The game page
   lost its leaderboard tile to exactly this, and the arcade has it
   one level down. The engine lays out its hub and its game view as
   <section> elements with no padding of their own, and this site
   gives every section 96px top and bottom. Measured on the built
   page: .cea-view came out 590px tall with 192 of that padding, so
   the game had 398 to live in and the stage shrank to 206px across.
   The hub's .cea-intro went the same way.
   THE RULE EXCLUDES TILES BY NAME, which is the part worth reading
   twice. A blanket `section` rule inside the arcade would also
   outrank .cea-tile's own 18px and strip every tile in the place,
   and naming .cea-view and .cea-intro by hand goes stale the first
   time the engine grows a third view. Every section the engine
   draws is either a tile, which brings its own padding, or a layout
   wrapper, which wants none. The first attempt aimed at direct
   children of the root and fixed the game view and not the hub,
   because .cea-intro sits one level further in. */
html body .ar-wrap .cea{padding:0;margin:0;}
html body .ar-wrap .cea section:not(.cea-tile){padding:0;}
/* EXCEPTION TWO: the height hook the engine publishes for the page
   to set. Same arithmetic as the game page. */
html body .ar-wrap .cea{--cea-height:clamp(560px, calc(100svh - 310px), 860px);}

/* EXCEPTION THREE: THE ARCADE'S OWN TITLE COMES OFF. The engine
   opens its hub with a lead card carrying an h1 reading PUZZLES AND
   CHALLENGES and a paragraph saying what the monthly challenge is.
   On its own demo page that is the page title. Here the site shell
   has already said both, 150px higher up, so the page carried the
   same sentence twice and, worse, two h1 elements, which is invalid
   and splits what a search engine thinks the page is about.
   MINE STAYS AND THE ENGINE'S GOES, because the engine builds every
   pixel of itself in JavaScript: a crawler reading the markup finds
   the site's band and nothing else, so the h1 that survives has to
   be the one that is actually in the document.
   The month card beside it stays and runs the full width. It is the
   one thing on that row a reader cannot get anywhere else: which
   month's boards are live and how long is left. */
html body .ar-wrap .cea-intro{display:none;}

/* EXCEPTION FOUR: SANTA GOES TO THE TOP AND GETS THE ROOM. Matt:
   "Can we make santa the top main feature - ditch 'November' for
   now." The engine puts link cards after the games, as a wide strip
   174px tall at the foot of the hub, which is right when the games
   are the point and wrong in December.
   AND THE ENGINE NEEDS TELLING, since 7 November. With nineteen games
   in four columns the last row has a gap in it, and the new engine
   fills that gap with the link card, dropping the `wide` class that
   everything below keys on. `data-links="feature"` on the arcade root
   keeps it full width whatever the count. It comes off in January with
   the four rules under this comment.
   ORDER, NOT A REBUILD. The card is already a grid item spanning
   the full row, so order:-1 moves it above the four without
   touching links.js or the engine, and it goes back to the bottom
   by deleting four lines in January.
   AND IT IS GIVEN THE SIZE OF A FEATURE, because a card at the top
   that is a third the height of the ones under it reads as a
   leftover rather than as the headline. The picture takes nearly
   half the width at 16:9, the heading is the size of the page's own
   section headings rather than the 12px the small cards use, and
   the whole thing is about the height of one game card. */
html body .ar-wrap .cea-cards > .cea-card.wide{
  order:-1;grid-template-columns:minmax(0,46%) minmax(0,1fr) auto;
  gap:26px;padding:16px;}
html body .ar-wrap .cea-card.wide .thumb{aspect-ratio:16 / 9;
  height:auto;min-height:0;}
html body .ar-wrap .cea-card.wide .meta{gap:10px;}
html body .ar-wrap .cea-card.wide h2{font-size:19px;line-height:1.35;}
html body .ar-wrap .cea-card.wide p{font-size:15.5px;line-height:1.55;}
html body .ar-wrap .cea-card.wide .cea-badge{font-size:9px;}
@media (max-width:640px){
  html body .ar-wrap .cea-cards > .cea-card.wide{
    grid-template-columns:minmax(0,1fr);gap:12px;}
  html body .ar-wrap .cea-card.wide h2{font-size:15px;}
}

@media (max-width:820px){
  /* THE PHONE OFFSET IS READ OFF subnav.py's TOKENS, not typed.
     It was 150px, measured against a rail that ran to 127. Then the
     Christmas hours went into the contact row, xmas.py moved
     --snav-top by the height of that row exactly as it should, the
     rail went to 157 and the eyebrow pill printed 5px into it. A
     literal cannot track a header that changes, and this one now
     changes twice a year. */
  html body .ar-top{padding:calc(var(--snav-top, 84px) + var(--snav-h, 52px) + 26px) 0 20px;}
  html body .ar-top .ar-row{display:block;}
  html body .ar-top p{margin-top:14px;}
  html body .ar-wrap{padding:0 0 72px;}
}
