/* ============================================================
   ペンペンホッケー スタイル
   パステルアイス × ゆるかわポップ
============================================================ */

:root {
  --pink: #ff7fa8;
  --pink-dark: #e0557f;
  --pink-light: #ffe3ee;
  --blue: #58b9ff;
  --blue-dark: #2f8fdd;
  --blue-light: #ddf1ff;
  --ink: #2b4a63;
  --ink-soft: #5b7c94;
  --card: #ffffff;
  --shadow: 0 6px 0 rgba(110, 160, 200, 0.25);
}

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

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #cdeeff 0%, #eaf9ff 55%, #dff3fd 100%);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* ふわふわ雪 */
body::before {
  content: '';
  position: fixed; inset: -10% 0 0 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.9) 2px, transparent 3px),
    radial-gradient(circle, rgba(255,255,255,.6) 1.5px, transparent 2.5px),
    radial-gradient(circle, rgba(255,255,255,.75) 2.5px, transparent 3.5px);
  background-size: 190px 190px, 130px 130px, 260px 260px;
  background-position: 0 0, 40px 60px, 130px 20px;
  animation: snowfall 14s linear infinite;
  z-index: 1;
}
@keyframes snowfall {
  to { background-position: 60px 190px, 90px 190px, 190px 280px; }
}

#cv {
  position: fixed; inset: 0;
  z-index: 2;
  touch-action: none;
}

/* ===== 画面共通 ===== */
.screen {
  position: fixed; inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10;
  background: rgba(215, 240, 252, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  overflow-y: auto;
  overflow-x: hidden;
}
.screen.active { display: flex; }

.panel {
  background: var(--card);
  border-radius: 32px;
  box-shadow: 0 10px 0 rgba(110, 160, 200, 0.22), 0 24px 50px rgba(90, 150, 190, 0.25);
  padding: 28px 24px;
  width: min(420px, 100%);
  text-align: center;
  margin: auto;
}
.panel-wide { width: min(480px, 100%); }
.panel-title { font-size: 22px; font-weight: 900; margin-bottom: 14px; }

/* ===== タイトル =====
   タイトル画面はスクロール可能な縦積みにして、1画面目=ゲームUI(従来デザイン)、
   下にスクロールするとLP/SEO説明が現れる */
#screen-title { flex-direction: column; justify-content: flex-start; }
.title-view {
  min-height: calc(100vh - 32px);
  min-height: calc(100svh - 32px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px;
  width: 100%;
  flex-shrink: 0;
}
.title-view .panel { margin: 0; }
.lang-row {
  display: flex; gap: 10px; align-items: center;
  font-size: 12px; font-weight: 700; color: var(--ink-soft);
}
.lang-row a {
  color: var(--blue-dark);
  background: rgba(255,255,255,.8);
  border-radius: 999px;
  padding: 4px 12px;
  text-decoration: none;
}
.scroll-hint {
  font-size: 11.5px; font-weight: 700; color: var(--ink-soft);
  animation: hintBob 2s ease-in-out infinite;
}
@keyframes hintBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(4px); } }

.title-panel { padding-top: 12px; }
.title-penguin {
  font-size: 64px;
  animation: bob 2.2s ease-in-out infinite;
  filter: drop-shadow(0 6px 4px rgba(90,150,190,.3));
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-10px) rotate(4deg); }
}
.logo {
  font-size: 44px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 2px;
  color: var(--pink);
  text-shadow: 0 4px 0 rgba(224, 85, 127, 0.25);
  margin: 4px 0 8px;
}
.logo span { display: inline-block; animation: wiggle 2.6s ease-in-out infinite; }
.logo span:nth-child(2n) { animation-delay: .3s; }
.logo span:nth-child(3n) { animation-delay: .55s; }
.logo .l2 { color: var(--blue); text-shadow: 0 4px 0 rgba(47, 143, 221, 0.25); }
@keyframes wiggle {
  0%, 100% { transform: rotate(-3deg) translateY(0); }
  50% { transform: rotate(3deg) translateY(-3px); }
}
.tagline { font-size: 14px; font-weight: 700; color: var(--ink-soft); margin-bottom: 16px; }
.title-note { font-size: 11.5px; color: var(--ink-soft); margin-top: 14px; }

