:root {
  color-scheme: dark;
  --ink: #10101e;
  --cream: #f5eee6;
  --muted: #a4a3b6;
  --line: #ffffff15;
  --gold: #f2d095;
  --accent: #8fe6db;
  font-family: Arial, Helvetica, sans-serif;
}
.card-slide[data-slot="5"] .card-art{filter:brightness(.95)}
.card-slide[data-slot="5"] .card-symbols{visibility:hidden}
.card-slide[data-slot="5"] .game-card{border-color:#e9ca8388;box-shadow:inset 0 0 0 2px #f2d09512,0 0 25px #f2d09508}
.card-slide[data-slot="5"] .game-card::before{background:linear-gradient(#0b122218,#0b122208 28%,#0b12224a 58%,#0b1222d9 79%,#0b1222fc 100%)}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html {
  min-width: 280px;
  background: #0b0c15;
}
body {
  margin: 0;
  color: var(--cream);
}
button,
select,
input {
  font: inherit;
  color: inherit;
}
button {
  border: 0;
  cursor: pointer;
  background: none;
  touch-action: manipulation;
}
button:disabled {
  cursor: default;
  opacity: 0.55;
}
button:focus-visible,
select:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 50% 0, #38304b55, transparent 55%),
    radial-gradient(ellipse at 0 90%, #26575822, transparent 50%), #0b0c15;
}
.collection {
  display: grid;
  grid-template-columns: minmax(0, 520px);
  justify-content: center;
  min-height: calc(100 * var(--funky-vh, 1dvh));
}
.portrait {
  width: 100%;
  background: #121322;
  min-height: calc(100 * var(--funky-vh, 1dvh));
  box-shadow: 0 0 80px #0005;
  position: relative;
  overflow: hidden;
}
.collection-header {
  height: calc(66px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 22px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}
.collection-header img {
  width: 78px;
  height: 58px;
  object-fit: contain;
}
.header-name {
  font-size: 9px;
  letter-spacing: 2px;
  line-height: 1.5;
  max-width: 94px;
}
.star-pill {
  margin-left: auto;
  border: 1px solid #f2d09530;
  border-radius: 30px;
  padding: 10px 14px;
  background: #f2d0950c;
  color: var(--gold);
  font-size: 13px;
  min-height: 42px;
}
.star-pill span {
  margin-right: 4px;
}
.eyebrow {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 2.6px;
  color: var(--gold);
  line-height: 1.6;
  margin: 0 0 12px;
}
.launcher-title {
  padding: 24px 24px 16px;
}
.launcher-title h1 {
  font-family: Georgia, serif;
  font-weight: 400;
  font-size: 28px;
  letter-spacing: -0.7px;
  margin: 0;
}
.launcher-title .eyebrow {
  margin-bottom: 5px;
}
#carousel {
  overflow: hidden;
  padding: 0 20px;
  touch-action: pan-y;
}
#track {
  display: flex;
  transition: transform 0.28s cubic-bezier(0.2, 0.75, 0.2, 1);
  gap: 0;
}
.card-slide {
  flex: 0 0 100%;
  padding: 0 3px;
}
.game-card {
  position: relative;
  overflow: hidden;
  min-height: clamp(320px, calc(61 * var(--funky-vh, 1dvh)), 600px);
  border: 1px solid #ffffff25;
  border-radius: 26px;
  background: #1c1b2d;
  display: flex;
  flex-direction: column;
  padding: 24px 23px;
  isolation: isolate;
  box-shadow: inset 0 0 0 4px #ffffff03;
}
.card-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  filter: brightness(0.7);
}
.game-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    #11142228,
    #10152238 32%,
    #101422e8 70%,
    #101422 100%
  );
}
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card-top img {
  width: 48px;
  height: 30px;
  object-fit: contain;
}
.card-tag {
  border: 1px solid #ffffff25;
  border-radius: 20px;
  padding: 7px 9px;
  font-size: 8px;
  letter-spacing: 1.4px;
}
.game-logo {
  height: clamp(80px, calc(16 * var(--funky-vh, 1dvh)), 156px);
  max-width: 100%;
  object-fit: contain;
  margin: 20px auto 0;
  filter: drop-shadow(0 8px 18px #0007);
}
.card-symbols {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: auto 0;
  color: var(--theme);
  font:
    42px Georgia,
    serif;
  text-shadow: 0 0 25px currentColor;
}
.card-symbols span {
  display: grid;
  place-items: center;
  border: 1px solid #ffffff20;
  border-radius: 14px;
  width: 58px;
  height: 64px;
  background: #0f1a2655;
  transform: rotate(-8deg);
}
.card-symbols span:nth-child(2) {
  transform: translateY(-6px) rotate(4deg);
}
.card-symbols span:nth-child(3) {
  transform: rotate(12deg);
}
.game-card h2 {
  font:
    24px Georgia,
    serif;
  letter-spacing: -0.4px;
  margin: 14px 0 7px;
}
.game-card p {
  color: #d0cfd8;
  font-size: 12px;
  line-height: 1.6;
  margin: 0 0 16px;
}
.card-footer {
  margin-top: auto;
}
.record-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 9px;
  letter-spacing: 1.1px;
  color: #aaaec0;
}
.record-line b {
  font-size: 20px;
  font-weight: 400;
  color: var(--gold);
  letter-spacing: 0;
}
.play-button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 14px;
  min-height: 52px;
  padding: 14px 18px;
  background: linear-gradient(120deg, #f3dcb5, #d6ae74);
  color: #171923;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.5px;
  box-shadow: 0 5px 20px #edc79015;
}
.play-button span {
  font-size: 24px;
  font-weight: 400;
}
.soon .card-symbols {
  font-size: 74px;
  opacity: 0.35;
  font-family: Georgia, serif;
}
.soon .game-card {
  background:
    radial-gradient(ellipse at 40% 30%, #66618840, transparent 70%), #1c1b2d;
}
.soon .play-button {
  background: #ffffff0a;
  color: #c5c1d1;
}
.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 13px 20px 0;
}
.carousel-controls > button {
  height: 44px;
  width: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 21px;
  color: var(--gold);
}
#dots {
  display: flex;
  gap: 0;
  align-items: center;
}
#dots button {
  width: 21px;
  height: 40px;
  padding: 8px;
  display: grid;
  place-items: center;
}
#dots button::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 100%;
  background: #706d81;
}
#dots button[aria-current="true"]::before {
  width: 7px;
  height: 7px;
  background: var(--gold);
  box-shadow: 0 0 10px #f2d09560;
}
.browse-note {
  display: flex;
  justify-content: space-between;
  padding: 8px 25px 15px;
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.6px;
}
.browse-note span:first-child {
  color: var(--gold);
}
.bottom-nav {
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-around;
  padding: 9px 18px calc(9px + env(safe-area-inset-bottom));
}
.bottom-nav button {
  display: grid;
  gap: 5px;
  min-width: 76px;
  min-height: 45px;
  font-size: 8px;
  letter-spacing: 1.4px;
  color: var(--muted);
}
.bottom-nav span {
  font-size: 19px;
  color: #d9d2c8;
}
.side-panel {
  display: none;
}
.side-panel h2 {
  font:
    32px/1.2 Georgia,
    serif;
  font-weight: 400;
  letter-spacing: -0.8px;
}
.side-brand {
  width: 130px;
  height: 90px;
  object-fit: contain;
  margin-bottom: 15px;
}
.muted {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
}
.journey-box {
  margin: 30px 0;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.journey-box strong {
  font:
    30px Georgia,
    serif;
  color: var(--gold);
}
.journey-box p {
  font-size: 11px;
  color: var(--muted);
}
.progress-track {
  height: 3px;
  background: #ffffff15;
  border-radius: 5px;
  overflow: hidden;
}
.progress-track i {
  height: 100%;
  display: block;
  background: var(--gold);
}
.mission-row {
  font-size: 12px;
  line-height: 2.2;
  color: var(--muted);
}
.mission-row .done {
  color: #9de4ce;
}
.quiet {
  padding: 12px 0;
  font-size: 12px;
  color: var(--gold);
  min-height: 44px;
}
.panel-footer {
  font-size: 10px;
  letter-spacing: 2px;
  line-height: 2.4;
  color: #646174;
  margin-top: 60px;
}
.pb {
  font:
    44px Georgia,
    serif;
  color: var(--gold);
  margin: 10px 0 24px;
}
.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.stat-row b {
  color: var(--cream);
  font-weight: 400;
}
.game-header {
  height: 50px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  gap: 8px;
  background: #121321;
}
.game-header button {
  min-height: 44px;
  min-width: 44px;
  color: var(--gold);
  font-size: 20px;
}
.game-header button span {
  font-size: 11px;
}
.game-header > span {
  font-size: 11px;
  letter-spacing: 0.7px;
}
#frame-host {
  height: calc(calc(100 * var(--funky-vh, 1dvh)) - 116px - env(safe-area-inset-top));
  position: relative;
}
iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #0d1720;
}
#loading {
  position: absolute;
  inset: calc(66px + env(safe-area-inset-top)) 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: #111321;
  z-index: 3;
}
#loading p {
  font:
    22px Georgia,
    serif;
}
#loading button {
  min-height: 44px;
  color: var(--gold);
}
.loading-star {
  font-size: 50px;
  color: var(--gold);
  animation: breath 1.8s ease-in-out infinite;
}
@keyframes breath {
  50% {
    opacity: 0.3;
    transform: scale(0.9);
  }
}
#modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: #070812df;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-card {
  width: min(100%, 450px);
  max-height: calc(90 * var(--funky-vh, 1dvh));
  overflow: auto;
  border: 1px solid #f2d09530;
  border-radius: 24px;
  background: linear-gradient(145deg, #242237, #131625);
  padding: 35px 26px 28px;
  position: relative;
  box-shadow: 0 15px 80px #0006;
}
#close-modal {
  position: absolute;
  right: 12px;
  top: 8px;
  width: 44px;
  height: 44px;
  font-size: 28px;
  color: var(--muted);
}
.modal-card h2 {
  font:
    28px Georgia,
    serif;
  font-weight: 400;
  margin: 4px 0 20px;
}
.modal-card h3 {
  font-size: 12px;
  font-weight: 400;
  color: var(--gold);
  letter-spacing: 1px;
}
.modal-card p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
}
.modal-card .play-button {
  margin: 10px 0;
}
.pause-actions {
  display: grid;
  gap: 4px;
}
.pause-actions button:not(.play-button) {
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 46px;
  text-align: left;
  padding: 12px 16px;
  font-size: 13px;
}
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  font-size: 13px;
}
.setting-row button {
  min-width: 66px;
  min-height: 40px;
  border: 1px solid #ffffff20;
  border-radius: 30px;
  padding: 9px 15px;
  color: var(--gold);
}
select {
  background: #1c2134;
  border: 1px solid #ffffff25;
  border-radius: 9px;
  padding: 10px;
  min-height: 42px;
}
.score-filter {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.score-filter select {
  max-width: 100%;
  flex: 1;
}
.score-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.score-item small {
  color: var(--muted);
  font-size: 10px;
}
.achievement-row {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 13px;
  align-items: center;
}
.achievement-row .seal {
  font-size: 22px;
  color: var(--gold);
}
.achievement-row.locked {
  opacity: 0.4;
}
.achievement-row strong {
  font-size: 12px;
  letter-spacing: 1px;
}
.achievement-row p {
  font-size: 11px;
  margin: 5px 0 0;
}
.mission-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 15px 0;
}
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  transform: translate(-50%, 15px);
  max-width: min(420px, calc(90 * var(--funky-vw, 1vw)));
  width: max-content;
  background: #2d2a3e;
  color: #f7eadb;
  border: 1px solid #f2d09540;
  border-radius: 14px;
  padding: 14px 19px;
  font-size: 12px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  z-index: 40;
  transition:
    opacity 0.2s,
    transform 0.2s;
}
#toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.reduced-motion * {
  animation: none !important;
  transition: none !important;
}
body.playing .collection-header {
  display: none;
}
body.playing .game-header{height:calc(50px + env(safe-area-inset-top));padding-top:env(safe-area-inset-top)}
body.playing #frame-host{height:calc(calc(100 * var(--funky-vh, 1dvh)) - 50px - env(safe-area-inset-top))}
.game-header > span{margin-right:auto;text-align:center;flex:1}
#game-name{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;letter-spacing:.2px;font-size:clamp(10px,calc(2.7 * var(--funky-vw, 1vw)),12px);font-weight:600;line-height:1.2}
.card-footer h2{font-size:clamp(18px,calc(5 * var(--funky-vw, 1vw)),24px);line-height:1.15}
@container funky-viewport (max-width:380px){.game-header #home span{display:none}.game-header{gap:4px;padding-left:6px;padding-right:6px}}
.guide-button{display:block;margin:4px auto 0;min-height:44px;color:var(--gold);font-size:12px}
.howto-goal{color:var(--cream)!important;font-size:12px!important;line-height:1.5!important}
.howto-steps{padding-left:22px;margin:14px 0}
.howto-steps li{padding-left:4px;margin:10px 0;color:var(--gold);font-size:12px}
.howto-steps p,.howto-tip{font-size:12px!important;line-height:1.5!important;margin:4px 0!important}
.howto-steps strong{color:var(--cream)}
.howto-tip{padding:10px;border:1px solid var(--line);border-radius:10px}
.modal-card:has(.howto){padding:32px 20px 18px;max-height:calc(calc(100 * var(--funky-vh, 1dvh)) - 24px)}
#modal:has(.howto){padding:12px}
.modal-card:has(.howto) h2{font-size:22px;margin-bottom:10px;padding-right:15px}
.modal-card:has(.howto) #modal-content > .eyebrow{display:none}
.howto .play-button{min-height:44px;margin-bottom:0;font-size:12px;padding:8px 12px}
@container funky-viewport (max-height:720px){.modal-card:has(.howto){padding:30px 16px 14px}.howto-steps li{margin:6px 0}.howto-steps{margin:10px 0}.howto-tip{padding:8px}}
@container funky-viewport (min-width: 1100px) {
  .collection {
    grid-template-columns: 230px minmax(0, 480px) 230px;
    gap: clamp(30px, calc(4 * var(--funky-vw, 1vw)), 75px);
    padding: 0 30px;
  }
  .side-panel {
    display: block;
    padding-top: 70px;
  }
  .portrait {
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
  }
}
@container funky-viewport (max-height: 720px) {
  .launcher-title {
    padding-top: 16px;
    padding-bottom: 12px;
  }
  .game-card {
    min-height: max(300px, calc(calc(100 * var(--funky-vh, 1dvh)) - 244px));
    padding: 17px;
  }
  .game-logo {
    height: 85px;
    margin-top: 10px;
  }
  .game-card h2 {
    font-size: 20px;
    margin-top: 8px;
  }
  .game-card p {
    margin-bottom: 7px;
    font-size: 11px;
  }
  .card-symbols {
    font-size: 25px;
    min-height: 35px;
  }
  .card-symbols span {
    height: 43px;
    width: 43px;
  }
  .record-line {
    padding: 8px 0;
  }
  .play-button {
    min-height: 46px;
  }
  .carousel-controls {
    padding-top: 7px;
  }
  .browse-note {
    padding-bottom: 10px;
  }
  .collection-header {
    height: 56px;
  }
  .game-header {
    height: 48px;
  }
  #frame-host {
    height: calc(calc(100 * var(--funky-vh, 1dvh)) - 104px - env(safe-area-inset-top));
  }
  .launcher-title h1 {
    font-size: 25px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
@container funky-viewport (max-height:850px){
 .collection-header{height:calc(56px + env(safe-area-inset-top))}
 .launcher-title{padding:14px 24px 12px}
 .launcher-title h1{font-size:25px}
 .game-card{min-height:max(300px,calc(calc(100 * var(--funky-vh, 1dvh)) - 278px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));padding:16px 20px}
 .game-logo{height:80px;margin-top:8px}
 .card-symbols{font-size:26px;min-height:35px}
 .card-symbols span{width:40px;height:43px}
 .game-card h2{font-size:20px;margin:8px 0 5px}
 .game-card p{font-size:11px;line-height:1.4;margin-bottom:6px}
 .record-line{padding:8px 0}
 .game-card .play-button{min-height:46px;padding:10px 14px}
 .guide-button{margin-top:0}
 .carousel-controls{padding-top:7px}
 .browse-note{padding-bottom:8px}
}
@container funky-viewport (max-height:680px){.game-card{padding:12px 16px}.game-logo{height:65px}.card-symbols{display:none}.launcher-title{padding-top:10px;padding-bottom:10px}}
.shadow-card-progress{display:flex;justify-content:space-between;align-items:center;font-size:8px;letter-spacing:1px;color:#b9aec9;margin:-3px 0 10px}.shadow-card-progress b{font-size:10px;color:var(--gold)}
/* Mind Matrix: geometric cover owns its symbols; Collection controls stay shared. */
.card-slide[data-slot="2"] .card-symbols{visibility:hidden}
.card-slide[data-slot="2"] .game-card{border-color:#e8c98e99}
.card-slide[data-slot="2"] .card-art{filter:brightness(.85);object-position:50% 43%}
