/* =====================================================================
   OKINAWA POP MARCHE デジタルくじ：ブルー・オレンジ・イエロー・ピンクのポップな配色・スマホ優先・文字は16px以上
   ===================================================================== */
:root {
  --blue: #1e7bff; --blue-d: #0f56c2;
  --orange: #ff8a00; --orange-d: #d96f00;
  --yellow: #ffd400; --yellow-d: #e0b400;
  --pink: #ff4fa3; --pink-d: #d63584;
  --ink: #1b2340; --ink-soft: #4a5373;
  --paper: #ffffff; --bg: #fff8e6;
  --gold: #ffcf3f; --gold-d: #c99600;
  --radius: 22px;
  --font: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Yu Gothic", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  font-family: var(--font); font-size: 17px; font-weight: 500; line-height: 1.6; color: var(--ink);
  background: var(--bg); overflow-x: hidden;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bg-dots {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 79, 163, .22) 0 60px, transparent 61px),
    radial-gradient(circle at 88% 12%, rgba(30, 123, 255, .2) 0 80px, transparent 81px),
    radial-gradient(circle at 90% 78%, rgba(255, 212, 0, .3) 0 90px, transparent 91px),
    radial-gradient(circle at 8% 88%, rgba(255, 138, 0, .22) 0 70px, transparent 71px),
    radial-gradient(rgba(27, 35, 64, .07) 2px, transparent 2.5px) 0 0 / 22px 22px,
    var(--bg);
}
.screen { max-width: 520px; margin: 0 auto; padding: 18px 16px 40px; display: flex; flex-direction: column; gap: 16px; }

/* ---- ブランド ---- */
.brand { text-align: center; margin-top: 6px; }
.brand-sub { margin: 0; font-weight: 900; letter-spacing: .4em; color: var(--blue); font-size: 16px; }
.brand-name { margin: 0; font-size: 46px; line-height: 1.05; font-weight: 900; letter-spacing: .02em; text-shadow: 3px 3px 0 var(--ink); }
.brand-name .c1 { color: var(--pink); } .brand-name .c2 { color: var(--yellow); } .brand-name .c3 { color: var(--blue); } .brand-name .c4 { color: var(--orange); }
.brand-lead { display: inline-block; margin: 8px 0 0; padding: 2px 18px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 800; font-size: 18px; }

