@font-face {
  font-family: E1234;
  src: url('./assets/E1234.ttf') format('truetype');
  font-display: swap;
}

:root {
  color: #4c575b;
  color-scheme: light;
  font: 16px/1.35 Arial, Helvetica, sans-serif;
  --cyan: #47c4ea;
  --edge: #aeb3b6;
  --lines: repeating-linear-gradient(0deg, #8093980b 0 1px, transparent 1px 4px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: #dedfe1; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid #00749d; outline-offset: 4px; }
.sr-only { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (hover: hover) and (pointer: fine) {
  .screen { cursor: url('./assets/wii-hand.png') 16 2, default; }
  .screen button:not(:disabled), .screen canvas { cursor: url('./assets/wii-hand.png') 16 2, pointer; }
}

#wii, .screen { min-height: 100svh; }
#wii { position: relative; isolation: isolate; }
.menu {
  --menu-width: min(83vw, 146svh);
  --menu-gap: clamp(6px, 1.3svh, 15px);
  --slot-height: 19.3svh;
  position: relative;
  background: var(--lines), radial-gradient(ellipse at 50% 45%, #f9f9f9, #e7e7e7 93%);
  overflow: hidden;
}

.channel-stage { position: absolute; top: 8.4%; left: 50%; transform: translateX(-50%); width: var(--menu-width); }
.channel-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--menu-gap); }
.channel-slot {
  position: relative;
  display: block;
  min-width: 0;
  height: var(--slot-height);
  padding: 0;
  overflow: hidden;
  border: clamp(2px, .22vw, 4px) solid #b0b1b2;
  border-radius: clamp(9px, 1.58svh, 23px);
  background: #fcfcfc;
  box-shadow: 0 1px 2px #26262615, inset 0 0 0 1px #ffffff;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}
.channel-slot:is(:hover, :focus-visible):is(button) {
  z-index: 2;
  border-color: #58c8e9;
  box-shadow: 0 0 0 2px #a3e9ff, 0 3px 10px #36a0c35c;
  transform: scale(1.028);
}
.channel-slot:active:is(button) { transform: scale(.988); }
.channel-slot.empty {
  background:
    repeating-linear-gradient(0deg, #e9e9eb33 0 1px, #fff0 2px 4px),
    repeating-linear-gradient(0deg, #b4b8bc0c 0 1px, transparent 1px 7px),
    radial-gradient(ellipse at center, #ededee, #e3e4e5 73%, #dbdde0);
}
.channel-slot.empty::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, transparent 38%, #fafaff25 55%, #c0c6cf30 61%, transparent 82%);
  animation: tv-roll 5.8s linear infinite;
}
.channel-slot.empty:nth-child(3n)::before { animation-delay: -1.75s; }
.channel-slot.empty:nth-child(3n + 1)::before { animation-delay: -3.7s; }
.channel-slot.empty::after { content: ''; position: absolute; inset: 0; background: linear-gradient(160deg, #fff9 0%, #fff2 27%, transparent 44%); pointer-events: none; }
@keyframes tv-roll { from { transform: translateY(-97%); } to { transform: translateY(94%); } }
.next-page { animation: slide-left 210ms ease-out; }
.previous-page { animation: slide-right 210ms ease-out; }
@keyframes slide-left { from { opacity: .4; transform: translateX(5%); } }
@keyframes slide-right { from { opacity: .4; transform: translateX(-5%); } }

.page-arrow {
  position: absolute;
  z-index: 3;
  top: 50%;
  transform: translateY(-50%);
  width: max(38px, 6vw);
  height: max(49px, 9vh);
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
}
.page-next { left: calc(100% + .05vw); }
.page-previous { right: calc(100% + .05vw); }
.page-arrow i { width: clamp(19px, 3vw, 43px); height: clamp(31px, 5.3vw, 70px); position: relative; }
.page-arrow i::before, .page-arrow i::after { content: ''; position: absolute; inset: 0; clip-path: polygon(7% 0, 96% 50%, 7% 100%, 20% 50%); }
.page-arrow i::before { background: #249acc; }
.page-arrow i::after { inset: 3px 4px; background: linear-gradient(90deg, #9beaff, #4ec6eb 80%); }
.page-previous i { transform: scaleX(-1); }
.page-arrow:hover i::after { background: #c0f4ff; }

.menu-clock {
  position: absolute;
  z-index: 2;
  top: 72.5%;
  left: 50%;
  transform: translateX(-50%);
  color: #8a8d8f;
  font: 400 clamp(33px, 10svh, 112px)/1 E1234, monospace;
  letter-spacing: .015em;
  text-shadow: 0 1px #fff9;
  white-space: nowrap;
}
.dock { position: absolute; inset: 72.7% 0 0; display: grid; justify-items: center; pointer-events: none; }
.dock-rim {
  --curve: polygon(0% 0%, 13% 0%, 15.5% 1%, 18% 4%, 20.5% 9%, 23% 16%, 25.5% 24%, 28% 31%, 30.5% 37%, 33% 40%, 36% 41%, 64% 41%, 67% 40%, 69.5% 37%, 72% 31%, 74.5% 24%, 77% 16%, 79.5% 9%, 82% 4%, 84.5% 1%, 87% 0%, 100% 0%, 100% 100%, 0% 100%);
  position: absolute;
  inset: 0;
  clip-path: var(--curve);
  background: linear-gradient(#46bcdf, #a5e0f1 50%, #b6bdc9 95%);
}
.dock-rim::after {
  content: '';
  position: absolute;
  inset: clamp(2px, .42svh, 5px) 0 0;
  clip-path: var(--curve);
  background: linear-gradient(#c4c8cc 0%, #e9e9ea 39%, #dfe0e2 68%, #c8cad2);
}
.dock time {
  position: absolute;
  z-index: 1;
  top: 44%;
  color: #73767a;
  font-weight: 700;
  font-size: clamp(20px, 6.7svh, 68px);
  letter-spacing: .015em;
  white-space: nowrap;
  text-shadow: 0 1px #f9f9fa90;
}
.dock-pocket {
  pointer-events: auto;
  position: absolute;
  top: 44%;
  width: min(20vw, 25svh);
  height: min(21svh, 18vw);
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #c4c7cd;
  background: linear-gradient(145deg, #bfc4cb, #eef0f2 46%, #d9dbe2 66%, #c4c6cf);
  box-shadow: inset 0 2px 6px #f8fbff91, 0 2px 3px #737b9128;
  transform: translateY(-50%);
}
.dock-left { left: 0; border-radius: 0 120px 120px 0; justify-items: end; padding-right: min(2.3vw, 2vh); }
.dock-right { right: 0; border-radius: 120px 0 0 120px; justify-items: start; padding-left: min(2.3vw, 2vh); }
.orb {
  width: min(16.6svh, 15vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: clamp(1.5px, .43svh, 5px) solid #54c8eb;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #f9f9fa, #d0d3d8 81%);
  box-shadow: inset 0 1px 4px #fff, 0 1px 5px #696f7d45;
}
.dock-pocket:hover .orb, .dock-pocket:focus-visible .orb { border-color: #51d7ff; box-shadow: 0 0 9px #66d7ff, inset 0 1px 5px #fff; }
.wii-word { color: #919598; font-size: clamp(22px, min(4.9vw, 6.2svh), 63px); font-weight: 700; letter-spacing: -.1em; text-indent: -.045em; }
.envelope {
  width: 55%;
  height: 38%;
  position: relative;
  border-radius: 5%;
  background: #93989d;
}
.envelope::after { content: ''; position: absolute; inset: 0; background: #e4e5e8; clip-path: polygon(0 4%, 50% 48%, 100% 4%, 100% 12%, 50% 57%, 0 12%); }

.disc-art, .parc-art { position: absolute; inset: 0; display: block; overflow: hidden; isolation: isolate; }
.disc-art { background: linear-gradient(170deg, #fff 12%, #f5f6f6 70%, #e9eeee); }
.disc {
  position: absolute;
  top: 50%;
  left: 50%;
  height: 76%;
  aspect-ratio: 1;
  border: 2px solid #c3c8c9;
  border-radius: 50%;
  background: conic-gradient(#dadcdd, #f7f8f8, #cbd1d3 29%, #aeb5b8 45%, #eceef0 65%, #dce1e2 82%, #c9cdce);
  box-shadow: inset 0 0 0 3px #fefefe9c;
  transform: translate(-50%, -50%);
}
.disc::after { content: ''; position: absolute; inset: 38%; border: 2px solid #f4f5f5; border-radius: 50%; background: radial-gradient(#fafafa 30%, #c8cfd0 34%, #e8edee 62%, #fff 69%); }
.disc-small { height: 51%; opacity: .35; left: 61%; top: 55%; }
.parc-art { background: #f0f8f7; }
.parc-sky, .parc-orbit { position: absolute; inset: 0; pointer-events: none; }
.parc-sky {
  background:
    radial-gradient(ellipse at 68% 25%, #fff 15%, #fff0 71%),
    repeating-linear-gradient(0deg, #73b7b830 0 1px, transparent 1px 18px),
    repeating-linear-gradient(90deg, #78c1ac32 0 1px, transparent 1px 18px),
    linear-gradient(160deg, #eff7fc, #c2e4e3 72%, #add8c7);
}
.parc-orbit {
  inset: 41% -25% -44%;
  border-radius: 44%;
  border: 1.55em solid #fff5;
  transform: rotate(-10deg);
  box-shadow: 0 0 0 2px #fff4;
  animation: orbit 8s ease-in-out infinite alternate;
}
@keyframes orbit { to { transform: translateY(-14%) rotate(-13deg); } }
.parc-portraits { position: absolute; width: 100%; height: 100%; inset: 0; }
.parc-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(164deg, #fff9, transparent 34%), var(--lines); pointer-events: none; }
.parc-logo {
  position: absolute;
  z-index: 1;
  top: 44%;
  inset-inline: 0;
  text-align: center;
  font-size: min(3.1vw, 6.6svh);
  line-height: 1;
  font-weight: 750;
  letter-spacing: -.085em;
  color: #549873;
  text-shadow: 0 2px #fff, -1px 0 #fff, 1px 0 #fff, 0 -1px #fff, 0 3px 8px #506e575b;
  transform: translateY(0);
}
.parc-logo > span { color: #377687; }

.preview {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: clamp(14px, 3svh, 36px);
  padding: clamp(18px, 7svh, 77px) min(7vw, 8svh) clamp(21px, 7svh, 84px);
  background: var(--lines), linear-gradient(#f8f8f8, #e8eaed);
}
.banner {
  position: relative;
  isolation: isolate;
  min-height: 0;
  overflow: hidden;
  border: clamp(2px, .38vw, 6px) solid #b7bcc1;
  border-radius: clamp(18px, 4.7svh, 48px);
  background: #fdfdfd;
  box-shadow: 0 2px 10px #34485427;
}
.banner .parc-logo { top: 43%; font-size: min(17vw, 28svh); }
.banner .parc-orbit { border-width: 4.1em; }
.banner .parc-sky { background-size: auto, 32px 32px, 32px 32px, auto; }
.disc-message { position: absolute; width: 100%; text-align: center; bottom: 7%; font-size: clamp(19px, 4.2vw, 36px); font-weight: 700; color: #717981; }
.preview-controls { display: flex; justify-content: center; gap: clamp(12px, 3vw, 40px); }
.pill {
  min-height: 43px;
  padding: 6px 18px;
  border: 2px solid #a3c7d6;
  border-radius: 100px;
  background: linear-gradient(#fff 0%, #edf1f4 49%, #dfe6eb 50%, #f6f6f7 100%);
  box-shadow: inset 0 1px 1px #fff, 0 1px 3px #647e8830;
  line-height: 1.1;
  font-weight: 700;
  text-align: center;
}
.pill:hover:not(:disabled), .pill:focus-visible { border-color: #43bce5; box-shadow: 0 0 0 2px #9adcf4; }
.pill:disabled { opacity: .58; cursor: default; }
.preview-controls .pill { min-height: clamp(46px, 8svh, 84px); min-width: min(36vw, 315px); font-size: clamp(16px, 3.1svh, 34px); }

.system-dialog {
  width: min(450px, calc(100% - 24px));
  max-height: calc(100dvh - 25px);
  color: inherit;
  border: 3px solid #6ec7df;
  border-radius: 24px;
  background: linear-gradient(#fcfeff, #edf2f3);
  box-shadow: 0 8px 37px #101e3f58;
  padding: 21px;
}
.system-dialog::backdrop { background: #16272e6b; }
.system-dialog h2 { margin: 0 0 19px; font-size: 1.5rem; }
.system-dialog form { text-align: end; margin-top: 18px; }
.parc-access {
  width: min(540px, calc(100vw - 28px));
  max-height: calc(100svh - 28px);
}
.access-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border: 1px solid #a2c7d3;
  border-radius: 14px;
  background: linear-gradient(#e5f8fb, #f8fbfc);
}
.access-banner img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 5px #03657930;
}
.access-banner p { margin: 0 0 3px; font-size: .88rem; color: #216d86; }
.access-banner h2 { margin: 0; }
.town-preview { margin: 16px 0 0; border: 1px solid #a2c7d3; border-radius: 14px; overflow: hidden; background: #f8fbfc; }
.town-preview img { display: block; width: 100%; height: auto; }
.town-preview figcaption { padding: 7px 10px; color: #3d6071; font-size: .85rem; }
.access-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.access-choices .pill { display: grid; place-items: center; width: 100%; min-height: 48px; color: inherit; text-decoration: none; }
.access-choices p { margin: 7px 4px 0; font-size: .9rem; line-height: 1.35; }
@media (max-width: 440px) {
  .parc-access { padding: 14px; }
  .access-choices { grid-template-columns: 1fr; gap: 12px; }
}
.volume-control { display: grid; grid-template-columns: 72px 1fr; align-items: center; gap: 12px 7px; margin: 20px 0 14px; }
input[type="range"] { width: 100%; accent-color: #279cba; }
.system-link { display: inline-block; color: #176182; margin-top: 7px; }
.letter { padding: 14px; background: #fff; border: 1px solid #bed9e4; border-radius: 12px; }
.letter p { margin: 9px 0 0; }

.game {
  background: repeating-linear-gradient(0deg, #6ba7a015 0 1px, transparent 1px 25px), linear-gradient(#e8fafa, #c7e6d6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: clamp(12px, 2vw, 26px);
}
.game-bar { width: min(100%, 1270px, 157vh); display: flex; align-items: center; gap: 10px; }
.game-bar h2 { margin: 0 auto 0 2px; font-size: clamp(25px, 5.3vw, 56px); font-weight: 750; letter-spacing: -.085em; color: #327186; text-shadow: 0 2px #fff; }
.game-bar h2 span { margin-left: .15em; color: #4b8767; }
.game-world {
  width: min(100%, 1270px, 157vh);
  position: relative;
  overflow: hidden;
  border: 3px solid #79afaf;
  border-radius: clamp(14px, 2vw, 27px);
  box-shadow: 0 3px #d9f3e5, 0 5px 15px #3e7f7550;
  background: #b8dcc0;
}
#park { display: block; width: 100%; height: auto; touch-action: none; }
.game-score, .game-message {
  color: #285252;
  text-shadow: 0 1px #fff;
  background: #f8fff6e8;
  border: 1px solid #94bfa8;
  box-shadow: inset 0 1px #fff, 0 2px 5px #34726132;
  border-radius: 50px;
}
.game-score { position: absolute; top: 3%; left: 2%; padding: 4px 10px; font-size: clamp(15px, 2.6vw, 27px); letter-spacing: .09em; }
.game-score span { color: #ae6a08; }
.game-score .pending { color: #718675; }
.game-message { position: absolute; bottom: 4%; left: 50%; transform: translateX(-50%); margin: 0; padding: 5px 13px; font-size: clamp(13px, 2vw, 22px); font-weight: 700; text-align: center; white-space: nowrap; }
.game-replay { position: absolute; left: 50%; top: 49%; transform: translate(-50%, -50%); }
.game-hint { font-size: .86rem; margin: 0; text-align: center; color: #375a59; }
.picker-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.figure-option { border: 2px solid #a9c4cd; border-radius: 12px; padding: 4px 2px; background: #e8f4f8; }
.figure-option[aria-pressed="true"] { border-color: #22a9d4; background: #cdeaf3; }
.figure-option canvas { width: 100%; display: block; height: auto; }

@media (max-aspect-ratio: 1/1) {
  .menu { --menu-width: 87vw; --slot-height: 15vw; --menu-gap: 1.15vw; --grid-top: max(8%, calc(48% - 36vw)); }
  .channel-stage { top: var(--grid-top); }
  .menu-clock { top: calc(var(--grid-top) + 50vw); font-size: 11vw; }
  .dock { top: calc(var(--grid-top) + 49vw); isolation: isolate; }
  .dock-rim { bottom: auto; height: max(110px, 29vw); overflow: visible; }
  .dock-rim::after { background: linear-gradient(#d4d8db, #f2f2f4 93%); }
  .dock::after { content: ''; position: absolute; z-index: -1; inset: 101px 0 0; background: linear-gradient(#f2f2f4, #d6d7df); }
  .dock-pocket { top: 48px; width: 21vw; height: 68px; }
  .orb { width: 15vw; }
  .dock time { top: max(53px, 13vw); font-size: 6vw; }
  .page-previous { right: calc(100% - 3px); }
  .page-next { left: calc(100% - 3px); }
  .page-arrow { width: calc((100vw - var(--menu-width)) / 2 + 3px); }
  .page-arrow i::after { inset: 2px; }
  .preview { align-content: center; grid-template-rows: auto auto; gap: 24px; }
  .banner { aspect-ratio: 1.55; }
  .game-world { width: min(100%, 750px); }
  .game-bar { width: min(100%, 750px); gap: 6px; }
  .game-bar .pill { padding-inline: 10px; font-size: .78rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
