/* サッカー人生スロット: 見た目（芝のピッチと、白いチョークの作戦ボードがテーマ） */
:root {
  --turf: #0b2e1b;
  --turf2: #0f3a23;
  --chalk: #f4f7f2;
  --chalk-dim: rgba(244, 247, 242, .62);
  --line: rgba(244, 247, 242, .18);
  --lime: #d4ff3a;
  --ink: #06170e;
  --c-white: #8aa294;
  --c-blue: #3aa6ff;
  --c-green: #3fe07a;
  --c-red: #ff4f4f;
  --c-gold: #ffc531;
  --font-title: "Dela Gothic One", "M PLUS 1p", sans-serif;
  --font-num: "Oswald", "M PLUS 1p", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "M PLUS 1p", "Hiragino Sans", sans-serif;
  color: var(--chalk);
  background: var(--turf);
  /* 芝の刈り目（太いしま模様） */
  background-image: repeating-linear-gradient(180deg, var(--turf) 0 56px, var(--turf2) 56px 112px);
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.app {
  max-width: 440px; margin: 0 auto; height: 100dvh; position: relative; overflow-y: auto;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
}
.screen { display: none; flex: 1 0 auto; flex-direction: column; }
/* プレイ画面はスクロールさせず、1画面に収める */
#play.active { flex: 1 1 auto; min-height: 0; height: 100%; }
/* PC: スマホと同じ縦長の枠を真ん中に置く */
@media (min-width: 600px) {
  body { display: flex; align-items: center; justify-content: center; min-height: 100dvh; }
  .app {
    width: 440px; height: min(920px, calc(100dvh - 48px)); margin: 24px auto;
    border: 1.5px solid var(--line); border-radius: 36px;
    background: rgba(3, 18, 10, .6); box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
    padding: 20px 20px 18px;
  }
}
.screen.active { display: flex; animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

/* ---------- 共通の部品 ---------- */
.kicker { font-size: 12px; letter-spacing: .12em; color: var(--chalk-dim); text-align: center; margin-top: 8px; }
.kicker b { color: var(--lime); font-family: var(--font-num); font-size: 15px; letter-spacing: .04em; }
.h2 { font-family: var(--font-title); font-weight: 400; font-size: 26px; text-align: center; margin: 8px 0 4px; line-height: 1.3; }
.h3 { font-family: var(--font-title); font-weight: 400; font-size: 20px; margin-bottom: 12px; }
.sub { text-align: center; color: var(--chalk-dim); font-size: 13px; }
.note { text-align: center; color: var(--chalk-dim); font-size: 12px; margin-top: 12px; }
.btn-main {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  width: 100%; min-height: 60px; margin-top: 20px; border-radius: 14px;
  background: var(--lime); color: var(--ink); font-weight: 800; font-size: 19px;
  box-shadow: 0 5px 0 #8ab000; transition: transform .08s;
}
.btn-main small { font-size: 11px; font-weight: 700; opacity: .7; }
.btn-main:active { transform: translateY(3px); box-shadow: 0 2px 0 #8ab000; }
.btn-sub { flex: 1; min-height: 46px; border-radius: 12px; border: 1.5px solid var(--line); font-weight: 700; font-size: 14px; background: rgba(0, 0, 0, .2); }
.link { display: block; margin: 14px auto 0; color: var(--chalk-dim); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; padding: 6px; }

/* ---------- スタート画面 ---------- */
#start { position: relative; }
.pitch-deco { position: absolute; inset: 0; pointer-events: none; overflow: hidden; opacity: .5; }
.pitch-deco .circle { position: absolute; width: 300px; height: 300px; border: 2px solid var(--line); border-radius: 50%; left: 50%; top: 118px; transform: translate(-50%, -50%); }
.pitch-deco .line { position: absolute; left: 0; right: 0; top: 118px; border-top: 2px solid var(--line); }
.logo { position: relative; text-align: center; margin: 34px 0 12px; font-family: var(--font-title); font-weight: 400; line-height: 1.05; }
.logo span { display: block; font-size: 28px; letter-spacing: .06em; }
.logo .big { font-size: 64px; color: var(--lime); letter-spacing: .02em; text-shadow: 0 4px 0 rgba(0, 0, 0, .35); transform: rotate(-3deg); }
.lead { position: relative; text-align: center; font-size: 14px; color: var(--chalk-dim); margin-bottom: 18px; }
.lead b { color: var(--chalk); white-space: nowrap; }
.form { position: relative; background: rgba(0, 0, 0, .28); border: 1.5px solid var(--line); border-radius: 18px; padding: 18px 16px; }
.field-label { font-size: 12px; color: var(--chalk-dim); margin: 14px 0 6px; font-weight: 700; }
.field-label:first-child { margin-top: 0; }
#name { width: 100%; height: 48px; border-radius: 12px; border: 1.5px solid var(--line); background: rgba(0, 0, 0, .3); color: var(--chalk); padding: 0 14px; font: inherit; font-size: 16px; }
#name:focus { outline: 2px solid var(--lime); outline-offset: 1px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg.three { grid-template-columns: repeat(3, 1fr); }
.seg button { height: 46px; border-radius: 12px; border: 1.5px solid var(--line); font-weight: 700; background: rgba(0, 0, 0, .2); }
.seg button.on { background: var(--chalk); color: var(--ink); border-color: var(--chalk); }

/* ---------- プレイ画面 ---------- */
.board { flex: none; background: rgba(0, 0, 0, .35); border: 1.5px solid var(--line); border-radius: 16px; padding: 10px 14px 8px; }
.board-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.year { font-family: var(--font-title); font-size: 24px; line-height: 1.1; }
.team { font-size: 12px; color: var(--chalk-dim); margin-top: 4px; }
.board-right { display: flex; align-items: center; gap: 8px; }
.badge { font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 99px; background: var(--chalk); color: var(--ink); white-space: nowrap; }
.badge.out { background: transparent; color: var(--chalk-dim); border: 1px solid var(--line); }
.badge.bench { background: #6c8577; color: var(--chalk); }
.badge.ace { background: var(--lime); }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--line); font-size: 15px; }
.icon-btn.off { opacity: .35; text-decoration: line-through; }
.progress { display: flex; gap: 3px; margin-top: 10px; }
.progress i { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.progress i.done { background: var(--chalk); }
.progress i.now { background: var(--lime); }
.progress i.gap { flex: .35; background: transparent; }
.progress-labels { display: flex; gap: 3px; margin-top: 4px; font-size: 10px; color: var(--chalk-dim); font-weight: 700; }

.banner { position: absolute; left: 10px; right: 10px; top: 38px; z-index: 2; text-align: center; font-weight: 800; font-size: 14px; padding: 8px; border-radius: 12px; box-shadow: 0 6px 20px rgba(0, 0, 0, .4); }
.banner.rush { background: var(--lime); color: var(--ink); animation: blink .5s steps(2) 4; }
.banner.injury { background: var(--c-red); }
.banner.coach { background: var(--c-gold); color: var(--ink); }
.banner.info { background: rgba(0, 0, 0, .35); border: 1.5px solid var(--line); }
@keyframes blink { 50% { filter: brightness(1.4); } }

/* リールの大きな枠。画面の残りの高さをすべて使う */
.panel { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; position: relative; margin-top: 12px; padding: 10px; border: 1.5px solid var(--line); border-radius: 18px; background: rgba(0, 0, 0, .32); }
.panel-head { flex: none; text-align: center; font-size: 12px; font-weight: 800; letter-spacing: .12em; color: var(--chalk-dim); padding-bottom: 8px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.reels { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: 1fr 1fr; gap: 12px 8px; cursor: pointer; }
.reel-box { display: flex; flex-direction: column; min-height: 0; }
.reel-head { flex: none; display: flex; justify-content: space-between; align-items: baseline; gap: 4px; font-size: 11px; color: var(--chalk-dim); font-weight: 700; white-space: nowrap; }
.reel-head .val { font-family: var(--font-num); font-size: 14px; color: var(--chalk); }
.grade { font-family: var(--font-num); font-weight: 700; font-size: 20px; margin-right: 3px; }
/* 縦長のリール窓 */
.reel { flex: 1 1 auto; min-height: 56px; position: relative; overflow: hidden; margin-top: 6px; border-radius: 12px; background: linear-gradient(180deg, #04140b, #071d11); border: 1.5px solid var(--line); transition: border-color .2s, box-shadow .2s; }
.reel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(3, 16, 9, .85), transparent 28%, transparent 72%, rgba(3, 16, 9, .85)); pointer-events: none; }
.strip { position: absolute; left: 0; right: 0; top: 0; will-change: transform; }
.strip div { text-align: center; font-family: var(--font-num); font-weight: 700; font-size: clamp(32px, 11vw, 50px); }
/* 回す前の「?」は窓の真ん中に */
.strip.idle { bottom: 0; }
.strip.idle div { height: 100%; display: flex; align-items: center; justify-content: center; opacity: .5; }
.bar { flex: none; height: 4px; border-radius: 2px; background: var(--line); margin-top: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--chalk); transition: width .5s; }
/* 当たりの色 */
.c-white { color: var(--c-white); }
.c-blue { color: var(--c-blue); }
.c-green { color: var(--c-green); }
.c-red { color: var(--c-red); }
.c-gold { color: var(--c-gold); }
.c-rainbow { background: linear-gradient(90deg, #ff4f4f, #ffc531, #3fe07a, #3aa6ff, #c86bff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.reel-box.hit-blue .reel { border-color: var(--c-blue); }
.reel-box.hit-green .reel { border-color: var(--c-green); }
.reel-box.hit-red .reel { border-color: var(--c-red); box-shadow: 0 0 14px rgba(255, 79, 79, .45); }
.reel-box.hit-gold .reel { border-color: var(--c-gold); box-shadow: 0 0 18px rgba(255, 197, 49, .6); }
.reel-box.hit-rainbow .reel { border-color: #fff; box-shadow: 0 0 22px rgba(200, 107, 255, .7), 0 0 8px rgba(63, 224, 122, .6); animation: shake .4s; }
@keyframes shake { 25% { transform: rotate(-2deg); } 75% { transform: rotate(2deg); } }
.reels.rush .reel { border-color: var(--lime); }

.dock { flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding-top: 12px; }
.stat-label { font-size: 11px; color: var(--chalk-dim); font-weight: 700; }
.stat-num { font-family: var(--font-num); font-weight: 700; font-size: 44px; line-height: 1; }
.stat-num.small { font-size: 28px; }
.stat-num i { font-style: normal; font-size: 13px; margin-left: 2px; font-family: "M PLUS 1p"; }
.stat.right { text-align: right; }
/* 蹴るボタン（サッカーボール風） */
.kick {
  width: 104px; height: 104px; border-radius: 50%; position: relative;
  background: radial-gradient(circle at 35% 30%, #fff 0 45%, #dfe5e0 75%, #b9c4bc 100%);
  box-shadow: 0 6px 0 rgba(0, 0, 0, .45), 0 0 0 4px rgba(212, 255, 58, .0);
  transition: transform .1s, box-shadow .2s;
}
.kick::before { /* 黒い五角形の模様 */
  content: ""; position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; transform: translate(-50%, -50%);
  background: #111; clip-path: polygon(50% 0, 100% 38%, 81% 100%, 19% 100%, 0 38%);
}
.kick span { position: absolute; left: 0; right: 0; bottom: 12px; font-weight: 800; font-size: 13px; color: var(--ink); }
.kick:not(:disabled) { animation: pulse 1.6s ease-in-out infinite; }
.kick:active { transform: scale(.94) rotate(-20deg); }
.kick:disabled { opacity: .55; cursor: default; animation: none; }
.kick.spinning { animation: roll .6s linear infinite; opacity: 1; }
@keyframes pulse { 50% { box-shadow: 0 6px 0 rgba(0, 0, 0, .45), 0 0 0 8px rgba(212, 255, 58, .35); } }
@keyframes roll { to { transform: rotate(360deg); } }

/* ---------- 大会 ---------- */
.games { list-style: none; margin-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.games li { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-radius: 12px; background: rgba(0, 0, 0, .35); border: 1.5px solid var(--line); animation: fade .3s ease; }
.games li .score { font-family: var(--font-num); font-size: 20px; font-weight: 700; }
.games li.win .score { color: var(--lime); }
.games li.lose { border-color: rgba(255, 79, 79, .6); }
.games li.lose .score { color: var(--c-red); }
.result-line { text-align: center; font-family: var(--font-title); font-size: 22px; margin-top: 16px; color: var(--lime); }

/* ---------- 分かれ道 ---------- */
.offer { margin-top: 12px; text-align: center; padding: 12px; border-radius: 14px; background: var(--chalk); color: var(--ink); font-weight: 800; }
.options { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.opt { text-align: left; padding: 14px 16px; border-radius: 16px; border: 1.5px solid var(--line); background: rgba(0, 0, 0, .35); }
.opt:not(:disabled):hover { border-color: var(--lime); }
.opt b { display: block; font-size: 17px; }
.opt span { display: block; font-size: 12px; color: var(--chalk-dim); margin-top: 4px; }
.opt:disabled { opacity: .4; cursor: default; }
.opt .ng { color: var(--c-red); font-weight: 700; }

/* ---------- プロ生活 ---------- */
.pro-title { color: var(--lime); font-size: 34px; }
.table-wrap { margin-top: 12px; overflow: auto; max-height: 58dvh; border-radius: 14px; border: 1.5px solid var(--line); background: rgba(0, 0, 0, .35); }
.seasons { width: 100%; border-collapse: collapse; font-size: 12px; }
.seasons th { text-align: left; color: var(--chalk-dim); font-weight: 700; padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.seasons td { padding: 7px 6px; border-bottom: 1px solid rgba(244, 247, 242, .07); vertical-align: top; }
.seasons td.num { font-family: var(--font-num); font-size: 14px; text-align: right; }
.seasons tr { animation: fade .25s ease; }
.tier { display: inline-block; font-family: var(--font-num); font-size: 11px; padding: 0 5px; border-radius: 4px; margin-right: 4px; background: var(--line); }
.tier.J1 { background: var(--chalk); color: var(--ink); }
.tier.EU { background: var(--c-gold); color: var(--ink); }
.memo { color: var(--lime); font-weight: 700; }

/* ---------- 結果カード ---------- */
.card { margin-top: 12px; border-radius: 22px; padding: 20px 18px; position: relative; overflow: hidden; border: 3px solid; }
.card.bronze { border-color: #b67b4a; background: linear-gradient(160deg, #2b1d12, #10261a); }
.card.silver { border-color: #c9d3cf; background: linear-gradient(160deg, #2a3330, #10261a); }
.card.gold { border-color: var(--c-gold); background: linear-gradient(160deg, #4a3a0c, #10261a); }
.card.platinum { border-color: #bfe9ff; background: linear-gradient(160deg, #183846, #10261a 70%); box-shadow: 0 0 30px rgba(191, 233, 255, .35); }
.card.legend { border-color: transparent; background: linear-gradient(#0d1a14, #0d1a14) padding-box, linear-gradient(120deg, #ff4f4f, #ffc531, #3fe07a, #3aa6ff, #c86bff) border-box; box-shadow: 0 0 36px rgba(200, 107, 255, .45); }
.card-rarity { font-family: var(--font-num); font-size: 12px; letter-spacing: .3em; color: var(--chalk-dim); }
.card-title { font-family: var(--font-title); font-size: 30px; line-height: 1.2; margin-top: 6px; }
.card-title.long { font-size: 24px; }
.card-name { font-size: 16px; font-weight: 800; margin-top: 6px; }
.card-name small { font-family: var(--font-num); font-size: 13px; margin-left: 6px; padding: 1px 6px; border-radius: 4px; background: var(--chalk); color: var(--ink); }
.card-big { display: flex; align-items: flex-end; gap: 14px; margin-top: 14px; }
.card-big .num { font-family: var(--font-num); font-size: 58px; font-weight: 700; line-height: .9; }
.card-big .lbl { font-size: 11px; color: var(--chalk-dim); }
.card-rank { font-size: 13px; font-weight: 700; }
.card-rank b { font-family: var(--font-num); font-size: 20px; }
.card-line { margin-top: 12px; font-size: 13px; line-height: 1.6; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chips span { font-size: 11px; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line); }
.card-abil { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin-top: 14px; font-size: 12px; }
.card-abil div { display: flex; justify-content: space-between; border-bottom: 1px solid rgba(244, 247, 242, .1); padding-bottom: 3px; }
.card-foot { margin-top: 14px; font-size: 11px; color: var(--chalk-dim); }
.share-row { display: flex; gap: 10px; margin-top: 14px; }

/* ---------- 確率と出典 ---------- */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.modal[hidden] { display: none; }
.modal-body { width: 100%; max-width: 440px; max-height: 86dvh; overflow-y: auto; background: #0d2618; border: 1.5px solid var(--line); border-radius: 20px 20px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
.src-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 14px; }
.src-table td { padding: 7px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.src-table td:last-child { text-align: right; font-family: var(--font-num); font-size: 15px; white-space: nowrap; }
.src-note { font-size: 12px; color: var(--chalk-dim); line-height: 1.7; margin-bottom: 14px; }
.src-note a { color: var(--lime); }

/* 縦が短い画面（小さめのスマホ）では下の部品を少し小さく */
@media (max-height: 700px) {
  .kick { width: 84px; height: 84px; }
  .stat-num { font-size: 36px; }
  .stat-num.small { font-size: 24px; }
  .year { font-size: 20px; }
}
@media (max-width: 360px) {
  .logo .big { font-size: 52px; }
  .kick { width: 92px; height: 92px; }
  .stat-num { font-size: 36px; }
}