/* ---- カード・ボタン ---- */
.card { background: var(--paper); border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: 0 6px 0 var(--ink); padding: 20px 18px; }
.hero { text-align: center; }
.badges { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-block; padding: 4px 14px; border-radius: 999px; font-weight: 800; font-size: 16px; color: #fff; border: 2px solid var(--ink); }
.pill-pink { background: var(--pink); } .pill-blue { background: var(--blue); }
.hero-text { margin: 14px 0 18px; font-size: 22px; font-weight: 800; line-height: 1.5; }
.hero-text b { color: var(--pink); font-size: 1.25em; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 56px; padding: 10px 18px; border: 3px solid var(--ink); border-radius: 999px;
  font: inherit; font-size: 19px; font-weight: 900; text-decoration: none; color: var(--ink); cursor: pointer;
  box-shadow: 0 5px 0 var(--ink); transition: transform .08s, box-shadow .08s; -webkit-tap-highlight-color: transparent;
}
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:focus-visible { outline: 4px solid var(--blue); outline-offset: 3px; }
.btn-draw { min-height: 76px; font-size: 28px; color: #fff; background: linear-gradient(180deg, #ff6bb5, var(--pink)); animation: bob 1.6s ease-in-out infinite; }
.btn-draw:disabled { animation: none; background: #c9c9d6; color: #fff; }
.btn-main { background: var(--yellow); }
.btn-sub { background: #fff; }
.btn-use { min-height: 72px; font-size: 26px; color: #fff; background: linear-gradient(180deg, #ff9d2e, var(--orange)); }
.count { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 999px; background: var(--pink); color: #fff; font-size: 16px; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.wait { margin: 12px 0 0; font-weight: 800; color: var(--blue-d); font-size: 18px; }
.wait b { font-size: 26px; font-variant-numeric: tabular-nums; }
.form-error { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: #ffe3ef; color: #a0004f; font-weight: 800; font-size: 16px; }
.howto h2 { margin: 0 0 6px; font-size: 20px; }
.howto ol { margin: 0; padding-left: 1.4em; font-size: 17px; }
.note { margin: 10px 0 0; font-size: 16px; color: var(--ink-soft); }

/* ---- くじ引き（ガラガラ） ---- */
#scr-draw { align-items: center; justify-content: center; min-height: 92vh; min-height: 92dvh; }
.draw-title { margin: 0; font-size: 34px; font-weight: 900; color: var(--ink); text-shadow: 2px 2px 0 #fff; animation: bob .5s ease-in-out infinite; }
.machine { position: relative; width: 280px; height: 300px; }
.drum {
  position: absolute; left: 30px; top: 20px; width: 220px; height: 220px; display: grid; place-items: center;
  clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%);
  background: conic-gradient(var(--pink) 0 60deg, var(--yellow) 0 120deg, var(--blue) 0 180deg, var(--orange) 0 240deg, var(--pink) 0 300deg, var(--yellow) 0);
}
.drum-face { width: 120px; height: 120px; border-radius: 50%; background: #fff; border: 5px solid var(--ink); display: grid; place-items: center; font-weight: 900; font-size: 30px; color: var(--pink); }
.drum.spin { animation: spin 2.6s cubic-bezier(.3, .05, .3, 1) forwards; }
@keyframes spin { to { transform: rotate(1080deg); } }
.stand { position: absolute; left: 60px; right: 60px; bottom: 30px; height: 70px; background: var(--ink); clip-path: polygon(20% 0, 80% 0, 100% 100%, 0 100%); z-index: -1; }
.tray { position: absolute; left: 150px; bottom: 20px; width: 110px; height: 26px; border-radius: 0 0 20px 20px; background: var(--orange); border: 3px solid var(--ink); }
.ball { position: absolute; left: 168px; bottom: 44px; width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--ink); opacity: 0; background: #fff; }
.ball.out { animation: ballout .9s cubic-bezier(.3, 1.6, .5, 1) forwards; }
@keyframes ballout { 0% { opacity: 1; transform: translate(-40px, -120px) scale(.6); } 60% { transform: translate(20px, 0) scale(1.1); } 100% { opacity: 1; transform: translate(30px, 0) scale(1.25); } }
.ball.g1 { background: radial-gradient(circle at 35% 30%, #fff8c4, var(--gold) 45%, var(--gold-d)); box-shadow: 0 0 30px 10px rgba(255, 207, 63, .9); }
.ball.g2 { background: radial-gradient(circle at 35% 30%, #ffc6c6, #ff3b3b 50%, #b00000); }
.ball.g3 { background: radial-gradient(circle at 35% 30%, #c8e1ff, var(--blue) 55%, var(--blue-d)); }
.ball.g4 { background: radial-gradient(circle at 35% 30%, #fff, #ffe4f1 60%, #ffb3d6); }

/* ---- 当選 ---- */
.win-head { text-align: center; min-height: 40px; }
.win-grade { display: inline-block; margin: 8px 0 0; padding: 6px 22px; border-radius: 999px; border: 3px solid var(--ink); font-weight: 900; font-size: 22px; background: #fff; box-shadow: 0 4px 0 var(--ink); }
.win-title { margin: 12px 0 0; font-size: 30px; font-weight: 900; line-height: 1.3; animation: popin .6s cubic-bezier(.3, 1.6, .5, 1) both; }
.win-title.g3 { color: var(--blue-d); } .win-title.g2 { color: #e0002a; font-size: 34px; } .win-title.g1 { color: var(--gold-d); font-size: 36px; }
@keyframes popin { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.coupon-card {
  position: relative; background: #fff; border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: 0 6px 0 var(--ink);
  padding: 18px 18px 16px; overflow: hidden; animation: popin .5s .2s both;
}
.coupon-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 10px; background: repeating-linear-gradient(90deg, var(--pink) 0 25%, var(--yellow) 0 50%, var(--blue) 0 75%, var(--orange) 0 100%); }
.coupon-card.g1 { border-color: var(--gold-d); box-shadow: 0 6px 0 var(--gold-d), 0 0 40px rgba(255, 207, 63, .8); }
.c-grade { display: inline-block; margin-top: 6px; padding: 2px 14px; border-radius: 999px; font-weight: 900; font-size: 16px; color: #fff; border: 2px solid var(--ink); }
.c-grade.g1 { background: linear-gradient(90deg, var(--gold-d), var(--gold), var(--gold-d)); color: var(--ink); }
.c-grade.g2 { background: #e0002a; } .c-grade.g3 { background: var(--blue); } .c-grade.g4 { background: var(--pink); }
.c-booth { margin: 8px 0 0; font-weight: 800; color: var(--orange-d); font-size: 17px; }
.c-name { margin: 2px 0 0; font-size: 26px; font-weight: 900; line-height: 1.3; overflow-wrap: anywhere; }
.c-desc { margin: 6px 0 0; font-size: 17px; color: var(--ink-soft); }
.c-img { display: block; width: 100%; max-height: 200px; object-fit: cover; border-radius: 14px; margin-top: 10px; border: 2px solid var(--ink); }
.win-actions { display: flex; flex-direction: column; gap: 12px; }

/* ---- 一覧 ---- */
.page-head { display: flex; align-items: center; gap: 12px; }
.page-head h1 { margin: 0; font-size: 24px; font-weight: 900; }
.back { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; background: #fff; border: 2px solid var(--ink); color: var(--ink); font-weight: 800; text-decoration: none; font-size: 16px; white-space: nowrap; }
.coupon-list { display: flex; flex-direction: column; gap: 14px; }
.c-item { display: block; position: relative; text-decoration: none; color: inherit; background: #fff; border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 5px 0 var(--ink); padding: 12px 14px 12px 16px; }
.c-item .c-name { font-size: 21px; }
.c-item .c-meta { margin: 4px 0 0; font-size: 16px; color: var(--ink-soft); }
.c-item .go { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 26px; color: var(--ink-soft); }
.c-item.used { background: #eef0f5; box-shadow: 0 5px 0 #9aa1b5; border-color: #9aa1b5; }
.c-item.used .c-name, .c-item.used .c-booth { color: #7c8299; }
.used-badge { display: inline-block; margin-left: 6px; padding: 1px 10px; border-radius: 6px; background: #7c8299; color: #fff; font-size: 16px; font-weight: 900; vertical-align: 2px; }
.empty { text-align: center; padding: 30px 16px; background: #fff; border: 3px dashed var(--ink-soft); border-radius: 18px; font-size: 17px; }

/* ---- お店に見せる画面 ---- */
.show { text-align: center; }
.show .c-name { font-size: 32px; }
.show .c-booth { font-size: 20px; }
.live {
  margin: 14px 0 0; padding: 10px; border-radius: 14px; color: #fff; font-weight: 900;
  background: linear-gradient(90deg, var(--blue), var(--pink), var(--orange), var(--yellow), var(--blue)); background-size: 300% 100%; animation: flow 3s linear infinite;
}
.live .clock { font-size: 30px; font-variant-numeric: tabular-nums; letter-spacing: .04em; text-shadow: 2px 2px 0 rgba(0, 0, 0, .25); }
.live small { display: block; font-size: 16px; }
@keyframes flow { to { background-position: 300% 0; } }
.code { margin: 12px 0 0; font-size: 16px; color: var(--ink-soft); }
.code b { font-size: 22px; letter-spacing: .12em; color: var(--ink); font-variant-numeric: tabular-nums; }
.use-steps { margin: 14px 0 0; padding: 12px 14px; border-radius: 14px; background: #fff6d1; border: 2px solid var(--yellow-d); text-align: left; font-size: 17px; }
.use-steps ol { margin: 0; padding-left: 1.3em; }
.use-area { margin-top: 16px; }
.stamp {
  display: inline-block; margin: 18px 0 6px; padding: 6px 26px; border: 6px double #e0002a; border-radius: 14px; color: #e0002a;
  font-size: 40px; font-weight: 900; letter-spacing: .1em; transform: rotate(-8deg); animation: stamp .45s cubic-bezier(.3, 1.6, .5, 1) both;
}
@keyframes stamp { from { transform: rotate(-8deg) scale(2.4); opacity: 0; } to { transform: rotate(-8deg) scale(1); opacity: 1; } }
.show.used .c-name { color: #7c8299; text-decoration: line-through 3px; }
.used-at { font-size: 17px; font-weight: 800; color: var(--ink-soft); }

/* ---- 確認 ---- */
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(27, 35, 64, .55); }
.modal { width: min(440px, 100%); background: #fff; border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: 0 8px 0 var(--ink); padding: 22px 18px 18px; }
.modal h2 { margin: 0 0 8px; font-size: 22px; }
.modal p { margin: 0; font-size: 17px; }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }

/* ---- トースト ---- */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 70; transform: translate(-50%, 160%); width: max-content; max-width: calc(100% - 32px); padding: 12px 20px; border-radius: 18px; text-align: center; background: var(--ink); color: #fff; font-weight: 800; font-size: 16px; transition: transform .25s, visibility .25s; pointer-events: none; visibility: hidden; }
.toast.show { transform: translate(-50%, 0); visibility: visible; }

/* ---- 当選の演出（全画面） ---- */
.fx { position: fixed; inset: 0; z-index: 40; pointer-events: none; overflow: hidden; }
.fx.block { pointer-events: auto; }
.fx-flash { position: absolute; inset: 0; background: #fff; animation: flash .9s ease-out 3 both; }
@keyframes flash { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }
.fx-telop {
  position: absolute; left: 0; right: 0; top: 22%; padding: 14px 10px; text-align: center; font-size: 34px; font-weight: 900; color: #fff;
  background: linear-gradient(90deg, var(--blue), var(--pink)); border-block: 4px solid var(--ink); text-shadow: 3px 3px 0 var(--ink);
  animation: telop 2.8s cubic-bezier(.2, .9, .3, 1) both;
}
@keyframes telop { 0% { transform: translateX(110%); } 18%, 82% { transform: translateX(0); } 100% { transform: translateX(-110%); } }
.fx-big {
  position: absolute; left: 50%; top: 42%; width: 92%; transform: translate(-50%, -50%); text-align: center; font-weight: 900; line-height: 1.25;
  font-size: 40px; color: #fff; text-shadow: 0 0 18px rgba(255, 207, 63, .95), 4px 4px 0 var(--ink); animation: bigin .8s cubic-bezier(.3, 1.6, .5, 1) both;
}
.fx-big.g2 { color: #ffe14d; }
@keyframes bigin { from { transform: translate(-50%, -50%) scale(.2); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
/* 1等：夜空・回る光・キラキラ */
.fx-night { position: absolute; inset: 0; background: radial-gradient(circle at 50% 45%, #3b2a6b, #120b2b 70%); animation: fadein .6s both; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.fx-rays {
  position: absolute; left: 50%; top: 42%; width: 220vmax; height: 220vmax; margin: -110vmax 0 0 -110vmax; opacity: .55;
  background: repeating-conic-gradient(rgba(255, 220, 90, .55) 0 8deg, transparent 8deg 20deg); animation: rays 6s linear infinite;
  -webkit-mask: radial-gradient(circle, #000 0 18%, transparent 60%); mask: radial-gradient(circle, #000 0 18%, transparent 60%);
}
@keyframes rays { to { transform: rotate(360deg); } }
.fx-sparkle { position: absolute; width: 18px; height: 18px; background: #fff; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: twinkle 1.4s ease-in-out infinite; filter: drop-shadow(0 0 6px #fff7b0); }
@keyframes twinkle { 0%, 100% { transform: scale(.2) rotate(0); opacity: .2; } 50% { transform: scale(1.2) rotate(45deg); opacity: 1; } }
.fx-big.g1 { font-size: 44px; color: #fff6c2; animation: bigin .9s cubic-bezier(.3, 1.6, .5, 1) both, glow 1.2s 1s ease-in-out infinite alternate; }
@keyframes glow { from { text-shadow: 0 0 14px rgba(255, 207, 63, .9), 4px 4px 0 #6a4b00; } to { text-shadow: 0 0 40px rgba(255, 240, 150, 1), 0 0 80px rgba(255, 180, 40, .9), 4px 4px 0 #6a4b00; } }
.fx-wait { position: absolute; left: 0; right: 0; bottom: calc(40px + env(safe-area-inset-bottom)); text-align: center; color: #fff; font-weight: 800; font-size: 16px; opacity: .85; }

@media (min-width: 600px) {
  .brand-name { font-size: 58px; }
  .fx-big { font-size: 52px; } .fx-big.g1 { font-size: 60px; }
}
@media (prefers-reduced-motion: reduce) {
  .btn-draw, .draw-title, .live { animation: none; }
}

/* 演出の文字：1行ずつ折り返さない・2等は暗い背景で読みやすく */
.fx-big span { display: block; white-space: nowrap; }
.fx-big.g1 { font-size: min(44px, 8.6vw); }
.fx-big.g1 .l2 { font-size: 1.45em; margin-top: 6px; }
.fx-dim { position: absolute; inset: 0; background: radial-gradient(circle at 50% 42%, rgba(224, 0, 42, .85), rgba(27, 35, 64, .9) 70%); animation: fadein .4s both; }
.fx-big.g2 { font-size: min(46px, 10vw); color: #fff; text-shadow: 0 0 22px rgba(255, 207, 63, .95), 4px 4px 0 var(--ink); }
.fx-big.g2 span + span { color: var(--yellow); font-size: 1.2em; }
@media (min-width: 600px) { .fx-big.g1 { font-size: 60px; } .fx-big.g2 { font-size: 56px; } }
