/* 画面設定(config.theme)の色は CSS 変数で差し替える。 */
:root {
  --primary: #06c755;
  --accent: #06c755;
  --bg: #ffffff;
  --text: #111111;
  --button-text: #ffffff;
  --muted: #6b7280;
  --line: #e5e7eb;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  /* 横向き表示でノッチ・ホームバーに隠れないよう、四辺すべてをセーフエリアで避ける */
  padding-top: env(safe-area-inset-top);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
}

[hidden] { display: none !important; }

.screen { max-width: 560px; margin: 0 auto; padding: 16px; }
.center { text-align: center; padding-top: 12vh; }

h1 { font-size: 1.5rem; line-height: 1.4; margin: 16px 0 8px; }
h2 { font-size: 1.125rem; margin: 24px 0 8px; padding-left: 8px; border-left: 4px solid var(--primary); }
p { margin: 8px 0; }

.kv { display: block; width: 100%; height: auto; border-radius: 12px; }
.period { color: var(--muted); font-size: 0.875rem; }
.spinner { display: inline-block; }

.button {
  display: block;
  width: 100%;
  min-height: 48px;
  margin: 16px 0;
  padding: 12px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--button-text);
  font-size: 1.0625rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.button.secondary { background: transparent; color: var(--text); border: 1px solid var(--line); font-weight: 500; }
.button:disabled { opacity: 0.5; cursor: default; }

.notice { margin: 16px 0; padding: 12px 16px; border-radius: 12px; background: #f3f4f6; }

.prizes { list-style: none; margin: 0; padding: 0; }
.prizes li { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.prizes img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; flex: none; }
.prize-name { font-weight: 700; }
.prize-note { color: var(--muted); font-size: 0.875rem; }

.rules { margin: 0; padding-left: 20px; color: var(--muted); font-size: 0.875rem; }

.links { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: center; margin: 24px 0 8px; font-size: 0.875rem; }
.links a { color: var(--muted); }

.result-prize { font-weight: 700; }
.code-label { margin-bottom: 0; color: var(--muted); font-size: 0.875rem; }
.code { margin: 0 0 8px; padding: 12px; border: 2px dashed var(--primary); border-radius: 12px; font-size: 1.375rem; font-weight: 700; letter-spacing: 0.04em; word-break: break-all; user-select: all; }
.result-next { color: var(--muted); }

/* ---- おみくじ ---- */
.odds { width: 100%; border-collapse: collapse; }
.odds th, .odds td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; font-weight: 400; }
.odds th { width: 50%; }
.odds td { text-align: right; font-variant-numeric: tabular-nums; }

.omikuji-card { display: block; width: 100%; max-width: 320px; height: auto; margin: 0 auto 8px; border-radius: 12px; }
.omikuji-rank { font-size: 2.5rem; line-height: 1.2; margin: 8px 0; letter-spacing: 0.08em; }
.omikuji-message { margin: 8px 0; text-align: left; }
.omikuji-lucky { margin: 8px 0 16px; padding: 8px 12px; border-radius: 12px; background: #f3f4f6; font-weight: 700; }

.bonus { margin: 16px 0; text-align: center; }
.bonus h2 { padding-left: 0; border-left: 0; }
.bonus-name { margin: 0; font-weight: 700; }
.bonus-image { display: block; max-width: 100%; max-height: 60vh; width: auto; height: auto; margin: 8px auto; border-radius: 12px; }
.bonus-hint, .bonus-note { margin: 4px 0; color: var(--muted); font-size: 0.875rem; }

@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
