:root {
  --pink: #c8156f;
  --pink-deep: #a50e5a;
  --accent: #d6177a;
  --card: #f4f2f3;
  --card-inner: #e6e4e5;
  --ink: #1d1a1b;
  --ink-sub: #4a4547;
  --btn: #261d20;
  --on-pink: #fff;
  --on-pink-sub: rgba(255, 255, 255, .78);
  --radius-lg: 22px;
  --radius-md: 14px;
  --gutter: 16px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  background: var(--pink);
  color: var(--ink);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button { font: inherit; color: inherit; cursor: pointer; }

/* ---------- layout ---------- */
.page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 12px) var(--gutter) 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bg-pattern {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url("../img/union.svg") center top / 375px auto repeat;
  pointer-events: none;
}

.topbar, .hero, .panel, .footer { position: relative; z-index: 1; }

/* ---------- language ---------- */
.topbar { display: flex; justify-content: flex-end; height: 28px; }

.lang { position: relative; }

.lang__btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 2px;
  border: 0;
  background: none;
  color: var(--on-pink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
}

.lang__chev { width: 9px; height: 6px; transition: transform .2s; }
.lang__btn[aria-expanded="true"] .lang__chev { transform: rotate(180deg); }

.lang__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 4px;
  list-style: none;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  min-width: 64px;
}

.lang__menu li {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.lang__menu li[aria-selected="true"] { color: var(--accent); }
.lang__menu li:hover { background: var(--card-inner); }

/* ---------- hero ---------- */
.hero {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  margin: 2px -4px -14px;
}

.hero__char {
  flex: none;
  width: 106px;
  height: auto;
  filter: drop-shadow(0 6px 10px rgba(80, 0, 40, .25));
}

.hero__text { padding-bottom: 30px; min-width: 0; }

.hero__title {
  margin: 0;
  color: var(--on-pink);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: .02em;
}

.hero__sub {
  margin: 4px 0 0;
  color: var(--on-pink-sub);
  font-size: 11px;
}

/* ---------- ticket panel ---------- */
.panel {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 10px 30px rgba(90, 0, 45, .22);
}

.tickets {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.ticket {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 18px 16px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--card-inner);
  text-align: left;
  transition: transform .12s ease, background-color .2s;
}

.ticket:active { transform: scale(.98); }
.ticket:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ticket__date {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}

.ticket__time {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-sub);
  font-variant-numeric: tabular-nums;
}

.ticket__action {
  flex: none;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
}

.ticket.is-saving { pointer-events: none; }
.ticket.is-saving .ticket__action::after {
  content: "";
  animation: dots 1.2s steps(4, end) infinite;
}

@keyframes dots {
  0% { content: ""; }
  25% { content: "・"; }
  50% { content: "・・"; }
  75% { content: "・・・"; }
}

/* ---------- footer ---------- */
.footer {
  margin-top: auto;
  padding: 40px 0 calc(env(safe-area-inset-bottom) + 28px);
}

.btn-back {
  display: block;
  width: 100%;
  height: 56px;
  border: 0;
  border-radius: 999px;
  background: var(--btn);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .08em;
  transition: transform .12s ease, opacity .2s;
}

.btn-back:active { transform: scale(.98); opacity: .9; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 100px);
  z-index: 10;
  max-width: calc(100% - 32px);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(20, 16, 18, .9);
  color: #fff;
  font-size: 13px;
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
}

.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0s !important; }
}
