/* ライブ電子チケット 共通の見た目。文字は16px以上、押すところは44px以上。 */
:root {
  --bg: #f4f1ea;
  --surface: #ffffff;
  --ink: #1d1d1f;
  --muted: #55555c;
  --line: #d9d4c7;
  --accent: #1b2a4a;
  --accent-ink: #ffffff;
  --ok: #1e7a3c;
  --ok-bg: #e5f4ea;
  --ng: #b3261e;
  --ng-bg: #fbeae8;
  --warn-bg: #fff4d6;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171c; --surface: #1f2229; --ink: #f2f2f4; --muted: #b5b5bd; --line: #3a3e48;
    --accent: #e9b44c; --accent-ink: #1b1b1b; --ok: #6fd28f; --ok-bg: #173323; --ng: #ff8a80; --ng-bg: #3a1c1a; --warn-bg: #3a3218;
  }
}
* { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, sans-serif;
  font-size: 1rem; line-height: 1.6;
}
main { max-width: 760px; margin: 0 auto; padding: 16px 16px 48px; }
h1 { font-size: 1.5rem; margin: 8px 0 4px; display: flex; align-items: center; gap: 8px; }
h2 { font-size: 1.25rem; margin: 28px 0 4px; display: flex; align-items: center; gap: 8px; }
h3 { font-size: 1.1rem; margin: 16px 0 4px; }
p { margin: 4px 0 12px; }
.lead { color: var(--muted); margin-bottom: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; }
.hidden { display: none !important; }

