:root{
  --bg:#f7f7f7;
  --ink:#111;
  --muted:#555;
  --card:#fff;
  --border-color:#2d0b57;
  --shadow: 6px 6px 0 var(--border-color);
  --border: 3px solid var(--border-color);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background:var(--bg);
  color:var(--ink);
}

.container{
  max-width: 520px;
  margin: 0 auto;
  padding: 0 14px 14px;
}

.page-play .container,
.page-landing .container{
  min-height: calc(100svh - 64px);
  display: flex;
  flex-direction: column;
}

.page-play .cardbox,
.page-landing .cardbox{
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.page-play .bottom-stack,
.page-landing .bottom-stack{
  margin-top: auto;
}

.page-home{
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.page-home .container{
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 24px 24px;
}

.page-home .section{
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-top: 0;
  min-height: 0;
}

.page-home .cardbox{
  flex: 1;
  display: flex;
  flex-direction: column;
  box-shadow: none;
  min-height: 0;
}

.page-home .card-media{
  box-shadow: none;
}

.page-home .embla{
  flex: 1;
  min-height: 0;
}

.page-home .embla__viewport,
.page-home .embla__container,
.page-home .embla__slide{
  height: 100%;
}

.top{
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding: 0;
  border-bottom: 0;
  display: flex;
  justify-content: center;
}

.top__inner{
  max-width: 520px;
  margin: 0 auto;
  padding: 10px 0 2px;
  text-align: center;
  width: 100%;
}

.top__bar{
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.top__bar > div{
  margin: 0 auto;
}
.top__bar > .iconbtn{
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
}
.top__bar > .hamburger{
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}

.top--row{
  display:flex;
  gap:12px;
  align-items:center;
  text-align: left;
}

.hamburger{
  width: 35px;
  height: 35px;
  background: var(--card);
  border: 0;
  box-shadow: 0 6px 16px rgba(0,0,0,0.18);
  border-radius: 12px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transform: translateZ(0);
}
.hamburger:active{ transform: translateY(-50%); box-shadow: 0 6px 16px rgba(0,0,0,0.18); }

.menu-panel{
  position: fixed;
  top: 70px;
  right: 14px;
  z-index: 20;
  background: var(--card);
  border: var(--border);
  box-shadow: var(--shadow);
  border-radius: 14px;
  padding: 10px;
  min-width: 170px;
}
.menu-panel[hidden]{
  display: none !important;
}
.menu-link{
  display: block;
  width: 100%;
  text-align: left;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  border: var(--border);
  box-shadow: 4px 4px 0 var(--border-color);
  cursor: pointer;
}
.menu-link + .menu-link{
  margin-top: 8px;
}
.menu-link:hover{ background: #f1f1f1; }
.menu-label{
  margin: 10px 2px 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}
.menu-link--lang{
  font-weight: 700;
  box-shadow: none;
}
.menu-link--lang.is-active{
  background: var(--border-color);
  color: #fff;
}

.modal{
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
}
.modal[hidden]{
  display: none !important;
}
.modal__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.35);
}
.modal__panel{
  position: relative;
  width: min(520px, 92vw);
  max-height: 80svh;
  overflow: auto;
  scrollbar-gutter: stable;
  background: var(--card);
  border: var(--border);
  box-shadow: var(--shadow);
  border-radius: 16px;
  padding: 14px;
}
.modal__head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
}
.modal__title{
  font-weight: 900;
  font-size: 16px;
}
.modal__body{
  margin-top: 12px;
  display: grid;
  gap: 10px;
}
.about-text{
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.about-subhead{
  margin: 6px 0 0;
  font-size: 14px;
  font-weight: 900;
}
.about-media{
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.about-img{
  width: 100px;
  height: 100px;
  object-fit: contain;
  border-radius: 12px;
  border: var(--border);
  box-shadow: var(--shadow);
  display: block;
}
.about-list{
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.terms-text{
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.terms-subhead{
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 900;
}
.terms-list{
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.color-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.color-btn{
  padding: 12px;
  border: var(--border);
  box-shadow: 4px 4px 0 var(--border-color);
  border-radius: 12px;
  background: #fff;
  font-weight: 900;
  cursor: pointer;
  position: relative;
}
.color-btn::before{
  content: "";
  display: block;
  width: 100%;
  height: 18px;
  border-radius: 8px;
  background: var(--swatch);
  margin-bottom: 8px;
  border: 2px solid var(--border-color);
}

.brand{
  font-weight:900;
  letter-spacing: .5px;
  font-size: 18px;
}
.brand--sm{ font-size: 16px; }
.tagline{ color:var(--muted); font-size: 13px; }
.sep{ opacity:.6; padding:0 6px; }

.smallcap{
  font-size: 12px;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--muted);
}

.hero{ padding: 6px 0 10px; }
.section{ margin-top: 14px; }

.h1{ margin: 0; font-size: 22px; line-height: 1.15; }
.h2{ margin: 0 0 10px; font-size: 16px; }

.muted{ margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.home-instruction{
  margin: 0 0 10px;
  text-align: center;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  display: block;
  transform-origin: center;
  animation: hintPulse 2.2s ease-in-out infinite;
}

.home-instruction[hidden]{
  display: none !important;
  animation: none !important;
}

.page-play #hint,
.page-landing #hint{
  text-align: center;
  font-weight: 800;
  color: var(--ink);
  display: block;
  transform-origin: center;
  animation: hintPulse 2.2s ease-in-out infinite;
}

.page-play #hint[hidden],
.page-landing #hint[hidden]{
  display: none !important;
  animation: none !important;
}

.cards{
  display: grid;
  gap: 12px;
}

.card{
  width:100%;
  text-align:left;
  padding: 14px;
  background: var(--card);
  border: var(--border);
  box-shadow: var(--shadow);
  border-radius: 14px;
  cursor:pointer;
}
.card-media{
  position: relative;
  margin-bottom: 10px;
  border: var(--border);
  box-shadow: 4px 4px 0 var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.card-img{
  width: 100%;
  height: 480px;
  object-fit: contain;
  object-position: center;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  display: block;
}
.card-img-title{
  position: static;
  padding: 6px 10px;
  border-radius: 10px;
  background: #fff;
  border: var(--border);
  box-shadow: 3px 3px 0 var(--border-color);
  font-weight: 900;
  font-size: 13px;
  text-align: center;
  margin-top: 10px;
}

.card--slide{
  width: 100%;
  border: 0;
  box-shadow: none;
}

.page-home .card--slide{
  height: 100%;
  display: flex;
  flex-direction: column;
}

.page-home .card-img-title{
  margin-top: 0;
  margin-bottom: 10px;
}

.page-home .card-media{
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-home .card-img{
  width: 100%;
  height: 70%;
  max-width: 100%;
  max-height: 100%;
}

.page-home .card-media{
  height: 50%;
}

@media (max-height: 900px){
  .page-home .card-media{ height: 55%; }
}
@media (max-height: 850px){
  .page-home .card-media{ height: 58%; }
}
@media (max-height: 800px){
  .page-home .card-media{ height: 62%; }
}
@media (max-height: 720px){
  .page-home .card-media{ height: 70%; }
}

.card-bottom{
  margin-top: auto;
}

.card--slide .card-media{
  border-color: #fff;
  box-shadow: none;
}

.page-home-carousel .embla{
  height: auto;
}
.page-home-carousel .embla__viewport{
  height: auto;
}
.page-home-carousel .embla__slide{
  height: auto;
}
.page-home-carousel .card-img{
  height: 480px;
}
.card:active{ transform: translate(2px,2px); box-shadow: 4px 4px 0 var(--border-color); }

.card-title{ font-weight: 900; }
.card-sub{ color: var(--muted); margin-top: 4px; font-size: 13px; }
.card-sub{ text-align: center; }

.iconbtn{
  width: 44px;
  height: 44px;
  background: var(--card);
  border: 0;
  box-shadow: 0 6px 16px rgba(0,0,0,0.18);
  border-radius: 12px;
  font-size: 18px;
  cursor:pointer;
  transform: translateZ(0);
}
.iconbtn:active{ transform: none; box-shadow: 0 6px 16px rgba(0,0,0,0.18); }
.top .iconbtn:active{ transform: translateY(-50%); }
.modal .iconbtn:active{ transform: none; }
.iconbtn--sm{
  width: 35px;
  height: 35px;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--ink);
}
.icon-arrow{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 16px;
  line-height: 1;
}

.cardbox{
  background: var(--card);
  border: var(--border);
  box-shadow: var(--shadow);
  border-radius: 16px;
  padding: 10px;
  overflow: hidden;
}

.page-play .cardbox{
  height: clamp(240px, 45svh, 460px);
}

.page-landing .cardbox{
  height: auto;
}

/* Embla */
.embla{
  width:100%;
  display:flex;
  flex-direction: column;
  height: 100%;
}
.embla__viewport{
  overflow:hidden;
  border-radius: 12px;
  flex: 1 1 auto;
  min-height: 0;
}
.embla__container{ display:flex; gap: 10px; }
.embla__slide{
  flex: 0 0 100%;
  border-radius: 12px;
  overflow:hidden;
  border: var(--border);
  box-shadow: 4px 4px 0 var(--border-color);
  background: #eee;
}
.page-play .embla__viewport,
.page-play .embla__container,
.page-play .embla__slide{
  height: 100%;
}
.embla__slide img{
  width: 100%;
  height: 260px;
  object-fit: cover;
  display:block;
}
.page-play .embla__slide img,
.page-landing .embla__slide img{
  height: 100%;
}

.page-landing .embla{
  flex: 1;
  min-height: 0;
}

.page-landing .embla__viewport,
.page-landing .embla__container,
.page-landing .embla__slide{
  height: 100%;
}

.page-landing .card--slide{
  height: 100%;
  display: flex;
  flex-direction: column;
}

.page-landing .card-img-title{
  margin-top: 0;
  margin-bottom: 10px;
}

.page-landing .card-media{
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-landing .card-img{
  height: 100%;
  max-height: 100%;
}

.embla__dots{
  display:flex;
  justify-content:center;
  gap: 8px;
  padding-top: 10px;
}
.dot{
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid var(--border-color);
  background: #fff;
  cursor:pointer;
}
.dot.is-selected{ background:var(--border-color); }

.embla__nav{
  display: flex;
  justify-content: center;
  gap: 10px;
  padding-top: 10px;
}

.embla__nav--home{
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

.embla__nav--home #homePrevBtn{
  justify-self: start;
}

.embla__nav--home #homeNextBtn{
  justify-self: end;
}

.embla__nav-btn{
  min-width: 92px;
  padding: 8px 12px;
  border: var(--border);
  box-shadow: 4px 4px 0 var(--border-color);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}

.embla__nav-btn--play{
  justify-self: center;
  width: 100%;
  max-width: 230px;
}

.embla__nav-btn:active{
  transform: none;
}

.embla__nav-btn:disabled,
.embla__nav-btn.is-disabled{
  opacity: .45;
  cursor: not-allowed;
  box-shadow: none;
}

.grid4{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.page-play .play-bottom,
.page-landing .play-bottom{
  margin-top: auto;
}

.is-hidden{
  display: none !important;
}

.btn{
  width:100%;
  padding: 14px 12px;
  border: var(--border);
  box-shadow: var(--shadow);
  border-radius: 14px;
  background: #fff;
  font-weight: 900;
  font-size: 14px;
  cursor:pointer;
  text-align:center;
  text-decoration:none;
  color: #111;
}
.btn:active{ transform: translate(2px,2px); box-shadow: 4px 4px 0 var(--border-color); }

.btn--primary{
  background:#111;
  color:#fff;
}

.btn--wrong{
  background:#ffe5e5;
}

.btn--correct{
  background:#e7ffe7;
}

@keyframes shake {
  0%{ transform: translateX(0); }
  20%{ transform: translateX(-6px); }
  40%{ transform: translateX(6px); }
  60%{ transform: translateX(-4px); }
  80%{ transform: translateX(4px); }
  100%{ transform: translateX(0); }
}
.shake{ animation: shake .35s ease; }

@keyframes hintPulse {
  0%{ transform: scale(1); }
  50%{ transform: scale(1.04); }
  100%{ transform: scale(1); }
}

.reveal{
  margin-top: 14px;
  padding: 14px;
  background: #fff;
  border: var(--border);
  box-shadow: var(--shadow);
  border-radius: 16px;
}

.reveal-row{
  display:flex;
  justify-content:center;
  align-items:flex-end;
  gap: 12px;
}

.price{
  font-size: 28px;
  font-weight: 900;
  justify-content: center;
}

.actions{
  margin-top: 12px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.disclosure{
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.btn--success{
  background: #39e06a;
  color: #111;
}
