@font-face {
  font-family: Cinzel;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("cinzel.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Cinzel;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("cinzel.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Cinzel;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("cinzelext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Noto Serif Bengali";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("bengali.woff2") format("woff2");
  unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1;
}
@font-face {
  font-family: "Noto Serif Bengali";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("bengali.woff2") format("woff2");
  unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1;
}
@font-face {
  font-family: "Noto Serif Bengali";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("bengalilatin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --purple: #4A1C6B;
  --gold: #E6C35C;
  --navy: #1A1028;
  --cream: #FFF8EC;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  text-decoration: none !important;
  text-decoration-color: transparent !important;
  text-underline-offset: 0;
  -webkit-text-decoration-skip: none;
}

html, body {
  width: 100%;
  min-height: 100%;
  background: var(--navy);
  color: var(--cream);
  font-family: "Noto Serif Bengali", Cinzel, serif;
  font-weight: 500;
  overflow: hidden;
}

body {
  display: flex;
  justify-content: center;
}

#app {
  width: 100%;
  min-width: 320px;
  max-width: 430px;
  height: 100dvh;
  min-height: 100svh;
  position: relative;
  overflow: hidden;
  background: var(--navy) url("creamhall.jpg") center / cover no-repeat;
  box-shadow: 0 0 0 1px rgba(230, 195, 92, 0.28);
}

.hidden { display: none !important; }

.layer {
  position: absolute;
  inset: 0;
  z-index: 8;
}

.splash {
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background:
    linear-gradient(180deg, rgba(26, 16, 40, 0.35), rgba(74, 28, 107, 0.55)),
    url("thronedust.jpg") center / cover no-repeat;
}

.splash-crown {
  width: 132px;
  height: auto;
  filter: drop-shadow(0 12px 24px rgba(230, 195, 92, 0.45));
  animation: rise 1.2s ease both;
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 2px;
  letter-spacing: 0.04em;
}

.royale {
  font-family: Cinzel, serif;
  font-weight: 700;
  font-size: 1.7rem;
  color: var(--gold);
  letter-spacing: 0.12em;
}

.crestname {
  font-family: Cinzel, serif;
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--cream);
  letter-spacing: 0.08em;
}

.onboard {
  display: flex;
  flex-direction: column;
  background: var(--navy);
}

.goldbar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: calc(10px + env(safe-area-inset-top)) 16px 0;
  padding: 0;
  background: transparent;
  border: 0;
}

.goldbar i {
  height: 12px;
  border-radius: 3px;
  background: rgba(26, 16, 40, 0.7);
  border: 1px solid var(--gold);
  overflow: hidden;
  position: relative;
  clip-path: polygon(8% 0, 92% 0, 100% 50%, 92% 100%, 8% 100%, 0 50%);
}

.goldbar i.on::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #8d6a18, #E6C35C, #fff1b8, #E6C35C);
  background-size: 220% 100%;
  animation: liquid 1.6s linear infinite;
}

