/* 縁日ピン台 style.css */
:root { --accent: #d4502a; --accent-soft: #fbe3d6; --ep-night: #1b1238; --ep-wood: #5a3418; --ep-gold: #ffd36a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --accent: #ff8a55; --accent-ink: #1b1238; --accent-soft: #3a2230; } }
:root[data-theme="dark"] { --accent: #ff8a55; --accent-ink: #1b1238; --accent-soft: #3a2230; }

.ep-app { padding-top: 10px; }
.ep-screen > * + * { margin-top: 12px; }
.ep-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* タイトル */
.ep-hero { position: relative; border-radius: 18px; overflow: hidden; aspect-ratio: 16 / 10; background: var(--ep-night); box-shadow: var(--shadow); }
.ep-hero > video, .ep-hero > img, .ep-hero > canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ep-hero-txt { position: absolute; left: 0; right: 0; top: 0; padding: 14px 16px 34px; background: linear-gradient(rgba(16,8,30,.78), rgba(16,8,30,0)); color: #fff; }
.ep-hero-kicker { margin: 0; font-size: 12px; letter-spacing: .18em; font-weight: 700; color: var(--ep-gold); }
.ep-hero-title { margin: 0; font-size: clamp(34px, 11vw, 52px); font-weight: 900; line-height: 1.1; font-family: var(--font-serif); text-shadow: 0 3px 0 #8a1f10, 0 0 18px rgba(255,140,60,.6); }
.ep-hero-sub { margin: 4px 0 0; font-size: 14px; font-weight: 700; text-shadow: 0 1px 3px #000; }
.ep-btn-daily { border-color: var(--accent); color: var(--accent); font-weight: 800; }
.ep-friend .mn-btn { margin-top: 8px; }

/* 台えらび */
.ep-boards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 520px) { .ep-boards { grid-template-columns: repeat(3, 1fr); } }
.ep-board { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; min-height: 92px; padding: 10px 12px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; font: inherit; color: inherit; line-height: 1.35; }
.ep-board b { font-size: 15px; }
.ep-board.is-clear { border-color: var(--accent); }
.ep-board.is-locked { opacity: .55; cursor: default; }
.ep-board-no { font-size: 11px; color: var(--text-sub); font-weight: 700; }
.ep-board-stars { color: #e0a000; font-size: 15px; letter-spacing: .05em; }
.ep-board.is-locked .ep-board-stars { color: var(--text-sub); font-size: 12px; }
.ep-board-new { font-size: 11px; font-weight: 700; color: var(--accent); }

/* 物語 */
.ep-scene { border-radius: 16px; overflow: hidden; background: linear-gradient(135deg, #2a1a48, #6a2a3a); aspect-ratio: 16 / 9; }
.ep-scene img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ep-scene:empty { aspect-ratio: auto; height: 8px; }
.ep-novel-h { font-family: var(--font-serif); font-size: 22px; }
.ep-novel { font-family: var(--font-serif); font-size: 16.5px; line-height: 2; }
.ep-novel-p { margin: 0 0 .9em; animation: ep-fade .6s ease-out both; }
@keyframes ep-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 仲間 */
.ep-face { flex: none; width: 52px; height: 52px; border-radius: 50%; overflow: hidden; background: #f6e3c4; display: inline-flex; align-items: center; justify-content: center; font-size: 26px; border: 2px solid var(--ep-wood); }
.ep-face img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 8%; transform: scale(1.35); transform-origin: 50% 0; }
.ep-fpick { display: flex; gap: 12px; align-items: center; }
.ep-fline { font-style: normal; color: var(--accent) !important; }
.ep-friends { display: grid; gap: 8px; }
.ep-fcard { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.ep-fcard.is-none { opacity: .5; }

/* プレイ */
.ep-play { display: flex; flex-direction: column; align-items: center; }
.ep-play > * + * { margin-top: 8px; }
.ep-hud { width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; background: var(--ep-night); color: #fff; border-radius: 12px; padding: 6px 10px; min-height: 52px; }
.ep-hud-l { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ep-hud-name { font-size: 11px; font-weight: 700; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-balls { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; min-height: 12px; }
.ep-balls i { width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, #a9d4f5 55%, #4f84ad); display: block; }
.ep-hud-c { display: flex; align-items: center; gap: 4px; font-size: 22px; font-weight: 900; color: #ff8a6a; }
.ep-lan { width: 16px; height: 20px; border-radius: 45%; background: #e2432a; box-shadow: 0 0 10px #ff7a3d; display: inline-block; }
.ep-hud-r { text-align: right; line-height: 1.2; }
.ep-score { font-size: 18px; font-variant-numeric: tabular-nums; }
.ep-mult { display: inline-block; font-weight: 900; font-size: 12px; padding: 0 6px; border-radius: 6px; background: #444; margin-right: 4px; }
.ep-m2 { background: #2b7bd0; } .ep-m3 { background: #2b9a66; } .ep-m5 { background: #d08a10; } .ep-m8 { background: #d43a2a; }
.ep-next { font-size: 10px; opacity: .8; }
.ep-cvwrap { position: relative; line-height: 0; }
.ep-cv { display: block; border-radius: 10px; touch-action: none; box-shadow: 0 4px 18px rgba(0,0,0,.3); cursor: crosshair; }
.ep-tip { position: absolute; left: 8%; right: 8%; top: 18%; background: rgba(255,250,235,.95); color: #3a2010; border-radius: 12px; padding: 10px 12px; font-size: 14px; font-weight: 700; line-height: 1.5; text-align: center; box-shadow: 0 4px 14px rgba(0,0,0,.3); pointer-events: none; animation: ep-bob 1.4s ease-in-out infinite; }
@keyframes ep-bob { 50% { transform: translateY(-4px); } }
.ep-ctrl { display: grid; grid-template-columns: 64px 1fr 64px; gap: 8px; width: 100%; max-width: 470px; }
.ep-nudge { min-height: 56px; font-size: 20px; padding: 0; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.ep-fire { min-height: 56px; font-size: 22px; font-weight: 900; letter-spacing: .1em; }
.ep-skill { width: 100%; max-width: 470px; justify-content: flex-start; gap: 10px; min-height: 52px; padding: 4px 12px; text-align: left; line-height: 1.3; }
.ep-skill .ep-face { width: 40px; height: 40px; font-size: 20px; }
.ep-skill small { display: block; font-size: 11px; color: var(--text-sub); }
.ep-skill.is-armed { border-color: var(--accent); background: var(--accent-soft); animation: ep-bob 1s ease-in-out infinite; }
.ep-skill.is-used:disabled { opacity: .4; }

/* 結果 */
.ep-res-line { font-size: 20px; }
.ep-res-stars { font-size: 40px; color: #e8a800; letter-spacing: .08em; line-height: 1; }
.ep-gift { display: flex; gap: 12px; align-items: center; border-color: var(--accent); }
.ep-z-ic { font-size: 30px; flex: none; }
.ep-res-btns > * + * { margin-top: 8px; }
.ep-sharebox { border: 1px solid var(--line); border-radius: 14px; padding: 10px; background: var(--surface); }
.ep-card-prev { width: 100%; border-radius: 8px; display: block; margin-bottom: 8px; }

/* 図鑑 */
.ep-zukan { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.ep-z { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 13px; line-height: 1.4; }
.ep-z.is-none { opacity: .5; }

@media (prefers-reduced-motion: reduce) { .ep-tip, .ep-skill.is-armed { animation: none; } }
.ep-novel-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ep-novel-top .mn-kicker { margin: 0; }
.ep-skipbtn { min-height: 44px; padding: 6px 14px; font-size: 14px; }
.ep-novel-sep { text-align: center; color: var(--text-sub); }
.ep-toast { position: fixed; left: 50%; top: 62px; font-size: 13px !important; transform: translateX(-50%); background: #2a1638; color: #ffe6b0; padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 700; z-index: 1000; box-shadow: 0 4px 14px rgba(0,0,0,.3); transition: opacity .4s; max-width: calc(100% - 32px); }
.ep-toast.out { opacity: 0; }
.ep-z-ic img { width: 44px; height: 44px; object-fit: contain; display: block; }
.ep-gift .ep-z-ic img { width: 56px; height: 56px; }
.ep-board-thumb { float: right; width: 40px; height: 60px; border-radius: 4px; margin: -2px -4px 0 6px; }
.ep-board { display: block; }
.ep-board > span, .ep-board > b { display: block; }
.ep-newwaza { font-size: 14px; font-weight: 700; color: var(--accent); margin: 0; }
