/* The wish list for Father Christmas (templates/wish.html, static/wish.js): the elf with a
   speech bubble and three large buttons, the list beside it, and the sheet that prints. */
.wish-page { padding-top: 14px; padding-bottom: 72px; }
.wish-play { display: grid; gap: 28px; align-items: start; }
.wish-list { background: var(--card); border: 1.5px solid var(--line); border-radius: 20px; padding: 20px; min-width: 0; }

/* On a phone the menu's links are left out on this page, so the game gets the screen (the owner,
   2026-11-12: "Så funkar det, de 24 dagarna etc. de kanske inte behöver visas i mobilen?"). The
   name, the other language and the footer's links are still there. */
@media (max-width: 619px) { body:has(.wish-page) > header.nav nav { display: none; } }

/* The game is a scene in the elves' workshop. Narrow: the room on top with the elf on its floor,
   and under it the questions on a card, on the colour of the floor boards, which the picture
   fades into. The picture covers the room and is anchored at the bottom edge, where its lowest
   quarter is floor, so the elf stands on the boards at any width. */
/* The box's height before the script has measured it: the screen less the menu, which is about
   110 pixels at every width. The script's number differs by a few pixels at most, so the card
   does not jump when the page loads (the owner, 2026-11-12: "hoppar när man laddar om"). */
