/* Glyphwood games: Quill's Lost Letters, Tansy's Shortcuts, Quill's Night Flight, the Field Journal and /play/. */

.play-note { text-align: center; color: #E9D9B8; max-width: 640px; margin: 26px auto 0; }
.play-note a { color: var(--glow); }

/* ---------- game shell ---------- */
.game-wrap { padding: 40px 0 70px; }
.game-start { max-width: 640px; margin: 0 auto; text-align: center; }
.start-mascot { display: block; width: 150px; height: 150px; margin: -10px auto 4px; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .3)); }
.game-board, .quest-end { scroll-margin-top: 92px; }
.game-board { position: relative; max-width: 1040px; margin: 0 auto; padding: 18px; border-radius: 14px; color: var(--ink);
  background: var(--grain), radial-gradient(ellipse at 50% 30%, #FAEFD3, var(--parchment) 60%, var(--parchment-2));
  box-shadow: 0 0 0 3px #7A4A0E, 0 0 0 6px #E9B949, 0 18px 30px rgba(0, 0, 0, .45); }
.game-prompt { font: 600 19px/1.45 var(--sans); margin: 0; }
.prompt-bar { display: flex; gap: 14px; align-items: baseline; margin-bottom: 12px; }
.round-count { flex: none; font: 700 13px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: #8A5A1A; }
.map-frame { position: relative; border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 2px #B98A4A, 0 4px 10px rgba(0, 0, 0, .2); background: #BFD8D6; }
.map-frame svg { display: block; width: 100%; height: auto; }
.map-fact { min-height: 10px; margin-top: 12px; }
.map-fact p { margin: 0 0 10px; font-size: 17px; }
.yes { color: #1E6E3E; font-weight: 700; }
.no { color: #8A2214; font-weight: 700; }
.linkish { background: none; border: 0; padding: 8px 0; font: 700 15px var(--sans); color: #8A4A0E; text-decoration: underline; cursor: pointer; }
.icon-btn { width: 46px; height: 46px; border-radius: 50%; border: 2px solid #B98A4A; background: #FFF6DC; font-size: 22px; cursor: pointer; }
.icon-btn[aria-pressed="true"] { opacity: .6; }
.game-board .choice { color: #FFF4DC; }

/* ---------- Quill's Lost Letters ---------- */
.letter-tray { display: flex; gap: 18px; align-items: center; margin-bottom: 14px; }
.tray-text { flex: 1; display: flex; gap: 12px; align-items: center; }
.tray-text .game-prompt { flex: 1; font-size: 20px; }
.tray-tools { display: flex; flex-direction: column; gap: 8px; }
.envelope { position: relative; flex: none; width: 150px; height: 104px; border-radius: 6px; background: linear-gradient(#FFF8E6, #F0DDB0); box-shadow: 0 6px 12px rgba(0, 0, 0, .25), inset 0 0 0 2px #C9A46A; }
.envelope::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom right, transparent 49%, rgba(185, 138, 74, .45) 50%, transparent 51%), linear-gradient(to bottom left, transparent 49%, rgba(185, 138, 74, .45) 50%, transparent 51%); background-size: 100% 60%; background-repeat: no-repeat; }
.envelope .stamp { position: absolute; right: 8px; top: 8px; width: 70px; height: 80px; padding: 4px; background: #FFFDF5; border: 3px dotted #C88A1E; display: grid; grid-template-rows: auto 1fr; justify-items: center; }
.stamp-emoji { font-size: 26px; line-height: 1; }
.stamp-shape { width: 100%; height: 100%; }
.stamp-shape path { fill: #2E8F5A; }
.envelope .seal { position: absolute; left: 22px; bottom: 16px; width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #E86A50, #A3301C 70%); }
.envelope.arrive { animation: drift-in .7s cubic-bezier(.2, .9, .3, 1.2); }
.envelope.wobble { animation: wobble .5s; }
.envelope.fly { animation: fly-off 1s ease-in forwards; }
.envelope.boat-card { display: grid; place-items: center; background: linear-gradient(#DFF4F6, #A9D6DE); }
.envelope.boat-card::before { display: none; }
.boat-emoji { font-size: 58px; animation: bob 2s ease-in-out infinite; }
@keyframes drift-in { from { transform: translate(-60px, -40px) rotate(-20deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes wobble { 20% { transform: rotate(-8deg); } 40% { transform: rotate(7deg); } 60% { transform: rotate(-5deg); } 80% { transform: rotate(3deg); } }
@keyframes fly-off { to { transform: translate(120px, 80px) scale(.3) rotate(25deg); opacity: 0; } }
@keyframes bob { 50% { transform: translateY(-6px) rotate(4deg); } }
.world-map .sea, .us-map .sea { fill: #BFD8D6; }
.world-map .land, .world-map .land-plain { fill: #E8D3A2; stroke: #E8D3A2; stroke-width: 1.2; stroke-linejoin: round; }
.world-map .land { cursor: pointer; transition: fill .3s; }
.world-map .land:focus { outline: none; }
.world-map .land.hint { animation: glowland 1.1s ease-in-out infinite; }
.world-map [data-id="north-america"] { fill: #F2C38B; stroke: #F2C38B; }
.world-map [data-id="south-america"] { fill: #A8D58F; stroke: #A8D58F; }
.world-map [data-id="europe"] { fill: #C9B3E6; stroke: #C9B3E6; }
.world-map [data-id="africa"] { fill: #F4D86B; stroke: #F4D86B; }
.world-map [data-id="asia"] { fill: #F2A5A0; stroke: #F2A5A0; }
.world-map [data-id="australia"] { fill: #F0B26B; stroke: #F0B26B; }
.world-map [data-id="antarctica"] { fill: #F4F8FB; stroke: #F4F8FB; }
.world-map .land:hover, .world-map .land:focus { filter: brightness(1.08) drop-shadow(0 0 4px rgba(255, 255, 255, .9)); }
.world-map .land.found { filter: drop-shadow(0 0 2px #C88A1E) drop-shadow(0 0 7px rgba(255, 209, 90, .9)); }
@keyframes glowland { 50% { fill: #FFD15A; stroke: #FFD15A; } }
.marks .drop circle { fill: #FFF8E6; stroke: #C88A1E; stroke-width: 3; }
.marks .drop { animation: pop .5s cubic-bezier(.2, .9, .3, 1.5); transform-box: fill-box; }
@keyframes pop { from { opacity: 0; } }
.ocean-btn { cursor: pointer; }
.ocean-btn rect { fill: rgba(255, 255, 255, .78); stroke: #2C7A8A; stroke-width: 2; }
.ocean-btn text { font: 700 17px var(--sans); fill: #1F5A66; }
.ocean-btn:hover rect, .ocean-btn:focus rect { fill: #fff; }
.ocean-btn.found rect { fill: #FFD15A; stroke: #C88A1E; }
.letter-progress { display: flex; gap: 8px; justify-content: center; list-style: none; padding: 0; margin: 14px 0 0; }
.letter-progress li { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #E6CD98; color: #8A6A3A; font-size: 17px; }
.letter-progress li.done { background: #2E8F5A; color: #fff; }
@media (max-width: 620px) {
  .letter-tray { flex-direction: column; align-items: stretch; }
  .envelope { align-self: center; }
  .tray-text .game-prompt { font-size: 18px; }
}

/* ---------- Tansy's Shortcuts ---------- */
.us-map .state { fill: #EAD7A8; stroke: #9C7A48; stroke-width: 1; stroke-linejoin: round; cursor: pointer; transition: fill .2s; }
.us-map .state:hover { fill: #F7E7BC; }
.us-map .state.highlight { fill: #F2C14E; }
.us-map .state.right { fill: #8CCB7E; }
.us-map .state.wrong { fill: #E99A86; }
.pin circle { fill: #FFF8E6; stroke: #8A4A0E; stroke-width: 2.5; }
.pin.from circle { fill: #F7C99A; stroke: #B4461E; }
.pin.to circle { fill: #8A4A0E; stroke: #FFF8E6; }
.pin.star path { fill: #C88A1E; stroke: #5A3A0C; stroke-width: 1; }
.pin.star circle { display: none; }
.pin-label { font: 800 17px var(--sans); fill: #3A2410; paint-order: stroke; stroke: #FFF8E6; stroke-width: 5px; stroke-linejoin: round; }
.trail { stroke: #B4461E; stroke-width: 4; stroke-dasharray: 10 7; stroke-linecap: round; }
.trail.good { stroke: #1E6E3E; }
.map-rose circle { fill: rgba(255, 248, 230, .85); stroke: #8A5A1A; stroke-width: 2; }
.map-rose path { fill: #C88A1E; stroke: #5A3A0C; }
.map-rose .n { fill: #8A2214; }
.map-rose text { font: 800 16px var(--sans); fill: #3A2410; }
.game-board.shortcuts { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 0 20px; align-items: start; }
.game-board.shortcuts .prompt-bar { grid-column: 1 / -1; }
.game-board.shortcuts .side { position: sticky; top: 96px; }
.game-board.shortcuts .choices { grid-template-columns: 1fr; }
@media (max-width: 860px) { .game-board.shortcuts { grid-template-columns: 1fr; } .game-board.shortcuts .side { position: static; } }
.answer-area { margin-top: 14px; display: flex; justify-content: center; }
.answer-area .choices { margin: 0; width: 100%; }
.hint-line { margin: 0; font-weight: 700; color: #8A5A1A; }
.compass-pick { position: relative; width: 230px; height: 230px; border-radius: 50%; background: radial-gradient(circle, #FFF8E6 0 38%, #F3E3BF 39% 100%); box-shadow: inset 0 0 0 3px #C88A1E, 0 6px 14px rgba(0, 0, 0, .2); }
.compass-pick .dir { --a: 0deg; position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px; border-radius: 50%; border: 0; cursor: pointer;
  transform: rotate(var(--a)) translateY(-84px) rotate(calc(-1 * var(--a))); font: 800 16px var(--sans); color: #fff;
  background: linear-gradient(#5BD38A, #2E9A5A 55%, #1E6E3E); box-shadow: 0 0 0 2.5px #2A1404, 0 4px 0 1px #2A1404; }
.compass-pick .dir:nth-child(even) { width: 46px; height: 46px; margin: -23px; font-size: 14px; background: linear-gradient(#9A6436, #6B4022 60%, #4A2B12); }
.compass-pick .d1 { --a: 45deg; } .compass-pick .d2 { --a: 90deg; } .compass-pick .d3 { --a: 135deg; } .compass-pick .d4 { --a: 180deg; }
.compass-pick .d5 { --a: 225deg; } .compass-pick .d6 { --a: 270deg; } .compass-pick .d7 { --a: 315deg; }
.compass-pick .dir:hover { filter: brightness(1.12); }
.compass-pick .dir.wrong { background: #C8402A; }
.compass-pick .dir.right { background: #F2C14E; color: #3A2410; }
.rose-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 34px; }

/* ---------- Quill's Night Flight ---------- */
.flight-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.map-frame.night { background: radial-gradient(ellipse at 40% 30%, #22305C, #121A36 75%); }
.night-chart .grid line { stroke: rgba(242, 193, 78, .22); stroke-width: 1; }
.night-chart .scale-bar rect { fill: #F2C14E; } .night-chart .scale-bar rect.alt { fill: #FFF4C2; }
.night-chart .scale-bar text, .night-chart .north text { font: 700 15px var(--sans); fill: #FFE7A8; }
.night-chart .north path { fill: #FFE7A8; }
.night-chart .station .glow { fill: rgba(255, 209, 90, .18); stroke: rgba(255, 209, 90, .5); }
.night-chart .station circle:not(.glow) { fill: #6A5A3A; }
.night-chart .station.lit circle:not(.glow) { fill: #FFD15A; filter: drop-shadow(0 0 6px #FFD15A); }
.night-chart .station.target .glow { animation: beacon-r 1.6s ease-in-out infinite; }
.night-chart .station text { font: 700 14px var(--sans); fill: #FFF4DC; paint-order: stroke; stroke: #121A36; stroke-width: 4px; }
.night-chart .home circle:not(.glow) { fill: #6FE39A; }
@keyframes beacon-r { 50% { fill: rgba(255, 209, 90, .45); } }
.night-chart .trails line { stroke-width: 3; stroke-linecap: round; }
.night-chart .trails .flown { stroke: #FFD15A; }
.night-chart .trails .missed { stroke: #FF8A6A; stroke-dasharray: 6 6; }
.night-chart .preview { stroke: #8FE3FF; stroke-width: 2.5; stroke-dasharray: 8 6; }
.night-chart .protractor circle { fill: rgba(143, 227, 255, .06); stroke: rgba(143, 227, 255, .6); }
.night-chart .protractor line { stroke: rgba(143, 227, 255, .7); }
.night-chart .protractor text { font: 700 12px var(--sans); fill: #BDEFFF; }
.night-chart .quill { transition: transform .8s ease-in-out; }
.night-chart .quill circle { fill: #FFF4DC; stroke: #C88A1E; stroke-width: 3; }
.flight-controls label { display: block; font: 800 17px var(--sans); margin: 4px 0 6px; }
.flight-controls label small { display: block; font-weight: 400; font-size: 14px; color: var(--ink-soft); }
.bearing-row { display: flex; gap: 6px; align-items: center; margin-bottom: 12px; }
.bearing-row input { width: 96px; font: 700 22px var(--sans); padding: 8px 10px; border: 0; border-bottom: 2px solid #8A5A1A; border-radius: 6px 6px 0 0; background: #FFF6DC; }
.bearing-row .unit { font-weight: 700; }
.nudge { min-width: 44px; height: 44px; border-radius: 10px; border: 2px solid #B98A4A; background: #FFF6DC; font: 700 15px var(--sans); cursor: pointer; }
.fly-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.question-box .q { font-weight: 700; margin: 4px 0 10px; }
.question-box .choices { grid-template-columns: 1fr; margin: 0 0 10px; }
.how { background: #FFF6DC; border-radius: 8px; padding: 6px 14px; margin-top: 6px; }
.how p { margin: 8px 0; font-size: 16px; }
@media (max-width: 860px) { .flight-layout { grid-template-columns: 1fr; } }

/* ---------- glyphs, the end-of-quest scroll, the Field Journal ---------- */
.unit-glyph .ug-disc { fill: #F6E8C2; stroke: #B98A4A; stroke-width: 1.5; stroke-dasharray: 3 3; }
.unit-glyph .ug-shape { fill: #F6E8C2; stroke: #9C7A48; stroke-width: 2; stroke-linejoin: round; }
.unit-glyph.earned .ug-disc { fill: #24503F; stroke: #E9B949; stroke-width: 3; stroke-dasharray: none; }
.unit-glyph.earned .ug-shape { fill: rgba(255, 217, 138, .25); stroke: #FFD98A; stroke-width: 2.4; filter: drop-shadow(0 0 3px #FFD15A); color: #FFD98A; }
.quest-end { max-width: 720px; margin: 0 auto; text-align: center; }
.glyph-reveal { display: grid; place-items: center; margin: -6px 0 6px; animation: crestin .9s cubic-bezier(.2, .9, .25, 1.4); }
.glyph-reveal svg { filter: drop-shadow(0 0 18px rgba(255, 209, 90, .7)); }
.atlas-note { margin-top: 18px; }
.flight-log { max-width: 420px; margin: 10px auto; border-radius: 10px; overflow: hidden; background: #121A36; }
.flight-log svg { display: block; width: 100%; height: auto; }
.journal-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 24px 0; }
.journal-slot { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 14px 8px; border-radius: 10px; border: 2px dashed #C9A46A; }
.journal-slot.got { border-style: solid; border-color: #C88A1E; background: rgba(255, 246, 220, .6); }
.journal-slot strong { margin-top: 6px; font-size: 16px; }
.journal-slot span { font-size: 14px; color: var(--ink-soft); }
.journal-slot em { font-size: 13px; margin-top: 4px; color: #8A5A1A; }
@media (max-width: 720px) { .journal-grid { grid-template-columns: repeat(2, 1fr); } }

@media print {
  .site-head, .site-foot, .actions, .linkish, .atlas-note, .kicker { display: none !important; }
  .flight-log { max-width: 100%; }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.play-crumb { margin: -10px 0 18px; color: #E9D9B8; }
.play-crumb a { color: var(--glow); }
.game-board .choice.wrong, .game-board .choice:disabled:not(.right) { opacity: .45; text-decoration: line-through; }
.game-board .choice.right { box-shadow: 0 0 0 3px #F2C14E, 0 0 16px rgba(255, 209, 90, .8); }
.night-chart { overflow: hidden; }
.world-map .hits circle { fill: transparent; cursor: pointer; }
.world-map .marks { pointer-events: none; }
@media (max-width: 620px) {
  .prompt-bar { flex-direction: column; gap: 4px; }
  .game-prompt { font-size: 17px; }
  .game-board { padding: 12px; }
}

/* ---------- roomier on desktop: use the width, but keep each map fully on screen ---------- */
.game-wrap .wrap { max-width: 1440px; }
.game-board { max-width: 1360px; }
#letters .map-frame { max-width: max(320px, calc((100vh - 300px) * 2)); margin: 0 auto; }
.game-board.shortcuts { grid-template-columns: minmax(0, 1fr) 310px; }
.game-board.shortcuts .map-frame { width: 100%; max-width: max(320px, calc((100vh - 220px) * 1.61)); justify-self: center; }
.flight-layout { grid-template-columns: minmax(0, 1fr) 360px; }
.flight-layout .map-frame { width: 100%; max-width: max(300px, calc((100vh - 210px) * .96)); justify-self: center; }
@media (min-width: 1100px) {
  .game-prompt { font-size: 20px; }
  .tray-text .game-prompt { font-size: 22px; }
  .envelope { width: 180px; height: 124px; }
  .envelope .stamp { width: 84px; height: 96px; }
  .compass-pick { width: 260px; height: 260px; }
  .compass-pick .dir { transform: rotate(var(--a)) translateY(-96px) rotate(calc(-1 * var(--a))); }
}
@media (max-width: 860px) {
  .game-board.shortcuts, .flight-layout { grid-template-columns: 1fr; }
}

/* ---------- /play/ quest tiles (grow by adding to GAMES in build_site.py) ---------- */
.quest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; margin: 36px 0 10px; }
.quest-tile { position: relative; display: flex; flex-direction: column; overflow: hidden; border-radius: 12px; text-decoration: none; color: var(--ink);
  background: var(--grain), radial-gradient(ellipse at 50% 30%, #FAEFD3, var(--parchment) 60%, var(--parchment-2));
  box-shadow: 0 0 0 3px #7A4A0E, 0 0 0 6px #E9B949, 0 12px 22px rgba(0, 0, 0, .45); transition: transform .25s, box-shadow .25s; }
a.quest-tile:hover, a.quest-tile:focus-visible { transform: translateY(-5px); box-shadow: 0 0 0 3px #7A4A0E, 0 0 0 6px #FFD15A, 0 0 26px rgba(255, 209, 90, .55), 0 16px 26px rgba(0, 0, 0, .45); }
.tile-art { aspect-ratio: 16 / 10; border-bottom: 3px solid #C88A1E; }
.tile-art svg { display: block; width: 100%; height: 100%; }
.tile-body { display: flex; flex-direction: column; flex: 1; padding: 14px 16px 16px; }
.tile-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 6px; }
.chip { font: 700 12px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: #8A5A1A; }
.earned-chip { display: none; font: 700 12px var(--sans); color: #1E6E3E; }
.quest-tile.earned .earned-chip { display: inline; }
.quest-tile h2 { font-size: 22px; margin: 0 0 6px; }
.quest-tile p { font-size: 15px; color: var(--ink-soft); margin: 0 0 10px; }
.tile-foot { margin-top: auto !important; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px !important; }
.play-link { font: 800 16px var(--display); color: #1E6E3E; white-space: nowrap; }
.quest-tile.soon { opacity: .92; }
.soon-art { display: grid; place-items: center; background: repeating-linear-gradient(45deg, rgba(185, 138, 74, .14) 0 12px, transparent 12px 24px), #EAD7A8; }
.soon-art span { font: 800 18px var(--display); color: #8A5A1A; border: 2px dashed #B98A4A; border-radius: 30px; padding: 8px 18px; }
.quest-tile.soon .play-link { color: #8A4A0E; text-decoration: none; }
.hall-sec .lede a { color: var(--glow); }