.scene {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.scene-throne {
  height: 100%;
  background:
    linear-gradient(180deg, rgba(26, 16, 40, 0.28), rgba(26, 16, 40, 0.62)),
    url("thronedust.jpg") center / cover no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0 20px calc(28px + env(safe-area-inset-bottom));
}

.fall-crown {
  position: absolute;
  top: -28%;
  left: 50%;
  width: 118px;
  transform: translateX(-50%);
  filter: drop-shadow(0 10px 18px rgba(230, 195, 92, 0.4));
  animation: descend 0.7s cubic-bezier(0.22, 0.08, 0.18, 1) forwards;
}

.fall-crown.seated {
  animation: none;
  top: 46%;
  transform: translateX(-50%) scale(0.92);
  filter: drop-shadow(0 0 22px rgba(230, 195, 92, 0.85));
}

.verse {
  text-align: center;
  font-size: 1.18rem;
  line-height: 1.85;
  color: var(--cream);
  text-shadow: 0 2px 16px rgba(26, 16, 40, 0.9);
  min-height: 4.2em;
  letter-spacing: 0;
  font-kerning: normal;
  font-feature-settings: "kern" 1, "liga" 1;
}

.act {
  margin-top: 16px;
  min-height: 48px;
  width: 100%;
  border: 1.5px solid var(--gold);
  background: rgba(74, 28, 107, 0.72);
  color: var(--cream);
  font-family: inherit;
  font-size: 1.05rem;
  border-radius: 14px;
  padding: 12px 16px;
  opacity: 0;
  pointer-events: none;
}

.act.ready {
  opacity: 1;
  pointer-events: auto;
  background: var(--gold);
  color: var(--navy);
}

.scene-hall {
  height: 100%;
  background:
    linear-gradient(180deg, rgba(26, 16, 40, 0.55), rgba(26, 16, 40, 0.78)),
    url("creamhall.jpg") center / cover no-repeat;
  padding: 18px 16px calc(20px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  flex: 1;
}

.pick {
  border: 2px solid var(--gold);
  background: rgba(74, 28, 107, 0.78);
  color: var(--cream);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 8px 16px;
  font-family: inherit;
  font-size: 1.02rem;
  opacity: 0.45;
  pointer-events: none;
  overflow: visible;
}

.pick.live {
  opacity: 1;
  pointer-events: auto;
}

.pick.on {
  background: var(--gold);
  color: var(--navy);
}

.pick img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.scene-hold, .scene-quiz {
  height: 100%;
  padding: 12px 14px calc(18px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
  background:
    linear-gradient(180deg, rgba(26, 16, 40, 0.72), rgba(74, 28, 107, 0.72)),
    url("creamhall.jpg") center / cover no-repeat;
}

.shell {
  height: 100%;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(26, 16, 40, 0.82) 0%, rgba(26, 16, 40, 0.7) 40%, rgba(74, 28, 107, 0.55) 100%),
    url("creamhall.jpg") center / cover no-repeat;
}

.thronebar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 8px;
  background: linear-gradient(180deg, #2a163d, #4A1C6B);
  border-bottom: 1px solid var(--gold);
}

.bar-crown {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(230, 195, 92, 0.55));
}

.thronebar .royale { font-size: 1.28rem; }
.thronebar .crestname { font-size: 1.05rem; }

.shields {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 10px 6px;
  padding-left: calc(10px + env(safe-area-inset-left));
  padding-right: calc(10px + env(safe-area-inset-right));
  background: rgba(26, 16, 40, 0.72);
}

.shield-wrap {
  flex: 1;
  height: 66px;
  border: 0;
  padding: 4px;
  background: var(--gold);
  color: var(--cream);
  clip-path: polygon(12% 0, 88% 0, 100% 36%, 50% 100%, 0 36%);
  font-family: inherit;
  filter: drop-shadow(0 0 1px #E6C35C);
}

.shield-wrap span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: var(--purple);
  color: var(--cream);
  clip-path: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}

.shield-wrap.on span {
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
}

.pane {
  flex: 1;
  overflow: auto;
  padding: 12px 12px calc(16px + env(safe-area-inset-bottom));
}

.week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--gold);
  border-radius: 16px;
  background: rgba(26, 16, 40, 0.72);
}

.week b {
  display: block;
  text-align: center;
  font-size: 0.62rem;
  color: var(--gold);
  margin-bottom: 6px;
  grid-column: 1 / -1;
  letter-spacing: 0.08em;
}

.dot {
  aspect-ratio: 1;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  background: transparent;
}

.dot.fill {
  background: var(--gold);
  box-shadow: 0 0 10px rgba(230, 195, 92, 0.55);
}

