/* ===================================================
   てきとー馬券 - スタイルシート
   =================================================== */

:root {
  --bg-primary: #0f1715;
  --bg-secondary: #162420;
  --bg-card: #1c2e29;
  --bg-card-border: #2c473f;
  
  --accent-gold: #f59e0b;
  --accent-gold-light: #fbbf24;
  --accent-gold-glow: rgba(245, 158, 11, 0.4);
  --accent-green: #10b981;
  --accent-green-dark: #047857;
  --accent-red: #ef4444;
  
  --text-main: #f1f5f9;
  --text-sub: #94a3b8;
  --text-muted: #64748b;

  /* JRA 枠番カラー定義 */
  --waku-1: #ffffff; --waku-1-text: #111827; /* 1枠: 白 */
  --waku-2: #1e293b; --waku-2-text: #ffffff; /* 2枠: 黒 */
  --waku-3: #dc2626; --waku-3-text: #ffffff; /* 3枠: 赤 */
  --waku-4: #2563eb; --waku-4-text: #ffffff; /* 4枠: 青 */
  --waku-5: #eab308; --waku-5-text: #111827; /* 5枠: 黄 */
  --waku-6: #16a34a; --waku-6-text: #ffffff; /* 6枠: 緑 */
  --waku-7: #ea580c; --waku-7-text: #ffffff; /* 7枠: 橙 */
  --waku-8: #ec4899; --waku-8-text: #ffffff; /* 8枠: 桃 */

  --font-sans: 'M PLUS Rounded 1c', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'Share Tech Mono', monospace, Consolas, monospace;
  --font-ticket: 'Changa One', 'M PLUS Rounded 1c', sans-serif;
  --font-stamp: 'Yuji Boku', serif, cursive;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(ellipse at 50% 0%, rgba(16, 185, 129, 0.15) 0%, transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(245, 158, 11, 0.08) 0%, transparent 50%),
    linear-gradient(to bottom, #0d1513, #090e0c);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
  padding-bottom: 60px;
}

/* 紙吹雪Canvas */
#confettiCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

/* コンテナ */
.app-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 20px;
}

/* ヘッダー */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.back-link {
  color: var(--text-sub);
  text-decoration: none;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
}

.back-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  transform: translateX(-2px);
}