.wish-game { --wish-room-first: max(430px, calc(100dvh - 110px)); }
.wish-game { --floor: #F4DFB2; position: relative; display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 0 12px 12px; border-radius: 20px; overflow: hidden; background: var(--floor); min-height: var(--wish-room, var(--wish-room-first)); justify-content: space-between; }
.wish-elf { position: relative; display: flex; justify-content: center; align-items: flex-end; flex: none; height: clamp(150px, 28dvh, 320px); margin: 0 -12px; padding-bottom: 22px; }
.wish-room-back { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 100%; -webkit-mask-image: linear-gradient(to bottom, #000 80%, transparent); mask-image: linear-gradient(to bottom, #000 80%, transparent); }
.wish-elf [data-wish-elf] { position: relative; display: block; width: auto; height: 74%; filter: drop-shadow(0 5px 4px rgba(90, 60, 30, 0.28)); }
/* The elf's list and what it says, on one card. */
.wish-card { position: relative; display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 16px; border: 1.5px solid var(--line); border-radius: 18px; background: rgba(255, 253, 248, 0.96); box-shadow: 0 3px 14px rgba(90, 60, 30, 0.2); }
.wish-game .wish-open { position: absolute; z-index: 1; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 6px; background: #FFFFFF; }
.wish-open-big { margin: 0; text-align: center; }
.wish-open-big .btn { display: inline-flex; align-items: center; gap: 8px; }
.wish-open-big [hidden] { display: none; }
/* As the start page's pause button (`.motion-toggle`): see-through until it is pointed at or
   reached with the keys (the owner, 2026-11-12), and wholly see-through in the middle ("ska den
   inte vara helt transparent i mitten?"). */
.wish-game .wish-wide { display: none; position: absolute; z-index: 1; top: 44px; right: 10%; width: 44px; height: 44px; padding: 0; align-items: center; justify-content: center; border: 1.5px solid var(--muted); border-radius: 50%; background: transparent; color: var(--ink-soft); cursor: pointer; }
.wish-game .wish-wide:hover, .wish-game .wish-wide:focus-visible { background: var(--card); color: var(--ink); border-color: var(--ink); }
.wish-game .wish-wide:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.wish-game .wish-open[hidden], .wish-game.wish-full .wish-open { display: none; }
.wish-close { position: absolute; z-index: 1; top: 10px; right: 10px; width: 48px; height: 48px; border: 2px solid var(--ink); border-radius: 50%; background: #FFFFFF; color: var(--ink); font-size: 26px; line-height: 1; cursor: pointer; }
html.wish-open, html.wish-open body { overflow: hidden; }
/* A phone or a tablet while a round is played: the scene over the whole screen (the owner,
   2026-11-12: "på surfplatta / mobil tar det upp hela skärmen"). Nothing scrolls and the picture
   never moves ("hatar att det hoppar"). */
.wish-game.wish-full { position: fixed; inset: 0; z-index: 50; border-radius: 0; margin: 0; min-height: 0; overflow: hidden; overscroll-behavior: contain; }
/* A low phone: smaller pictures, so the seven kinds fit without the card scrolling. */
@media (max-height: 720px) and (max-width: 619px) {
  .wish-game.wish-full .wish-btn-art img { height: 40px; }
  .wish-game.wish-full .wish-btn-picture { padding: 4px 4px 6px; }
  .wish-game.wish-full .wish-left-text { display: none; }
  .wish-game.wish-full .wish-card { gap: 8px; padding: 12px; }
  .wish-game .wish-bubble { min-height: 0; padding: 12px 16px; font-size: 19px; }
}
/* On a phone the picture is behind everything and the card is fixed at the bottom, growing
   upwards with what it holds ("de börjar egentligen bara nedifrån bilden kan man säga och växer
   uppåt"). The elf stands on the card's top edge and rises with it, so he is never in the air
   and never behind the card. A card taller than the screen scrolls inside itself. */
@media (max-width: 619px) {
  /* The same before a round, on the page (the owner, 2026-11-12: "Nu är det i mobilvyn rätt
     tomt, kan inte bilden sträcka sig längre ner?"): the picture fills the whole box. */
  .wish-game { justify-content: flex-end; gap: 0; }
  .wish-game.wish-full { padding: 0 12px max(12px, env(safe-area-inset-bottom)); }
  .wish-game .wish-elf { position: static; height: auto; margin: 0 0 -12px 10px; padding: 0; justify-content: flex-start; }
  .wish-game .wish-room-back { -webkit-mask-image: none; mask-image: none; }
  .wish-game .wish-elf [data-wish-elf] { z-index: 2; height: clamp(104px, 19dvh, 170px); }
  .wish-game .wish-card { flex: 0 1 auto; min-height: 0; overflow-y: auto; padding-top: 20px; }
}
}
.wish-game.wish-full .wish-btn { min-height: 64px; font-size: 21px; }
/* With room for it the whole box is the workshop (the layout the owner liked in the sketch): the
   elf on the floor to the left and the card at the bottom right ("kan frågorna vara i botten av
   bilden"). The box has one height through the whole round. On the page the picture has no
   edge: it fades into the page on every side ("tona ut i bakgrunden, sådär mjukt"), and the elf
   and the card stand inside the part that is whole. */
@media (min-width: 620px) {
  .wish-game, .wish-game.wish-full { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, min(60%, 34rem)); align-items: end; gap: 20px; }
  .wish-game { height: var(--wish-room, var(--wish-room-first)); padding: 40px 9% 64px 12%; border-radius: 0; overflow: visible; background: transparent; }
  .wish-game.wish-full { height: auto; padding: 28px 5% max(28px, env(safe-area-inset-bottom)) 6%; overflow: hidden; background: var(--floor); }
  /* The elf stands a little way into the room, not at its edge (the owner, 2026-11-12: "kan
     inte nissen stå längre in i rummet"): towards the middle and up the floor, which is the
     picture's lowest quarter. */
  .wish-elf { position: static; flex: initial; height: auto; margin: 0 0 clamp(16px, 7dvh, 76px); padding: 0; justify-content: center; }
  .wish-elf [data-wish-elf] { width: min(100%, 215px); height: auto; }
  .wish-game:not(.wish-full) .wish-wide { display: inline-flex; }
  /* The edge is drawn by a small picture in this file: a rounded shape pushed about by noise
     and blurred (the owner, 2026-11-12: "Känns väldigt fyrkantigt, går det att göra så det
     är lite mjukt och mönstrat?"). */
  .wish-room-back { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 1000 600%22 preserveAspectRatio=%22none%22%3E%3Cfilter id=%22f%22 x=%22-15%25%22 y=%22-15%25%22 width=%22130%25%22 height=%22130%25%22%3E%3CfeTurbulence type=%22fractalNoise%22 baseFrequency=%220.011 0.016%22 numOctaves=%223%22 seed=%227%22/%3E%3CfeDisplacementMap in=%22SourceGraphic%22 scale=%2270%22/%3E%3CfeGaussianBlur stdDeviation=%229%22/%3E%3C/filter%3E%3Crect x=%2245%22 y=%2240%22 width=%22910%22 height=%22530%22 rx=%22150%22 filter=%22url%28%23f%29%22/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 1000 600%22 preserveAspectRatio=%22none%22%3E%3Cfilter id=%22f%22 x=%22-15%25%22 y=%22-15%25%22 width=%22130%25%22 height=%22130%25%22%3E%3CfeTurbulence type=%22fractalNoise%22 baseFrequency=%220.011 0.016%22 numOctaves=%223%22 seed=%227%22/%3E%3CfeDisplacementMap in=%22SourceGraphic%22 scale=%2270%22/%3E%3CfeGaussianBlur stdDeviation=%229%22/%3E%3C/filter%3E%3Crect x=%2245%22 y=%2240%22 width=%22910%22 height=%22530%22 rx=%22150%22 filter=%22url%28%23f%29%22/%3E%3C/svg%3E"); -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
  .wish-game.wish-full .wish-room-back { -webkit-mask-image: none; mask-image: none; }
  .wish-card, .wish-game.wish-full .wish-card { flex: initial; max-height: 100%; overflow-y: auto; padding: 20px; }
  .wish-game .wish-open { top: 48px; right: calc(10% + 58px); }
  /* The seven kinds in two rows, so that they fit the box's height. */
  .wish-game:not(.wish-full) .wish-pictures:not(.wish-ages) { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .wish-game:not(.wish-full) .wish-pictures:not(.wish-ages) .wish-btn-picture { font-size: 15px; padding: 6px 4px 8px; }
  .wish-game:not(.wish-full) .wish-pictures:not(.wish-ages) .wish-btn-art img { height: 66px; }
}
/* The elf's list: a strip of ruled paper that is as long as the wishes left are many. */
.wish-left { display: grid; gap: 4px; min-width: 0; }
/* Beside the elf where there is room: the elf to the left over both rows, its list and what it
   says to the right, across the whole box. */
.wish-paper { height: 22px; }
.wish-paper span { display: block; height: 100%; width: 100%; min-width: 18px; border: 2px solid var(--ink); border-radius: 4px; background: #FFFDF2 repeating-linear-gradient(90deg, transparent 0 10px, #C9BFA8 10px 12px); transition: width 0.7s ease; }
@media (prefers-reduced-motion: reduce) { .wish-paper span { transition: none; } }
.wish-left-text { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink-soft); }
.wish-talk { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.wish-count { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--green); }
/* The bubble has a border as well as a colour, and a tail towards the elf. */
.wish-bubble { position: relative; margin: 0; padding: 18px 20px; border: 2px solid var(--ink); border-radius: 18px; background: #FFFFFF; font-family: var(--serif); font-size: 22px; line-height: 1.3; overflow-wrap: anywhere; min-height: 4.2em; }
@media (min-width: 560px) {
  .wish-bubble { font-size: 26px; }
}

.wish-answers { display: flex; flex-wrap: wrap; gap: 10px; }
/* Four answers told apart by a mark as well as a colour: a tick, a cross, a wavy "about" and a
   question mark. */
/* Two to a row, so the four answers are a square. */
.wish-btn { flex: 1 1 40%; min-height: 60px; padding: 12px 18px; border: 2px solid var(--ink); border-radius: 16px; background: #FFFFFF; color: var(--ink); font: inherit; font-size: 20px; font-weight: 700; line-height: 1.2; cursor: pointer; overflow-wrap: anywhere; }
.wish-btn:hover { background: var(--paper); }
.wish-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.wish-btn-yes { background: var(--green); border-color: var(--green); color: #FFFFFF; }
.wish-btn-yes:hover { background: #3D5038; }
.wish-btn-no { background: var(--red); border-color: var(--red); color: #FFFFFF; }
.wish-btn-no:hover { background: var(--red-dark); }
.wish-btn-yes::before { content: '✓\00a0'; }
.wish-btn-no::before { content: '✕\00a0'; }
.wish-btn-partly::before { content: '≈\00a0'; }
.wish-btn-unknown::before { content: '?\00a0'; }
.wish-btn-unknown { border-style: dashed; }

/* Buttons with a picture: the ages and the kinds of thing, two to a row on a phone. The one in
   use has a thicker frame and a tick, not only a colour. */
.wish-pictures { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 132px), 1fr)); }
/* Over the whole screen of a phone: three to a row and a smaller elf, so that all seven kinds
   are there without scrolling. */
.wish-game.wish-full .wish-pictures { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.wish-btn-picture { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 0; padding: 8px 6px 10px; font-size: 17px; }
.wish-btn-art { display: flex; justify-content: center; gap: 2px; }
.wish-btn-art img { display: block; width: auto; height: 84px; }
/* The three ages are always one row, and the elves' sizes say the age as well as the words do
   (the owner, 2026-11-12: "lite svårt att se skillnad på 3-5 år och 6-8 år", "ska vi göra de
   mindre 3-5 år?"): small, middle and big, standing on the same line. The sizes are widths, so
   they differ as much on a narrow phone. */
.wish-ages { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.wish-ages .wish-btn-picture { justify-content: flex-end; padding: 8px 4px 10px; font-size: clamp(14px, 4.2vw, 17px); }
.wish-ages .wish-btn-art { align-items: flex-end; gap: 0; width: 100%; max-width: 168px; }
.wish-ages .wish-btn-art img { height: auto; width: 50%; }
.wish-ages .wish-age-small .wish-btn-art img { width: 30%; }
.wish-ages .wish-age-middle .wish-btn-art img { width: 40%; }
.wish-btn-chosen { border-width: 4px; }
.wish-btn-chosen > span:last-child::before { content: '✓\00a0'; }
.wish-game.wish-full .wish-btn-picture { min-height: 0; font-size: 15px; padding: 6px 4px 8px; }
.wish-game.wish-full .wish-btn-art img { height: 62px; }
.wish-typed { display: grid; gap: 8px; width: 100%; grid-column: 1 / -1; }
.wish-typed label, .wish-add label { font-weight: 700; }
.wish-typed input, .wish-add input, .wish-rows input, .wish-list .field input { width: 100%; min-width: 0; padding: 12px 14px; border: 1.5px solid var(--ink-soft); border-radius: 12px; background: #FFFFFF; color: var(--ink); font: inherit; }

.wish-list { display: flex; flex-direction: column; gap: 14px; }
/* The list is a box over the page; its padding keeps the heading clear of the cross. */
.wish-list { position: fixed; inset: 0; margin: auto; width: min(34rem, calc(100vw - 24px)); height: fit-content; max-height: calc(100dvh - 24px); overflow-y: auto; color: var(--ink); }
.wish-list:not([open]) { display: none; }
.wish-list::backdrop { background: rgba(43, 38, 32, 0.55); }
.wish-list h2 { padding-right: 56px; }
.wish-list h2 { margin: 0; font-size: 28px; }
.wish-rows { margin: 0; padding-left: 26px; display: flex; flex-direction: column; gap: 8px; }
.wish-rows li { padding-left: 4px; }
.wish-rows li::marker { font-weight: 700; color: var(--green); }
.wish-rows li > input { width: calc(100% - 52px); vertical-align: middle; }
.wish-remove { width: 44px; height: 44px; margin-left: 4px; border: 1.5px solid var(--line); border-radius: 12px; background: #FFFFFF; color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; vertical-align: middle; }
.wish-remove:hover { border-color: var(--red); color: var(--red); }
.wish-add { display: grid; gap: 6px; }
.wish-add-row { display: flex; gap: 8px; }
.wish-add-row input { flex: 1; }
.wish-clear { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.wish-text { margin-top: 28px; }
.wish-text h1 { margin: 0 0 12px; font-size: clamp(30px, 4.4vw, 44px); line-height: 1.1; }
.wish-text ol { padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.wish-text ol li { color: var(--ink-soft); }

/* The sheet is only for the printer. */
.wish-sheet { display: none; }
@media print {
  @page wish { size: A4 portrait; margin: 16mm; }
  body:has(.wish-page) > *:not(main), .wish-page > *:not(.wish-sheet) { display: none !important; }
  body:has(.wish-page)::before, body:has(.wish-page)::after { display: none !important; }
  /* The whole page is on the sheet's page, so no empty page of another size comes first. */
  body:has(.wish-page), body:has(.wish-page) main, .wish-page { page: wish; margin: 0 !important; padding: 0 !important; border: 0 !important; background: #FFFFFF; max-width: none; }
  .wish-sheet { display: block; color: #000000; text-align: center; }
  .wish-sheet-elf { width: 34mm; margin: 0 auto 4mm; }
  .wish-sheet-elf img { display: block; width: 100%; height: auto; }
  .wish-sheet h2 { margin: 0; font-family: var(--serif); font-size: 30pt; }
  .wish-sheet-from { margin: 2mm 0 0; font-family: var(--hand); font-size: 22pt; }
  .wish-sheet-greeting { margin: 8mm 0 6mm; font-size: 14pt; }
  .wish-sheet ol { margin: 0 auto; padding-left: 10mm; max-width: 140mm; text-align: left; font-size: 15pt; }
  .wish-sheet li { padding: 3mm 0 2mm; border-bottom: 0.3mm dashed #888888; overflow-wrap: anywhere; break-inside: avoid; }
  .wish-sheet li.wish-blank { height: 11mm; }
  .wish-sheet-foot { margin: 10mm 0 0; font-size: 9pt; color: #555555; }
}