.name-row {
  display: flex; align-items: center; gap: 10px;
  background: #f1f9ff;
  border-radius: 18px;
  padding: 8px 14px;
  margin-bottom: 16px;
}
.name-label { font-size: 13px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
#input-name, #input-name-join {
  flex: 1; min-width: 0;
  border: none; outline: none;
  background: transparent;
  font: inherit; font-size: 17px; font-weight: 700;
  color: var(--ink);
}

/* ===== ボタン ===== */
.menu { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.btn {
  font: inherit;
  font-weight: 900;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  border: 3px solid #d9ecf7;
  border-radius: 999px;
  padding: 12px 20px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(110,160,200,.25); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-big { font-size: 18px; padding: 15px 20px; }
.btn-pink { background: linear-gradient(180deg, #ff9dbd, var(--pink)); color: #fff; border-color: var(--pink); box-shadow: 0 6px 0 var(--pink-dark); }
.btn-pink:active { box-shadow: 0 2px 0 var(--pink-dark); }
.btn-blue { background: linear-gradient(180deg, #83ccff, var(--blue)); color: #fff; border-color: var(--blue); box-shadow: 0 6px 0 var(--blue-dark); }
.btn-blue:active { box-shadow: 0 2px 0 var(--blue-dark); }
.btn-white { background: #fff; }
.btn-mini { font-size: 13px; padding: 7px 14px; box-shadow: 0 3px 0 rgba(110,160,200,.25); }

/* ===== ソロ設定 ===== */
.pick-label { font-size: 13px; font-weight: 700; color: var(--ink-soft); margin: 14px 0 8px; }
.pick-row { display: flex; gap: 10px; justify-content: center; margin-bottom: 6px; }
.pick {
  flex: 1;
  font: inherit; font-weight: 900; font-size: 15px;
  color: var(--ink-soft);
  background: #f1f9ff;
  border: 3px solid #e0eef8;
  border-radius: 20px;
  padding: 12px 6px;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 2px; align-items: center;
}
.pick small { font-size: 10.5px; font-weight: 700; opacity: .75; }
.pick.sel {
  color: #fff;
  background: linear-gradient(180deg, #83ccff, var(--blue));
  border-color: var(--blue-dark);
  box-shadow: 0 4px 0 var(--blue-dark);
}
#pick-format { margin-bottom: 2px; }
.pick-row + .menu { margin-top: 20px; }

/* ===== 参加 ===== */
.code-input {
  width: 220px;
  font: inherit; font-size: 38px; font-weight: 900;
  text-align: center; letter-spacing: 10px;
  color: var(--ink);
  background: #f1f9ff;
  border: 3px solid #d9ecf7;
  border-radius: 20px;
  padding: 10px 0 10px 10px;
  outline: none;
  margin: 6px 0 18px;
  text-transform: uppercase;
}
.code-input:focus { border-color: var(--blue); }

/* ===== ロビー ===== */
.code-box {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  flex-wrap: wrap;
  background: #f1f9ff;
  border-radius: 18px;
  padding: 10px 12px;
  margin-bottom: 16px;
}
.code-label { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.code-value { font-size: 30px; font-weight: 900; letter-spacing: 6px; color: var(--ink); }

.teams { display: flex; gap: 8px; align-items: stretch; }
.team-col { flex: 1; min-width: 0; }
.vs { align-self: center; font-weight: 900; font-size: 15px; color: var(--ink-soft); }
.team-head {
  font-size: 14px; font-weight: 900; color: #fff;
  border-radius: 14px; padding: 6px;
  margin-bottom: 8px;
}
.head-0 { background: linear-gradient(180deg, #ff9dbd, var(--pink)); }
.head-1 { background: linear-gradient(180deg, #83ccff, var(--blue)); }
.team-list { display: flex; flex-direction: column; gap: 8px; min-height: 118px; }

.lobby-card {
  position: relative;
  display: flex; align-items: center; gap: 4px;
  background: #f6fbff;
  border: 2.5px solid #e0eef8;
  border-radius: 16px;
  padding: 9px 8px;
  font-size: 13px; font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.lobby-card.team-0 { border-color: var(--pink-light); background: #fff6f9; }
.lobby-card.team-1 { border-color: var(--blue-light); background: #f4faff; }
.lobby-card.me { outline: 3px solid var(--pink); outline-offset: -1px; }
.lobby-card.team-1.me { outline-color: var(--blue); }
.lobby-card .pengy { font-size: 18px; }
.lobby-card .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-card .lv {
  flex-shrink: 0;
  font-size: 9px; font-weight: 900; color: #fff;
  background: var(--ink-soft);
  border-radius: 8px; padding: 2px 5px;
}
.tag-you, .tag-host {
  flex-shrink: 0;
  font-size: 9px; font-weight: 900; color: #fff;
  border-radius: 8px; padding: 2px 5px;
}
.tag-you { background: var(--pink); }
.tag-host { background: var(--blue); }
.cpu-del {
  position: absolute;
  top: -8px; right: -8px;
  border: 2px solid #fff;
  background: #ffd7e2;
  color: var(--pink-dark);
  font-weight: 900; font-size: 11px;
  width: 22px; height: 22px;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
}
.lobby-add {
  font: inherit; font-size: 13px; font-weight: 900;
  color: var(--ink-soft);
  background: transparent;
  border: 2.5px dashed #bcd9ec;
  border-radius: 16px;
  padding: 10px;
  cursor: pointer;
}
.lobby-add:active { background: #eaf6ff; }
.lobby-empty {
  font-size: 12px; color: #9db8c9; font-weight: 700;
  border: 2.5px dashed #dcecf6;
  border-radius: 16px;
  padding: 12px;
}
.lobby-opt { margin-top: 4px; }
.lobby-opt .pick-label { margin: 10px 0 6px; }
.lobby-opt .pick { padding: 8px 4px; font-size: 13px; border-radius: 16px; }
/* ゲストは見るだけ（選択中だけくっきり表示） */
.lobby-opt.ro .pick { pointer-events: none; opacity: .5; }
.lobby-opt.ro .pick.sel { opacity: 1; }

.lobby-hint { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); margin: 14px 0; }
.lobby-wait { font-size: 13.5px; font-weight: 700; color: var(--ink-soft); }

/* ===== HUD ===== */
#hud {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 5;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 10px 12px 0;
  pointer-events: none;
}
#hud.hidden { display: none; }
.scoreboard {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.92);
  border-radius: 22px;
  padding: 7px 16px 9px;
  box-shadow: 0 4px 0 rgba(110,160,200,.22);
}
.badge {
  position: relative;
  display: flex; align-items: center; gap: 6px;
  font-size: 24px; font-weight: 900;
  padding: 0 6px;
}
.badge-0 span { color: var(--pink-dark); }
.badge-1 span { color: var(--blue-dark); }
.badge .you {
  position: absolute; left: 50%; bottom: -13px;
  transform: translateX(-50%);
  font-style: normal;
  font-size: 9px; font-weight: 900; color: #fff;
  background: var(--ink-soft);
  border-radius: 8px;
  padding: 1px 7px;
  white-space: nowrap;
}
.badge.mine .you { background: var(--ink); }
.score-mid { font-size: 10.5px; font-weight: 900; color: var(--ink-soft); }
.quit {
  position: fixed; top: 12px; right: 12px;
  pointer-events: auto;
}

/* ===== オーバーレイ ===== */
.ov-count {
  position: fixed; inset: 0;
  z-index: 6;
  display: none;
  align-items: center; justify-content: center;
  font-size: 110px; font-weight: 900;
  color: #fff;
  text-shadow: 0 6px 0 rgba(47, 143, 221, .5), 0 12px 30px rgba(47,143,221,.35);
  pointer-events: none;
}
.ov-count.show { display: flex; }
.ov-count.pop { animation: countPop .5s ease; }
@keyframes countPop {
  0% { transform: scale(1.7); opacity: 0; }
  60% { transform: scale(.95); opacity: 1; }
  100% { transform: scale(1); }
}

.ov-goal {
  position: fixed; inset: 0;
  z-index: 6;
  display: none;
  flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
  pointer-events: none;
}
.ov-goal.show { display: flex; animation: goalIn .45s cubic-bezier(.2, 1.6, .4, 1); }
.goal-word {
  font-size: 66px; font-weight: 900; color: #fff;
  text-shadow: 0 5px 0 rgba(224,85,127,.55), 0 14px 30px rgba(224,85,127,.4);
  letter-spacing: 4px;
}
.goal-team {
  font-size: 22px; font-weight: 900;
  background: rgba(255,255,255,.94);
  border-radius: 999px;
  padding: 6px 20px;
  box-shadow: 0 4px 0 rgba(110,160,200,.25);
}
@keyframes goalIn {
  0% { transform: scale(.3) rotate(-8deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

/* ===== リザルト ===== */
.result-emoji { font-size: 58px; animation: bob 2s ease-in-out infinite; }
.result-title { font-size: 25px; font-weight: 900; margin: 6px 0 2px; }
.result-sub { font-size: 13.5px; font-weight: 700; color: var(--ink-soft); margin-bottom: 10px; }
.result-score {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  font-size: 42px; font-weight: 900;
  margin-bottom: 18px;
}
.result-score .dash { font-size: 26px; color: var(--ink-soft); }

/* ===== トースト ===== */
#toast {
  position: fixed;
  left: 50%; bottom: 26px;
  transform: translateX(-50%) translateY(20px);
  z-index: 30;
  background: rgba(43, 74, 99, .93);
  color: #fff;
  font-size: 14px; font-weight: 700;
  border-radius: 999px;
  padding: 10px 22px;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  pointer-events: none;
  max-width: 88vw;
  text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== LP / SEO セクション（タイトル画面の下部） ===== */
.lp {
  width: min(760px, 100%);
  margin: 6px auto 48px;
  display: flex; flex-direction: column; gap: 18px;
  text-align: left;
}
.lp-card {
  background: var(--card);
  border-radius: 26px;
  box-shadow: 0 8px 0 rgba(110, 160, 200, 0.18), 0 18px 40px rgba(90, 150, 190, 0.18);
  padding: 26px 24px;
}
.lp-card h2 {
  font-size: 19px; font-weight: 900; color: var(--ink);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.lp-card h3 { font-size: 15px; font-weight: 900; color: var(--blue-dark); margin: 18px 0 6px; }
.lp-card h3:first-of-type { margin-top: 0; }
.lp-card p { font-size: 14px; line-height: 1.95; color: var(--ink); }
.lp-card p + p { margin-top: 10px; }
.lp-card ul { padding-left: 1.4em; font-size: 14px; line-height: 1.95; color: var(--ink); }
.lp-steps { display: flex; flex-direction: column; gap: 14px; }
.lp-step { display: flex; gap: 12px; align-items: flex-start; }
.lp-step-num {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(180deg, #83ccff, var(--blue));
  color: #fff; font-weight: 900; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  margin-top: 2px;
}
.lp-step h3 { margin: 0 0 2px; }
.lp-step p { font-size: 13.5px; color: var(--ink-soft); }
.faq-item { border: 2.5px solid #e0eef8; border-radius: 16px; background: #fbfeff; }
.faq-item + .faq-item { margin-top: 10px; }
.faq-item summary {
  cursor: pointer; font-weight: 900; font-size: 14px; color: var(--ink);
  padding: 13px 38px 13px 14px;
  list-style: none; position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '▾';
  position: absolute; right: 14px; top: 13px;
  color: var(--ink-soft);
  transition: transform .2s;
}
.faq-item[open] summary::after { transform: rotate(180deg); }
.faq-item p { padding: 0 14px 13px; font-size: 13.5px; line-height: 1.9; color: var(--ink-soft); }
.lp-links { display: flex; flex-wrap: wrap; gap: 10px; }
.lp-links a {
  font-size: 13px; font-weight: 700; color: var(--blue-dark);
  background: #f1f9ff;
  border: 2px solid #d9ecf7;
  border-radius: 999px;
  padding: 8px 16px;
  text-decoration: none;
}
.lp-footer { text-align: center; font-size: 12.5px; color: var(--ink-soft); line-height: 2; padding-bottom: 8px; }
.lp-footer a { color: inherit; }

/* 小さい画面の調整 */
@media (max-height: 640px) {
  .title-penguin { font-size: 44px; }
  .logo { font-size: 34px; }
  .panel { padding: 18px 18px; border-radius: 26px; }
}