.sound-toggle-btn {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.sound-toggle-btn.muted {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.sound-toggle-btn:hover {
  transform: scale(1.04);
}

/* タイトルセクション */
.title-section {
  text-align: center;
  margin-bottom: 28px;
}

.badge-jra-style {
  display: inline-block;
  background: linear-gradient(135deg, #059669, #047857);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.main-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.title-sub {
  font-size: 0.95rem;
  color: var(--accent-gold-light);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.title-main {
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 30%, #fde68a 70%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 20px rgba(245, 158, 11, 0.25);
}

.horse-emoji {
  display: inline-block;
  -webkit-text-fill-color: initial;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
}

.title-desc {
  font-size: 0.92rem;
  color: var(--text-sub);
  margin-top: 6px;
}

/* 設定カード */
.card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.panel-heading {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.step-num {
  background: linear-gradient(135deg, var(--accent-gold), #d97706);
  color: #111827;
  font-size: 0.85rem;
  font-weight: 900;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.4);
}

.mt-4 {
  margin-top: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-sub);
}

.value-display strong {
  font-size: 1.4rem;
  color: var(--accent-gold-light);
  font-family: var(--font-mono);
  margin-right: 2px;
}

/* スライダー */
.slider-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.25);
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.slider-wrapper span {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 700;
}

input[type="range"] {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: #334155;
  accent-color: var(--accent-gold);
  cursor: pointer;
}

/* 馬番バッジプレビュー */
.horse-badges-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

.horse-chip {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  font-family: var(--font-mono);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease;
}

.horse-chip:hover {
  transform: translateY(-2px);
}

/* 枠番ごとのカラー適用クラス */
.waku-1 { background-color: var(--waku-1); color: var(--waku-1-text); border: 1px solid #94a3b8; }
.waku-2 { background-color: var(--waku-2); color: var(--waku-2-text); }
.waku-3 { background-color: var(--waku-3); color: var(--waku-3-text); }
.waku-4 { background-color: var(--waku-4); color: var(--waku-4-text); }
.waku-5 { background-color: var(--waku-5); color: var(--waku-5-text); }
.waku-6 { background-color: var(--waku-6); color: var(--waku-6-text); }
.waku-7 { background-color: var(--waku-7); color: var(--waku-7-text); }
.waku-8 { background-color: var(--waku-8); color: var(--waku-8-text); }

/* 金額入力 */
.input-with-unit {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.unit-prefix {
  position: absolute;
  left: 16px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-gold);
}

.unit-suffix {
  position: absolute;
  right: 16px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.input-with-unit input {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 2px solid #334155;
  border-radius: 12px;
  padding: 12px 42px 12px 38px;
  font-size: 1.4rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-with-unit input:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 12px var(--accent-gold-glow);
}

/* クイック選択ボタン */
.quick-btn-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.btn-quick {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-sub);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-quick:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.btn-quick.active {
  background: var(--accent-gold);
  color: #111827;
  border-color: var(--accent-gold);
  box-shadow: 0 2px 8px var(--accent-gold-glow);
}

/* 券種選択 */
.ticket-type-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.btn-secondary-sm {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-sub);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary-sm:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.ticket-types-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

@media (min-width: 560px) {
  .ticket-types-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.ticket-checkbox-card {
  position: relative;
  display: block;
  cursor: pointer;
}

.ticket-checkbox-card input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.ticket-checkbox-card .card-content {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid #334155;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.ticket-checkbox-card .type-name {
  font-size: 1rem;
  font-weight: 800;
  color: #cbd5e1;
}

.ticket-checkbox-card .type-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.ticket-checkbox-card input:checked + .card-content {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--accent-green);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.ticket-checkbox-card input:checked + .card-content .type-name {
  color: #34d399;
}

/* 買い方・投票方式選択 */
.method-select-area {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.label-row-sm {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent-gold-light);
  margin-bottom: 8px;
}

.method-types-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

@media (min-width: 520px) {
  .method-types-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.method-checkbox {
  position: relative;
  cursor: pointer;
  display: block;
}

.method-checkbox input {
  position: absolute;
  opacity: 0;
}

.method-pill {
  display: block;
  text-align: center;
  padding: 8px 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid #334155;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-sub);
  transition: all 0.2s ease;
}

.method-checkbox input:checked + .method-pill {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--accent-gold);
  color: #fbbf24;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.2);
}

/* アコーディオン オプション */
.options-accordion {
  margin-top: 20px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.accordion-summary {
  padding: 14px 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-weight: 700;
  user-select: none;
}

.summary-title {
  color: #e2e8f0;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.summary-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-left: 32px;
}

.accordion-content {
  padding: 14px 18px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.option-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 520px) {
  .option-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.option-item-full {
  grid-column: 1 / -1;
}

.option-item label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.option-item select,
.option-item input[type="number"] {
  width: 100%;
  background: #0f1715;
  border: 1px solid #334155;
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
}

.date-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.date-inputs input {
  width: 70px;
  text-align: center;
}

.radio-pill-group {
  display: flex;
  gap: 8px;
}

.pill-radio {
  flex: 1;
  position: relative;
  cursor: pointer;
}

.pill-radio input {
  position: absolute;
  opacity: 0;
}

.pill-radio span {
  display: block;
  text-align: center;
  padding: 8px;
  background: #0f1715;
  border: 1px solid #334155;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-sub);
  transition: all 0.2s ease;
}

.pill-radio input:checked + span {
  background: var(--accent-green-dark);
  color: #fff;
  border-color: var(--accent-green);
}

/* 発券アクションボタン */
.action-btn-area {
  margin-top: 28px;
  text-align: center;
}

.btn-generate {
  position: relative;
  width: 100%;
  padding: 18px 24px;
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 50%, #dc2626 100%);
  border: none;
  border-radius: 14px;
  color: #ffffff;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(234, 88, 12, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(234, 88, 12, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4);
}

.btn-generate:active {
  transform: translateY(1px);
}

.btn-flare {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: flareAnim 3s infinite;
}

@keyframes flareAnim {
  0% { left: -100%; }
  40% { left: 150%; }
  100% { left: 150%; }
}

/* ===================================================
   スロット回転演出オーバーレイ
   =================================================== */
.slot-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.slot-overlay.hidden {
  display: none;
}

.slot-modal {
  background: #111827;
  border: 3px solid var(--accent-gold);
  border-radius: 20px;
  width: 100%;
  max-width: 440px;
  padding: 24px;
  box-shadow: 0 0 50px var(--accent-gold-glow), inset 0 0 20px rgba(0, 0, 0, 0.8);
  text-align: center;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.slot-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.slot-lamp {
  font-size: 1.2rem;
  color: #ef4444;
  animation: blink 0.25s infinite alternate;
}

.lamp-right {
  animation-delay: 0.12s;
}

@keyframes blink {
  0% { opacity: 0.2; color: #ef4444; }
  100% { opacity: 1; color: #fbbf24; text-shadow: 0 0 10px #fbbf24; }
}

.slot-title {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--accent-gold-light);
  letter-spacing: 0.1em;
}

.slot-machine {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 16px;
  background: #000;
  border-radius: 14px;
  border: 2px solid #374151;
  box-shadow: inset 0 6px 12px rgba(0, 0, 0, 0.9);
}

.slot-reel {
  width: 80px;
  height: 90px;
  background: linear-gradient(to bottom, #1f2937 0%, #374151 50%, #1f2937 100%);
  border-radius: 8px;
  border: 2px solid #4b5563;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slot-strip {
  font-family: var(--font-mono);
  font-size: 2.8rem;
  font-weight: 900;
  color: #38bdf8;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.8);
}

.slot-strip.spinning {
  animation: reelSpin 0.1s linear infinite;
}

@keyframes reelSpin {
  0% { transform: translateY(-50px); opacity: 0.5; filter: blur(2px); }
  50% { transform: translateY(0); opacity: 1; filter: blur(0px); }
  100% { transform: translateY(50px); opacity: 0.5; filter: blur(2px); }
}

.slot-message {
  font-size: 0.92rem;
  color: #94a3b8;
  font-weight: 700;
}

/* ===================================================
   リアル馬券カード発券エリア
   =================================================== */
.result-section {
  margin-top: 36px;
}

.result-section.hidden {
  display: none;
}

.ticket-dispenser {
  position: relative;
  background: #0b1210;
  border-radius: 20px;
  padding: 30px 16px 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 4px 16px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.printer-slot {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 85%;
  height: 8px;
  background: #030706;
  border-radius: 4px;
  box-shadow: inset 0 2px 4px #000, 0 1px 0 rgba(255, 255, 255, 0.1);
}

.printer-light {
  width: 20px;
  height: 3px;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  border-radius: 2px;
  margin: 2px auto;
  animation: pulseLight 1s infinite alternate;
}

@keyframes pulseLight {
  from { opacity: 0.3; }
  to { opacity: 1; }
}

/* JRA風リアル馬券 */
.jra-ticket {
  position: relative;
  background-color: #f6f7f2;
  background-image: 
    repeating-linear-gradient(45deg, rgba(20, 110, 80, 0.03) 0, rgba(20, 110, 80, 0.03) 2px, transparent 0, transparent 8px),
    linear-gradient(to bottom, #fcfdf9, #eef1ea);
  color: #1a1a1a;
  border-radius: 6px;
  padding: 24px 20px 18px;
  margin: 10px auto 0;
  max-width: 480px;
  box-shadow: 
    0 10px 25px rgba(0, 0, 0, 0.5),
    0 1px 3px rgba(0, 0, 0, 0.3),
    inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  border-left: 6px solid #2e7d32; /* JRAグリーンの帯 */
  overflow: hidden;
  transform-origin: top center;
}

/* 発券アニメーション */
.jra-ticket.printing {
  animation: printTicket 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes printTicket {
  0% {
    transform: translateY(-80px) scale(0.92);
    opacity: 0;
    clip-path: inset(0 0 100% 0);
  }
  40% {
    opacity: 1;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
    clip-path: inset(0 0 0% 0);
  }
}

/* 的中祈願朱肉スタンプ */
.stamp-mark {
  position: absolute;
  top: 30px;
  right: 25px;
  color: #c92a2a;
  border: 4px double #c92a2a;
  padding: 6px 14px;
  font-family: var(--font-stamp);
  font-size: 1.6rem;
  font-weight: 900;
  border-radius: 8px;
  background: rgba(201, 42, 42, 0.04);
  letter-spacing: 0.15em;
  pointer-events: none;
  opacity: 0;
  transform: rotate(-14deg) scale(2);
  z-index: 10;
}

.stamp-mark.stamped {
  animation: stampDown 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes stampDown {
  0% {
    opacity: 0;
    transform: rotate(-14deg) scale(2.5);
  }
  70% {
    opacity: 0.95;
    transform: rotate(-14deg) scale(0.95);
  }
  100% {
    opacity: 0.85;
    transform: rotate(-14deg) scale(1);
  }
}

/* 馬券ヘッダー */
.ticket-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  border-bottom: 1px dashed #99a59e;
  padding-bottom: 8px;
}

.ticket-logo {
  display: flex;
  flex-direction: column;
}

.logo-circle {
  font-family: var(--font-ticket);
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: #1b5e20;
}

.logo-sub {
  font-size: 0.65rem;
  font-weight: 700;
  color: #556b2f;
}

.ticket-date-time {
  font-size: 0.72rem;
  font-weight: 700;
  color: #4b5563;
  text-align: right;
  line-height: 1.4;
}

/* レースタイトル */
.ticket-race-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.race-round {
  font-family: var(--font-ticket);
  font-size: 1.5rem;
  font-weight: 900;
  color: #0f172a;
}

.race-name {
  font-size: 1.15rem;
  font-weight: 900;
  color: #111827;
}

.race-cond {
  margin-left: auto;
  font-size: 0.78rem;
  color: #4b5563;
  font-weight: 700;
}

.ticket-divider {
  height: 2px;
  border-top: 1px solid #1f2937;
  border-bottom: 1px solid #1f2937;
  margin: 8px 0 12px;
}

/* 買い目テーブル */
.ticket-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.ticket-table th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 800;
  color: #4b5563;
  padding-bottom: 6px;
  border-bottom: 1px solid #d1d5db;
}

.ticket-table th.col-amount {
  text-align: right;
}

.ticket-table td {
  padding: 8px 0;
  vertical-align: middle;
  border-bottom: 1px dotted #e5e7eb;
}

.ticket-table tr:last-child td {
  border-bottom: none;
}

.ticket-table .col-type-val {
  font-weight: 900;
  font-size: 0.95rem;
  color: #15803d;
  width: 70px;
}

.ticket-table .col-combo-val {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 800;
}

.ticket-table .col-amount-val {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 900;
  color: #111827;
  white-space: nowrap;
}

/* 券種ごとのグループ区切り行 */
.ticket-table tr.ticket-group-row td {
  background: rgba(21, 128, 61, 0.08);
  padding: 6px 8px;
  border-bottom: 1px solid #cbd5e1;
  border-top: 2px solid #94a3b8;
}

.ticket-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.group-title {
  font-size: 0.85rem;
  font-weight: 900;
  color: #15803d;
  display: flex;
  align-items: center;
  gap: 6px;
}

.group-method-tag {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: #1e293b;
  color: #fbbf24;
  letter-spacing: 0.05em;
}

.group-subtotal {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  font-family: var(--font-mono);
}

.combo-desc-text {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 700;
  margin-right: 4px;
}

/* 組み合わせ内の馬番バッジ */
.badge-horse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 4px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 900;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

.combo-delim {
  color: #64748b;
  font-weight: 900;
}

/* 合計金額行 */
.ticket-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0 12px;
}

.ticket-count-summary {
  font-size: 0.88rem;
  font-weight: 800;
  color: #4b5563;
}

.ticket-count-summary span {
  font-size: 1.2rem;
  font-family: var(--font-mono);
  color: #111827;
}

.ticket-total-price {
  font-size: 1rem;
  font-weight: 800;
  color: #111827;
}

.price-yen {
  font-size: 1.1rem;
  margin-right: 2px;
}

#ticketTotalAmount {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 900;
  color: #b91c1c;
  letter-spacing: -0.02em;
}

/* バーコード・QRコード風装飾 */
.ticket-barcode-area {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px dashed #9ca3af;
  margin-top: 6px;
}

.mock-qr {
  width: 44px;
  height: 44px;
  background: #111827;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 4px;
  border-radius: 4px;
}

.qr-cell {
  background: #fff;
  border-radius: 1px;
}

.mock-barcode {
  flex: 1;
}

.barcode-lines {
  height: 26px;
  background-image: repeating-linear-gradient(
    90deg,
    #111827 0px,
    #111827 2px,
    transparent 2px,
    transparent 4px,
    #111827 4px,
    #111827 7px,
    transparent 7px,
    transparent 9px
  );
}

.barcode-num {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #4b5563;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.ticket-security {
  font-size: 0.55rem;
  font-weight: 800;
  color: #9ca3af;
  writing-mode: vertical-rl;
  letter-spacing: 0.1em;
}

/* アクションボタン群 */
.result-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 24px;
}

@media (min-width: 520px) {
  .result-actions {
    grid-template-columns: repeat(2, 1fr);
  }
  .btn-action-share {
    grid-column: 1 / -1;
  }
}

.btn-action-share {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border: none;
  padding: 15px 20px;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-action-share:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

.btn-action-download {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
  border: none;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(2, 132, 199, 0.35);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-action-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 16px rgba(2, 132, 199, 0.5);
}

.btn-action-x {
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-action-x:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.6);
  background: #111;
}

.btn-action-primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
  transition: all 0.2s ease;
}

.btn-action-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.5);
}

.btn-action-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f1f5f9;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-action-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

/* ===================================================
   発券後の導線UI改善
   =================================================== */

/* 結果エリア上部のクイック戻りバー */
.result-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-quick-edit {
  background: none;
  border: none;
  color: var(--accent-gold-light);
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.15s ease, color 0.15s ease;
}

.btn-quick-edit:hover {
  color: #fff;
  transform: translateY(-1px);
}

.quick-portal-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  transition: color 0.2s ease;
}

.quick-portal-link:hover {
  color: #fff;
}

/* アクションボタン内の条件変更ボタン */
.btn-action-edit {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #fff;
  border: none;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(217, 119, 6, 0.35);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-action-edit:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 16px rgba(217, 119, 6, 0.5);
}

/* 下部ツール一覧リンク */
.bottom-nav-links {
  text-align: center;
  margin-top: 18px;
}

.bottom-back-link {
  color: var(--text-sub);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
}

.bottom-back-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  transform: translateX(-2px);
}

/* 設定パネルのハイライトアニメーション */
.config-panel.highlight-pulse {
  animation: panelGlow 1.4s ease-out;
}

@keyframes panelGlow {
  0% {
    box-shadow: 0 0 0 4px var(--accent-gold), 0 12px 35px var(--accent-gold-glow);
    border-color: var(--accent-gold);
  }
  70% {
    box-shadow: 0 0 0 2px var(--accent-gold), 0 12px 30px var(--accent-gold-glow);
  }
  100% {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border-color: var(--bg-card-border);
  }
}

/* フローティング条件変更ボタン（画面右下に常駐） */
.floating-edit-btn {
  position: fixed;
  bottom: 24px;
  right: 20px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #111827;
  border: 2px solid #fff;
  padding: 10px 18px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 900;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 12px var(--accent-gold-glow);
  cursor: pointer;
  z-index: 990;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.floating-edit-btn:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 16px var(--accent-gold-glow);
}

.floating-edit-btn.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8) translateY(20px);
}

/* コピートースト */
.copy-toast {
  margin-top: 14px;
  background: #059669;
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
  animation: fadeIn 0.2s ease;
}

.copy-toast.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* フッター */
.app-footer {
  text-align: center;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.disclaimer {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 8px;
}

.copyright {
  font-size: 0.75rem;
  color: #475569;
}