.pins {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.pin-chip {
  flex: 1;
  border: 1px solid var(--gold);
  background: rgba(230, 195, 92, 0.14);
  color: var(--cream);
  border-radius: 12px;
  padding: 8px 6px;
  font-family: inherit;
  font-size: 0.78rem;
}

.heralds {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.herald {
  min-height: 148px;
  border: 2px solid var(--gold);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(74, 28, 107, 0.88), rgba(26, 16, 40, 0.9));
  color: var(--cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 248, 236, 0.08), 0 8px 18px rgba(0, 0, 0, 0.28);
}

.herald img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.herald strong {
  font-weight: 700;
  font-size: 1rem;
}

.herald small {
  color: var(--gold);
  font-size: 0.72rem;
}

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 12;
  background: linear-gradient(180deg, #2b1740, #1A1028);
  border-top: 2px solid var(--gold);
  border-radius: 22px 22px 0 0;
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
  max-height: 78%;
  overflow: auto;
}

.sheet h2 {
  font-size: 1.2rem;
  color: var(--gold);
  margin-bottom: 10px;
}

.sheet li {
  list-style: none;
  padding: 8px 0 8px 18px;
  position: relative;
  line-height: 1.55;
}

.sheet li::before {
  content: "";
  width: 8px;
  height: 8px;
  border: 1px solid var(--gold);
  transform: rotate(45deg);
  position: absolute;
  left: 0;
  top: 14px;
}

.row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.row button, .cta, .ghost {
  flex: 1;
  border: 1.5px solid var(--gold);
  border-radius: 12px;
  padding: 11px 10px;
  font-family: inherit;
  font-size: 0.98rem;
  background: var(--gold);
  color: var(--navy);
}

.ghost {
  background: transparent;
  color: var(--cream);
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.stat {
  border: 1px solid var(--gold);
  border-radius: 14px;
  padding: 10px;
  background: rgba(26, 16, 40, 0.7);
}

.stat span {
  display: block;
  color: var(--gold);
  font-size: 0.72rem;
}

.stat strong {
  font-size: 1.35rem;
}

.hand {
  display: flex;
  gap: 6px;
  justify-content: center;
  min-height: 128px;
}

.pcard {
  flex: 1;
  max-width: 68px;
  min-height: 118px;
  border: 1.5px solid var(--gold);
  border-radius: 10px;
  background: var(--cream);
  color: var(--navy);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px;
  font-family: Cinzel, "Noto Serif Bengali", serif;
  font-weight: 700;
}

.pcard.held {
  background: var(--gold);
  box-shadow: 0 0 0 2px var(--navy), 0 0 12px rgba(230, 195, 92, 0.55);
}

.pcard em {
  font-style: normal;
  font-size: 1.1rem;
}

.pcard b {
  font-size: 1.35rem;
}

.pcard small {
  font-family: "Noto Serif Bengali", serif;
  font-size: 0.62rem;
}

.meta {
  text-align: center;
  color: var(--gold);
  min-height: 2.6em;
  line-height: 1.5;
}

.qbox {
  border: 1.5px solid var(--gold);
  border-radius: 16px;
  padding: 14px;
  background: rgba(26, 16, 40, 0.78);
}

.qbox p {
  font-size: 1.08rem;
  line-height: 1.6;
  margin-bottom: 12px;
}

.ans {
  width: 100%;
  margin: 6px 0;
  border: 1.5px solid var(--gold);
  background: rgba(74, 28, 107, 0.7);
  color: var(--cream);
  border-radius: 12px;
  padding: 11px;
  font-family: inherit;
  text-align: left;
}

.ans.good { background: var(--gold); color: var(--navy); }
.ans.bad { opacity: 0.45; }

.seals {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 12px;
}

.seal {
  aspect-ratio: 0.78;
  border: 2px solid var(--gold);
  border-radius: 14px;
  background: rgba(74, 28, 107, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}

.seal img {
  width: 78%;
  height: auto;
}

.seal.hit {
  background: var(--gold);
}

.seal.miss {
  opacity: 0.35;
}

.note {
  margin-top: 12px;
  line-height: 1.6;
  text-align: center;
}

.result {
  text-align: center;
  padding: 24px 8px;
}

.result h2 {
  font-size: 2.2rem;
  color: var(--gold);
}

@keyframes rise {
  from { transform: translateY(12px) scale(0.92); }
  to { transform: none; }
}

@keyframes descend {
  0% { top: -30%; }
  80% { top: 42%; }
  100% { top: 46%; }
}

@keyframes liquid {
  0% { background-position: 0 50%; }
  100% { background-position: 220% 50%; }
}

@media (max-width: 360px) {
  .thronebar .royale { font-size: 1.12rem; }
  .shield-wrap span { font-size: 0.7rem; }
  .herald { min-height: 132px; }
}