label { display: block; font-weight: 600; margin: 12px 0 4px; }
.hint { display: block; color: var(--muted); font-weight: 400; font-size: 1rem; }
input[type=text], input[type=number], input[type=date], input[type=time], input[type=search], textarea, select {
  width: 100%; min-height: 48px; font-size: 1rem; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-family: inherit;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid #e9b44c; outline-offset: 2px; }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; min-width: 44px; padding: 10px 18px; font-size: 1rem; font-weight: 700; font-family: inherit;
  border-radius: 12px; border: 2px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  cursor: pointer; text-decoration: none;
}
button.sub, .btn.sub { background: transparent; color: var(--ink); border-color: var(--line); }
button.danger { background: var(--ng); border-color: var(--ng); color: #fff; }
button:disabled { opacity: .5; cursor: not-allowed; }
.wide { width: 100%; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 0 0 auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 480px) { .grid2 { grid-template-columns: 1fr; } }

.msg { border-radius: 10px; padding: 12px 14px; margin: 12px 0; font-weight: 600; }
.msg.ok { background: var(--ok-bg); color: var(--ok); }
.msg.ng { background: var(--ng-bg); color: var(--ng); }
.msg.info { background: var(--warn-bg); color: var(--ink); }
.msg::before { margin-right: 6px; }
.msg.ok::before { content: "✅"; }
.msg.ng::before { content: "⚠️"; }
.msg.info::before { content: "ℹ️"; }

.qty { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.qty button { background: var(--surface); color: var(--ink); border-color: var(--line); }
.qty button[aria-pressed=true] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.qrbox { text-align: center; }
.qrbox svg { width: min(80vw, 340px); height: auto; background: #fff; border-radius: 12px; }
.countdown { font-size: 1.5rem; font-weight: 800; }
.big { font-size: 1.5rem; font-weight: 800; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 1rem; color: var(--muted); }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-weight: 700; font-size: 1rem; border: 1px solid var(--line); }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge.ng { background: var(--ng-bg); color: var(--ng); border-color: transparent; }
.nav { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0; position: sticky; top: 0; background: var(--bg); z-index: 5; }
.nav a { white-space: nowrap; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 720px) { .split { grid-template-columns: 1fr; } }
.preview { position: sticky; top: 72px; }
.color-row { display: flex; align-items: center; gap: 12px; }
.color-row input[type=color] { width: 64px; height: 48px; border: 1px solid var(--line); border-radius: 10px; padding: 2px; background: var(--surface); }
footer { text-align: center; color: var(--muted); padding: 24px 16px; }
footer a { color: inherit; }

/* ── チケット（左が本券・右が半券。オリジナルデザイン）── */
.ticket {
  --t-main: #1b2a4a; --t-sub: #e9b44c; --t-text: #ffffff;
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 30%;
  width: 100%; margin: 12px 0 24px; color: var(--t-text); filter: drop-shadow(0 6px 14px rgba(0,0,0,.25));
}
.ticket-main, .ticket-stub { position: relative; overflow: hidden; background-color: var(--t-main); }
.ticket-main { border-radius: 16px 0 0 16px; padding: 16px 16px 16px 18px; background-size: cover; background-position: center; }
.ticket-main::before { /* 背景画像の上に色を重ねて文字を読みやすくする */
  content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, var(--t-main) 15%, transparent 140%); opacity: .82;
}
.ticket-main > * { position: relative; }
.ticket-main::after { /* 左端の帯 */
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 8px; background: var(--t-sub);
}
.ticket-stub {
  border-radius: 0 16px 16px 0; padding: 16px 10px; text-align: center;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px;
  background: var(--t-sub); color: var(--t-main);
  border-left: 3px dashed color-mix(in srgb, var(--t-main) 55%, transparent);
  transform-origin: 0% 0%;
}
.ticket-stub::before, .ticket-stub::after { /* ミシン目の上下の切り欠き */
  content: ""; position: absolute; left: -14px; width: 24px; height: 24px; border-radius: 50%; background: var(--bg);
}
.ticket-stub::before { top: -12px; }
.ticket-stub::after { bottom: -12px; }
.t-head { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.t-logo { max-height: 48px; max-width: 45%; object-fit: contain; }
.t-band { font-weight: 800; letter-spacing: .04em; }
.t-title { font-size: 1.6rem; font-weight: 900; line-height: 1.25; margin: 8px 0 10px; word-break: break-word; letter-spacing: .02em; }
.t-rows { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; }
.t-rows dt { opacity: .85; }
.t-rows dd { margin: 0; font-weight: 700; word-break: break-word; }
.t-foot { margin-top: 12px; padding-top: 10px; border-top: 1px solid color-mix(in srgb, var(--t-text) 40%, transparent); }
.s-label { font-weight: 800; letter-spacing: .1em; }
.s-num { font-size: 2rem; font-weight: 900; line-height: 1.1; word-break: break-all; }
.s-unit { font-weight: 700; }
.ticket.entered .ticket-stub { visibility: hidden; }
.ticket.entered .ticket-main { border-radius: 16px; }
.stamp {
  position: absolute; right: 30%; top: 50%; transform: translate(40%, -50%) rotate(-14deg);
  border: 4px solid #d93a2b; color: #d93a2b; background: rgba(255,255,255,.88);
  padding: 6px 14px; border-radius: 10px; font-weight: 900; font-size: 1.5rem; text-align: center; line-height: 1.3;
  pointer-events: none;
}
.stamp small { display: block; font-size: 1rem; font-weight: 700; }
.ticket.cancelled { filter: grayscale(1) opacity(.6); }
.ticket.tearing .ticket-stub { animation: tear 1.3s cubic-bezier(.4,.1,.6,1) forwards; visibility: visible; }
@keyframes tear {
  0% { transform: rotate(0); }
  20% { transform: rotate(-4deg) translate(2px, -2px); }
  35% { transform: rotate(6deg) translate(6px, 4px); }
  100% { transform: rotate(38deg) translate(40px, 120vh); opacity: .2; }
}
.stamp.pop { animation: pop .45s ease-out both; }
@keyframes pop {
  0% { transform: translate(40%, -50%) rotate(-14deg) scale(2.2); opacity: 0; }
  100% { transform: translate(40%, -50%) rotate(-14deg) scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .ticket.tearing .ticket-stub { animation-duration: .01s; }
  .stamp.pop { animation: none; }
}
@media (max-width: 420px) {
  .ticket { grid-template-columns: minmax(0, 1fr) 32%; }
  .t-title { font-size: 1.35rem; }
  .s-num { font-size: 1.6rem; }
  .stamp { font-size: 1.25rem; padding: 4px 10px; }
}
.ticket-list button { width: 100%; justify-content: space-between; margin: 6px 0; background: var(--surface); color: var(--ink); border-color: var(--line); text-align: left; }
.passbox { display: flex; gap: 8px; }
.passbox input { font-size: 1.5rem; letter-spacing: .4em; text-align: center; }
.mt { margin-top: 16px; }
