:root {
  --ink: #26334d;
  --muted: #7a8498;
  --bg: #fff8eb;
  --panel: #ffffff;
  --line: #e9e3da;
  --purple: #7458d6;
  --purple-soft: #eee9ff;
  --blue: #4d9bf5;
  --blue-soft: #e8f4ff;
  --mint: #49cda7;
  --mint-soft: #e6fbf4;
  --yellow: #ffd65a;
  --orange: #ff9858;
  --orange-soft: #fff0e6;
  --red: #f0656c;
  --red-soft: #ffebed;
  --shadow: 0 14px 36px rgba(56, 64, 91, .1);
  --shadow-strong: 0 22px 60px rgba(74, 72, 112, .16);
  --radius: 24px;
  --control-gap: 10px;
  --display: "Hiragino Maru Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  --body: "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 8%, rgba(255, 214, 90, .32), transparent 24rem),
    radial-gradient(circle at 92% 22%, rgba(93, 169, 255, .18), transparent 25rem),
    linear-gradient(180deg, #fffdf8 0%, #fff8eb 100%);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid rgba(77, 155, 245, .4);
  outline-offset: 3px;
}

.atmosphere { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.moon { position: absolute; width: 170px; height: 170px; right: -70px; top: 42px; border-radius: 44% 56% 62% 38%; background: rgba(255, 214, 90, .28); transform: rotate(22deg); }
.moon::before { content: ""; position: absolute; width: 72px; height: 72px; left: -42px; bottom: 8px; border-radius: 50%; background: rgba(73, 205, 167, .2); }
.moon::after { content: ""; position: absolute; width: 34px; height: 34px; left: 23px; top: -20px; border-radius: 50%; background: rgba(240, 101, 108, .18); }
.stars { position: absolute; inset: 0; opacity: .3; background-image: radial-gradient(circle, #7458d6 1.3px, transparent 1.8px); background-size: 58px 58px; mask-image: linear-gradient(to bottom, #000, transparent 72%); }
.mist { position: absolute; width: 360px; height: 110px; border-radius: 50%; filter: blur(30px); opacity: .16; }
.mist-a { left: -100px; bottom: 13%; background: var(--blue); }
.mist-b { right: -120px; bottom: 32%; background: var(--orange); }

.app-shell { position: relative; z-index: 1; width: min(100%, 760px); min-height: 100dvh; margin: 0 auto; }
.page { min-height: 100dvh; padding: max(18px, env(safe-area-inset-top)) 16px calc(112px + env(safe-area-inset-bottom)); }
.page-no-nav { padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
@keyframes arrive { from { opacity: 0; transform: translateY(8px); } }
.loading-screen { min-height: 100dvh; display: grid; place-content: center; justify-items: center; color: var(--muted); }
.brand-mark { width: 74px; height: 74px; display: grid; place-items: center; border: 3px solid var(--yellow); border-radius: 26px; color: var(--purple); font-family: var(--display); font-size: 31px; background: white; box-shadow: var(--shadow); transform: rotate(-4deg); }
.loading-title { margin: 22px 0 0; color: var(--ink); font-family: var(--display); font-size: 26px; }
.loading-copy { max-width: 380px; margin: 10px 24px 0; text-align: center; font-size: 12px; line-height: 1.8; }

.sound-choice {
  min-height: 100dvh;
  padding: max(28px, env(safe-area-inset-top)) 11px calc(28px + env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
}
.sound-choice-card {
  width: min(100%, 748px);
  position: relative;
  top: clamp(8px, 1.4vh, 20px);
  display: grid;
  justify-items: center;
  text-align: center;
  animation: sound-choice-arrive .5s cubic-bezier(.2,.8,.2,1) both;
}
.sound-choice-logo {
  margin-bottom: clamp(46px, 5.6vh, 60px);
  font-size: clamp(44px, 9.3vw, 94px);
  filter: drop-shadow(0 6px 10px rgba(81, 71, 112, .08));
}
.sound-choice h1 {
  margin: 0;
  color: #31466c;
  font-family: var(--display);
  font-size: clamp(18px, 3.2vw, 31px);
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
}
.sound-choice-actions {
  width: min(66.667%, 498px);
  margin-top: clamp(34px, 4.5vh, 53px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(9px, 1.7vw, 19px);
}
.sound-choice-button {
  min-width: 0;
  aspect-ratio: 2.15 / 1;
  border: 1.5px solid #9877f1;
  border-radius: 999px;
  padding: 0 clamp(9px, 2vw, 23px);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: clamp(9px, 1.7vw, 19px);
  color: #7654df;
  background: rgba(255,255,255,.82);
  box-shadow: 0 8px 16px rgba(92, 76, 151, .11);
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}
.sound-choice-button:hover { transform: translateY(-3px); border-color: #ad9ae9; box-shadow: 0 17px 34px rgba(72,64,109,.14); }
.sound-choice-button:active { transform: scale(.97); }
.sound-choice-on {
  color: white;
  border-color: #7756e5;
  background: linear-gradient(145deg, #a58bff 0%, #7959e8 54%, #6545d5 100%);
  box-shadow: 0 11px 19px rgba(79, 56, 169, .28), inset 0 0 0 1px rgba(255,255,255,.52), inset 0 5px 15px rgba(255,255,255,.14);
}
.sound-choice-on:hover { border-color: #7756e5; box-shadow: 0 14px 25px rgba(79, 56, 169, .33), inset 0 0 0 1px rgba(255,255,255,.52); }
.sound-choice-icon { width: clamp(25px, 4vw, 39px); height: clamp(25px, 4vw, 39px); display: grid; place-items: center; flex: 0 0 auto; }
.sound-choice-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sound-choice-icon svg path:first-child { fill: currentColor; stroke: currentColor; }
.sound-choice-button strong { font-family: var(--body); font-size: clamp(15px, 2.9vw, 27px); line-height: 1; font-weight: 700; letter-spacing: .02em; }
@keyframes sound-choice-arrive {
  from { opacity: 0; transform: translateY(10px); }
}

body.sound-choice-open {
  background:
    radial-gradient(circle at 7% 4%, rgba(255, 214, 90, .28), transparent 28rem),
    radial-gradient(circle at 93% 18%, rgba(93, 169, 255, .16), transparent 29rem),
    radial-gradient(circle at 7% 88%, rgba(93, 169, 255, .13), transparent 24rem),
    radial-gradient(circle at 92% 83%, rgba(255, 152, 88, .12), transparent 23rem),
    linear-gradient(180deg, #fffefb 0%, #fffaf3 100%);
}
body.sound-choice-open .moon {
  width: clamp(190px, 31vw, 340px);
  height: clamp(190px, 31vw, 340px);
  right: clamp(-160px, -14vw, -80px);
  top: clamp(45px, 6.2vw, 72px);
}
body.sound-choice-open .moon::before {
  width: clamp(78px, 12.5vw, 138px);
  height: clamp(78px, 12.5vw, 138px);
  left: clamp(-66px, -6vw, -30px);
  bottom: 24%;
}
body.sound-choice-open .moon::after {
  width: clamp(38px, 6.3vw, 70px);
  height: clamp(38px, 6.3vw, 70px);
  left: 28%;
  top: -15%;
}
body.sound-choice-open .stars {
  opacity: .22;
  background-size: clamp(70px, 10.4vw, 113px) clamp(70px, 10.4vw, 113px);
  mask-image: linear-gradient(to bottom, #000 0%, #000 72%, transparent 100%);
}

.word-logo { display: flex; align-items: center; font-family: var(--display); font-weight: 900; letter-spacing: -.08em; white-space: nowrap; }
.word-logo span { display: inline-block; text-shadow: 0 2px 0 rgba(255,255,255,.95); }
.word-logo span:nth-child(1) { color: #f0656c; transform: rotate(-6deg) translateY(2px); }
.word-logo span:nth-child(2) { color: #ff9e4f; transform: rotate(4deg) translateY(-2px); }
.word-logo span:nth-child(3) { color: #e9b900; transform: rotate(-3deg); }
.word-logo span:nth-child(4) { color: #41bd91; transform: rotate(4deg) translateY(2px); }
.word-logo span:nth-child(5) { color: #3e97ee; transform: rotate(-5deg) translateY(-2px); }
.word-logo span:nth-child(6) { color: #6678df; transform: rotate(3deg); }
.word-logo span:nth-child(7) { color: #9a61d9; transform: rotate(-4deg) translateY(2px); }
.word-logo span:nth-child(8) { color: #ed6ca9; transform: rotate(5deg) translateY(-1px); }
.beta-badge { margin-left: .45em; padding: .2em .45em; border: 1px solid #d9d0fa; border-radius: 999px; color: #654bc8; background: #f4f1ff; font-family: var(--body); font-size: .34em; font-weight: 900; line-height: 1; letter-spacing: .03em; vertical-align: middle; }
.word-logo .beta-badge { align-self: flex-start; margin-top: .08em; text-shadow: none; transform: rotate(3deg); }
.hero-logo { font-size: clamp(36px, 11vw, 62px); filter: drop-shadow(0 6px 12px rgba(81, 71, 112, .12)); }
.header-logo { font-size: 20px; }

.home { display: flex; flex-direction: column; justify-content: flex-start; gap: 24px; padding-bottom: calc(18px + env(safe-area-inset-bottom)); animation: arrive .36s cubic-bezier(.2,.8,.2,1) both; }
.hero { padding-top: clamp(14px, 3.5vh, 34px); }
.hero-badge, .test-pill { display: inline-flex; margin-top: 18px; padding: 6px 11px; border-radius: 999px; color: #4e3a98; background: var(--purple-soft); font-size: 10px; font-weight: 800; letter-spacing: .05em; }
.hero h1 { margin: 19px 0 0; font-family: var(--display); font-size: clamp(35px, 10.5vw, 58px); line-height: 1.12; font-weight: 900; letter-spacing: -.06em; }
.hero h1 em { color: var(--purple); font-style: normal; }
.hero-copy { max-width: 520px; margin: 18px 0 0; color: #616b7f; font-size: 14px; font-weight: 600; line-height: 1.9; }
.hero-cast { position: relative; width: calc(100% + 28px); margin: 12px -14px -7px; overflow: hidden; }
.hero-cast-glow { position: absolute; inset: 23% 3% 8%; border-radius: 50%; background: radial-gradient(ellipse, rgba(255,218,99,.28), rgba(149,220,208,.16) 48%, transparent 72%); filter: blur(5px); }
.hero-cast img { position: relative; z-index: 1; width: 100%; height: auto; display: block; filter: drop-shadow(0 10px 9px rgba(76,64,103,.12)); animation: cast-arrive .65s cubic-bezier(.2,.8,.2,1) both; }
@keyframes cast-arrive { from { opacity: 0; transform: translateY(15px) scale(.97); } }
.feature-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.feature-chips span { padding: 7px 11px; border: 1px solid #e8dfd1; border-radius: 999px; color: #6a7080; background: rgba(255,255,255,.75); font-size: 10px; font-weight: 800; }
.home-actions { display: grid; gap: 10px; }
.home-note { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.home-note::before { content: "✓"; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--mint); font-weight: 900; }

.site-footer { margin-top: 42px; padding: 0; color: #858b9a; text-align: center; font-size: 10px; line-height: 1.8; }
.home .site-footer { margin-top: auto; padding-top: 42px; }
.site-footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 0; }
.site-footer-links a { color: #6f778b; text-decoration: none; font-weight: 800; }
.site-footer-links a::after { content: "｜"; margin: 0 7px; color: #c7bfba; font-weight: 600; }
.site-footer-links a:last-child::after { content: ""; margin: 0; }
.site-credit { margin: 8px 0 0; }
.site-credit a { color: var(--purple); font-weight: 900; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }

.btn { min-height: 54px; border: 0; border-radius: 17px; padding: 13px 17px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; letter-spacing: .02em; cursor: pointer; transition: transform .14s ease, box-shadow .14s ease, filter .14s ease; }
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .4; cursor: not-allowed; filter: grayscale(.4); }
.btn-primary { color: white; background: linear-gradient(135deg, #8066e4, #654bc8); box-shadow: 0 10px 22px rgba(116,88,214,.25), inset 0 1px rgba(255,255,255,.24); }
.btn-secondary { color: #4e5870; border: 1px solid var(--line); background: white; box-shadow: 0 5px 15px rgba(56,64,91,.06); }
.btn-danger { color: #c74b54; border: 1px solid #ffd2d6; background: var(--red-soft); }
.btn-compact { min-height: 40px; padding: 8px 13px; border-radius: 12px; font-size: 11px; }
.btn-full { width: 100%; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--control-gap); }

.topbar { min-height: 44px; margin-bottom: 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar-title { min-width: 0; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.sound-toggle { width: 38px; height: 38px; flex: none; border: 1px solid #e4ddf2; border-radius: 13px; display: grid; place-items: center; color: var(--purple); background: rgba(255,255,255,.94); box-shadow: 0 4px 12px rgba(83,71,127,.07); cursor: pointer; transition: transform .14s ease, color .14s ease, background .14s ease; }
.sound-toggle:active { transform: scale(.94); }
.sound-toggle.is-off { color: #8d92a0; background: rgba(247,247,249,.92); }
.sound-toggle svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sound-toggle svg path:first-child { fill: currentColor; stroke: currentColor; }
.home-sound-toggle { position: absolute; top: max(18px, env(safe-area-inset-top)); right: 16px; z-index: 2; }
.room-code { flex: none; min-height: 36px; border: 2px solid #e6def8; border-radius: 13px; padding: 6px 10px; color: var(--purple); background: white; font-size: 11px; font-weight: 900; letter-spacing: .17em; box-shadow: 0 4px 12px rgba(83,71,127,.06); }
.room-menu-wrap { position: relative; z-index: 45; flex: none; }
.room-code-menu { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.room-code-menu:active { transform: scale(.97); }
.room-code-menu[aria-expanded="true"] { border-color: #b9a8ed; box-shadow: 0 7px 18px rgba(83,71,127,.14); }
.room-code-menu svg { width: 13px; height: 13px; margin-left: 1px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .16s ease; }
.room-code-menu[aria-expanded="true"] svg { transform: rotate(180deg); }
.room-menu { position: absolute; top: calc(100% + 12px); right: 0; width: min(270px, calc(100vw - 34px)); padding: 7px; border: 1px solid #e7e0f3; border-radius: 18px; background: rgba(255,255,255,.98); box-shadow: 0 18px 48px rgba(43,38,68,.2); animation: room-menu-in .17s ease-out; }
.room-menu::before { content: ""; position: absolute; top: -7px; right: 22px; width: 12px; height: 12px; border-top: 1px solid #e7e0f3; border-left: 1px solid #e7e0f3; background: white; transform: rotate(45deg); }
.room-menu button { position: relative; width: 100%; min-height: 58px; border: 0; border-radius: 13px; padding: 9px 10px; display: flex; align-items: center; gap: 11px; color: #465066; background: transparent; text-align: left; cursor: pointer; }
.room-menu button:active { background: #f4f0ff; }
.room-menu button + button { border-top: 1px solid #f0ecf5; border-radius: 0 0 13px 13px; }
.room-menu button > svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.room-menu button span { display: grid; gap: 2px; }
.room-menu button strong { font-size: 12px; }
.room-menu button small { color: var(--muted); font-size: 9px; }
.room-menu .room-menu-danger { color: #c84955; }
.room-menu .room-menu-danger small { color: #a8747a; }
@keyframes room-menu-in { from { opacity: 0; transform: translateY(-5px) scale(.98); } }

.room-settings-summary { margin: 17px 0 12px; padding: 13px 14px; display: flex; align-items: center; justify-content: space-between; border: 1px solid #e2daf7; border-radius: 15px; background: linear-gradient(135deg, #f7f4ff, #fff); }
.room-settings-summary span { color: #665499; font-size: 10px; font-weight: 800; }
.room-settings-summary strong { color: var(--purple); font-family: var(--display); font-size: 17px; }
.room-settings-group { margin-top: 16px; }
.room-settings-group h3 { margin: 0 0 7px; color: #5d4a9e; font-size: 10px; letter-spacing: .08em; }
.room-setting-row { padding: 10px 2px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; border-bottom: 1px solid #eee9e2; }
.room-setting-row span { flex: none; color: var(--muted); font-size: 10px; }
.room-setting-row strong { color: #434e64; font-size: 10px; line-height: 1.55; text-align: right; }

.room-ended-backdrop { position: fixed; inset: 0; z-index: 100; padding: 22px; display: grid; place-items: center; background: rgba(31,35,51,.55); backdrop-filter: blur(9px); animation: fade .2s ease; }
.room-ended-dialog { width: min(100%, 390px); padding: 28px 22px 22px; border: 1px solid rgba(255,255,255,.8); border-radius: 27px; background: #fffdf9; box-shadow: 0 28px 80px rgba(29,30,45,.3); text-align: center; animation: room-dialog-in .28s cubic-bezier(.2,.8,.2,1); }
.room-ended-icon { width: 62px; height: 62px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 21px; color: #c84d59; background: #fff0f1; }
.room-ended-icon svg { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.room-ended-dialog h2 { margin: 5px 0 8px; font-family: var(--display); font-size: 23px; }
.room-ended-dialog > p:not(.eyebrow) { margin: 0 0 22px; color: var(--muted); font-size: 12px; }
@keyframes room-dialog-in { from { opacity: 0; transform: translateY(12px) scale(.96); } }

.card { border: 1px solid rgba(230,224,216,.92); border-radius: var(--radius); background: rgba(255,255,255,.95); box-shadow: var(--shadow); }
.card-pad { padding: 16px; }
.section { margin-top: 20px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin: 0 3px 9px; }
.heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.role-count-mismatch { color: #bb4c57 !important; font-weight: 900; }
.role-count-alert { padding: 4px 7px; border: 1px solid #ffd0d5; border-radius: 999px; color: #b64450 !important; background: #fff1f3; font-size: 8px !important; font-weight: 900; }
.mini-action { min-height: 31px; padding: 5px 9px; border: 1px solid #dcd3f3; border-radius: 10px; color: #604baa; background: #fff; font-size: 8px; font-weight: 900; }
.section-heading h2, .section-heading h3 { margin: 0; font-family: var(--display); font-size: 16px; font-weight: 900; }
.section-heading span { color: var(--muted); font-size: 9px; }
.inset-card { padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: #fbfaf8; }

.phase-banner { position: relative; overflow: hidden; margin-bottom: 13px; padding: 22px; border-radius: 25px; color: #253851; background: linear-gradient(135deg, #e2f3ff, #f0f8ff); box-shadow: 0 12px 30px rgba(77,155,245,.12); }
.phase-banner::after { content: ""; position: absolute; width: 115px; height: 115px; right: -28px; top: -36px; border-radius: 36px; background: rgba(255,255,255,.45); transform: rotate(18deg); }
.phase-label { position: relative; z-index: 1; margin: 0 0 6px; color: #247cc9; font-size: 9px; font-weight: 900; letter-spacing: .16em; }
.phase-banner h2 { position: relative; z-index: 1; margin: 0; font-family: var(--display); font-size: 27px; font-weight: 900; letter-spacing: -.03em; }
.phase-banner p:last-child { position: relative; z-index: 1; max-width: 84%; margin: 8px 0 0; color: #627188; font-size: 11px; line-height: 1.7; }
.night-guidance { position: relative; z-index: 1; width: 100%; margin-top: 10px; color: #627188; font-size: 11px; line-height: 1.7; text-align: left; }
.phase-night .night-guidance p { max-width: none; margin: 0; color: inherit; font-size: inherit; line-height: inherit; }
.phase-night .night-guidance p:nth-child(3) { margin-top: 10px; }
.night-guidance-alert { color: #c94751; font-weight: 900; }
.tab-summary { min-height: 58px; margin-bottom: 8px; padding: 12px 17px; display: flex; align-items: center; gap: 13px; border-radius: 19px; }
.tab-summary::after { width: 76px; height: 76px; right: -20px; top: -28px; border-radius: 25px; }
.tab-summary h2 { flex: none; font-size: 21px; }
.tab-summary p:last-child { overflow: hidden; max-width: none; margin: 0; color: #68778d; font-size: clamp(8px, 2.3vw, 10px); line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.phase-last-words { background: linear-gradient(135deg, #ffe5cd, #fff3e7); box-shadow: 0 12px 30px rgba(255,152,88,.15); }
.phase-last-words .phase-label { color: #d56523; }

.action-card { padding: 19px; border-color: #e6def8; background: linear-gradient(145deg, #fff, #f8f5ff); }
.action-card h3 { margin: 0 0 6px; font-family: var(--display); font-size: 19px; font-weight: 900; }
.action-card p { margin: 0 0 15px; color: var(--muted); font-size: 11px; line-height: 1.65; }

.field { display: grid; gap: 7px; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field label { color: #596377; font-size: 11px; font-weight: 800; }
.field label small { color: #9299a8; font-weight: 600; }
.input { width: 100%; min-height: 52px; border: 1px solid #e3ded7; border-radius: 15px; padding: 12px 14px; color: var(--ink); background: #fffdfa; font-size: 15px; caret-color: var(--purple); appearance: none; }
.input::placeholder { color: #b3b0b0; }
textarea.input { min-height: 82px; resize: vertical; line-height: 1.55; }
.detail-note { min-height: 140px !important; }
.code-input { text-align: center; text-transform: uppercase; font-size: 25px; font-weight: 900; letter-spacing: .3em; padding-left: calc(14px + .3em); }

.sheet-backdrop { position: fixed; inset: 0; z-index: 60; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: center; overflow: hidden; background: rgba(38,51,77,.34); backdrop-filter: blur(7px); }
.sheet { width: min(100%, 540px); max-height: calc(100dvh - 24px); overflow: auto; overscroll-behavior: contain; padding: 21px; border: 1px solid #ece5da; border-radius: 28px; background: #fffdf9; box-shadow: 0 22px 70px rgba(45,51,75,.24); }
.sheet h2 { margin: 0 0 5px; font-family: var(--display); font-size: 21px; font-weight: 900; }
.sheet-intro { margin: 0 0 18px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.sheet-handle { width: 44px; height: 5px; margin: -7px auto 17px; border-radius: 9px; background: #ded8d0; }
.sheet-footer { margin-top: 18px; padding-top: 2px; }
@keyframes sheet-up { from { transform: translateY(26px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.lobby-code { padding: 20px; text-align: center; background: linear-gradient(135deg, #fff, #fff8db); }
.lobby-code small { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; font-weight: 800; }
.lobby-code strong { display: block; color: var(--purple); font-family: var(--display); font-size: 39px; letter-spacing: .22em; padding-left: .22em; }
.lobby-code p { margin: 6px 0 11px; color: var(--muted); font-size: 9px; }

.solo-test-card { border-color: #cfeee5; background: linear-gradient(135deg, #fff, #effcf8); }
.solo-test-copy h2 { margin: 8px 0 4px; font-family: var(--display); font-size: 18px; }
.solo-test-copy p { margin: 0 0 13px; color: var(--muted); font-size: 10px; line-height: 1.65; }
.test-pill { margin: 0; color: #207a61; background: var(--mint-soft); }
.test-toolbar { margin-bottom: 13px; padding: 12px; border: 2px dashed #87dbc4; border-radius: 18px; background: rgba(239,252,248,.95); }
.test-toolbar > div:first-child { display: flex; align-items: center; gap: 8px; }
.test-toolbar strong { font-size: 11px; }
.test-switches { width: 100%; min-width: 0; display: flex; gap: var(--control-gap); margin-top: 9px; overflow-x: auto; overscroll-behavior-x: contain; padding: 3px 2px 9px; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: #87dbc4 transparent; touch-action: pan-x; }
.test-switches::-webkit-scrollbar { height: 5px; }
.test-switches::-webkit-scrollbar-thumb { border-radius: 999px; background: #87dbc4; }
.test-switches button { flex: none; min-height: 32px; border: 1px solid #cceae2; border-radius: 10px; padding: 5px 9px; color: #4b756a; background: white; font-size: 9px; font-weight: 800; scroll-snap-align: start; }
.test-switches button.active { color: white; border-color: var(--mint); background: var(--mint); }

.player-list { display: grid; gap: var(--control-gap); }
.player-row { width: 100%; min-height: 59px; border: 1px solid #ece7e0; border-radius: 17px; padding: 9px 10px; display: flex; align-items: center; gap: 11px; color: var(--ink); text-align: left; background: #fff; }
button.player-row { cursor: pointer; }
button.player-row:active { transform: scale(.99); background: #faf7ff; }
.lobby-player-row { cursor: default; }
.remove-player-btn { min-height: 34px; flex: none; padding: 6px 10px; border: 1px solid #ffd5d8; border-radius: 10px; color: #bd4e57; background: #fff5f6; font-size: 9px; font-weight: 900; }
.avatar-edit-btn { min-height: 34px; flex: none; padding: 6px 10px; border: 1px solid #d9cff5; border-radius: 10px; color: #604baa; background: #f8f5ff; font-size: 9px; font-weight: 900; }
.avatar { position: relative; width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 14px; color: var(--avatar-text, #5d4300); background: var(--avatar-background, #ffd15a); font-family: var(--display); font-size: 16px; font-weight: 900; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.avatar.dead { color: #8b8f99; background: #ecebef; filter: grayscale(.4); }
.avatar.dead::after { content: "×"; position: absolute; inset: 0; display: grid; place-items: center; color: #677083; font-size: 27px; }
.player-main { min-width: 0; flex: 1; }
.player-name { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: 12px; font-weight: 900; }
.player-meta { margin-top: 3px; color: var(--muted); font-size: 9px; }
.important-preview { overflow: hidden; margin-top: 5px; color: #915129; font-size: 9px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.tag { padding: 3px 6px; border-radius: 999px; color: #5b469d; background: var(--purple-soft); font-size: 8px; font-weight: 900; white-space: nowrap; }
.test-tag { color: #24785f; background: var(--mint-soft); }
.claim-icon { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 8px; color: white; background: var(--purple); font-size: 10px; }
.note-arrow { color: #a9a6b1; font-size: 24px; }
.status-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #c9c6cf; }
.status-dot.done { background: var(--mint); box-shadow: 0 0 0 4px rgba(73,205,167,.12); }

.avatar-color-preview-wrap { margin-bottom: 17px; padding: 17px; display: flex; align-items: center; gap: 14px; border: 1px solid #e4dcf6; border-radius: 20px; background: linear-gradient(135deg, #f7f3ff, #fffdf9); }
.avatar-color-preview { width: 68px; height: 68px; border-radius: 23px; font-size: 27px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.07), 0 10px 22px rgba(67,54,115,.12); transform: rotate(-3deg); }
.avatar-color-preview-wrap > div { min-width: 0; display: grid; gap: 4px; }
.avatar-color-preview-wrap strong { overflow: hidden; font-family: var(--display); font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
.avatar-color-preview-wrap small { color: var(--muted); font-size: 9px; line-height: 1.55; }
.avatar-palette-grid { margin-bottom: 17px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.avatar-palette-choice { aspect-ratio: 1; min-width: 0; border: 2px solid transparent; border-radius: 13px; padding: 3px; display: grid; place-items: center; background: transparent; cursor: pointer; }
.avatar-palette-choice span { width: 100%; height: 100%; display: grid; place-items: center; border-radius: 9px; color: var(--avatar-text); background: var(--avatar-background); font-family: var(--display); font-size: 14px; font-weight: 900; }
.avatar-palette-choice.selected { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(116,88,214,.11); }
.avatar-color-fields { margin-bottom: 17px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.avatar-color-fields label { min-width: 0; padding: 11px; display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 3px 9px; border: 1px solid #e7e0d8; border-radius: 15px; background: white; cursor: pointer; }
.avatar-color-fields label > span { grid-column: 1 / -1; color: #596377; font-size: 10px; font-weight: 900; }
.avatar-color-fields input[type="color"] { width: 34px; height: 34px; border: 0; border-radius: 10px; padding: 0; overflow: hidden; background: transparent; cursor: pointer; }
.avatar-color-fields input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.avatar-color-fields input[type="color"]::-webkit-color-swatch { border: 1px solid rgba(0,0,0,.08); border-radius: 9px; }
.avatar-color-fields strong { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; }
.status-dot.active { background: var(--yellow); animation: pulse 1s ease infinite alternate; }
@keyframes pulse { to { transform: scale(1.35); } }

.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--control-gap); }
.section.is-disabled { opacity: .42; filter: grayscale(.35); }
.role-counter { padding: 11px; border: 1px solid #ece7df; border-radius: 16px; background: #fffdfa; }
.role-counter-head { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; }
.role-seal { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 10px; color: white; background: var(--purple); font-size: 11px; font-weight: 900; }
.role-counter strong { font-size: 10px; }
.number-control { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.number-control button { min-width: 31px; height: 31px; border: 1px solid #e3ddd5; border-radius: 10px; color: #596377; background: white; font-weight: 900; }
.number-control span { min-width: 42px; text-align: center; color: var(--purple); font-size: 10px; font-weight: 900; }
.number-control .unlimited-btn { color: #596377 !important; background: white !important; font-family: var(--display); font-size: 18px; line-height: 1; }
.number-control span.is-unlimited { color: var(--purple); font-family: var(--display); font-size: 23px; line-height: 1; letter-spacing: 0; transform: translateY(-1px); }
.setting-row { min-height: 59px; padding: 10px 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid #eee9e2; }
.setting-row:last-child { border-bottom: 0; }
.setting-row.is-disabled { opacity: .42; filter: grayscale(.35); }
.setting-action-row { padding: 9px 0 12px; border-bottom: 1px solid #eee9e2; }
.setting-action-row .btn { width: 100%; }
.settings-subhead { margin: 8px -16px 0; padding: 15px 16px 7px; background: linear-gradient(90deg, rgba(116,88,214,.07), transparent); }
.settings-subhead span { color: #5d4a9e; font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.setting-label { min-width: 0; }
.setting-label strong { display: block; font-size: 11px; }
.setting-label small { display: block; overflow: hidden; max-width: 220px; margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.5; text-overflow: ellipsis; }
.segmented { display: inline-flex; flex: none; padding: 3px; border: 1px solid #e5dfd8; border-radius: 12px; background: #f8f6f2; }
.segmented button { min-height: 32px; border: 0; border-radius: 9px; padding: 5px 9px; color: var(--muted); background: transparent; font-size: 9px; font-weight: 900; }
.segmented button.active { color: white; background: var(--purple); box-shadow: 0 3px 8px rgba(116,88,214,.22); }
.setting-row-stacked { min-height: 0; padding: 16px 0; display: grid; grid-template-columns: 1fr; gap: 12px; align-items: start; }
.setting-row-stacked .setting-label strong { font-size: 11px; }
.setting-row-stacked .setting-label small { max-width: none; overflow: visible; font-size: 8px; line-height: 1.5; text-overflow: clip; white-space: normal; }
.setting-row-stacked .segmented { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; padding: 3px; border-radius: 12px; }
.setting-row-stacked .segmented button { min-width: 0; min-height: 32px; padding: 5px 4px; font-size: 9px; line-height: 1.35; }

.role-reveal-page { min-height: 100dvh; display: flex; flex-direction: column; }
.role-reveal { min-height: 0; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.role-reveal-page .site-footer { margin-top: 18px; }
.role-card { position: relative; overflow: hidden; width: 100%; min-height: 405px; border: 1px solid #e6def8; border-radius: 31px; padding: 28px 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--ink); text-align: center; background: radial-gradient(circle at 50% 15%, rgba(255,214,90,.26), transparent 37%), linear-gradient(155deg, #fff, #f5f0ff); box-shadow: var(--shadow-strong); }
.role-card::before { content: ""; position: absolute; inset: 10px; border: 2px dashed rgba(116,88,214,.18); border-radius: 23px; }
.role-card.hidden { cursor: pointer; }
.role-card:not(.hidden) { min-height: 520px; padding-block: 30px; justify-content: flex-start; }
.role-card-wolf { border-color: #ffd2d6; background: radial-gradient(circle at 50% 15%, rgba(240,101,108,.18), transparent 39%), linear-gradient(155deg, #fff, #fff2f2); }
.role-card-wolf::before { border-color: rgba(220,73,83,.2); }
.role-portrait { z-index: 1; width: 144px; height: 250px; flex: none; margin: -4px auto 0; display: block; object-fit: contain; object-position: center; filter: drop-shadow(0 13px 12px rgba(68,65,88,.14)); }
.role-portrait-knight { transform: translateX(8px); }
.role-glyph { width: 112px; height: 112px; z-index: 1; display: grid; place-items: center; border-radius: 38px; color: white; background: linear-gradient(145deg, #8269e6, #654bc8); font-family: var(--display); font-size: 43px; font-weight: 900; box-shadow: 0 12px 26px rgba(116,88,214,.23); transform: rotate(-3deg); }
.role-card:not(.hidden) .role-glyph { width: 54px; height: 54px; margin-top: 10px; border: 4px solid white; border-radius: 19px; font-size: 20px; box-shadow: 0 8px 19px rgba(73,65,105,.2); }
.role-glyph.team-wolf { background: linear-gradient(145deg, #f06a70, #c94751); }
.role-glyph.team-village { background: linear-gradient(145deg, #8269e6, #654bc8); }
.role-card-wolf .role-team { color: #c94751; }
.role-card h2 { z-index: 1; margin: 16px 0 4px; font-family: var(--display); font-size: 31px; font-weight: 900; }
.role-team { z-index: 1; margin: 0; color: var(--purple); font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.role-description { z-index: 1; max-width: 330px; margin: 15px 0 0; color: var(--muted); font-size: 11px; line-height: 1.75; }
.role-hidden-description { max-width: none; margin: 14px 0; line-height: 1.7; }
.initial-seer-result { z-index: 1; width: 100%; margin-top: 18px; padding: 13px 14px; border: 1px solid #d9cff8; border-radius: 16px; color: #5942ae; background: #f5f1ff; }
.initial-seer-result small { display: block; margin-bottom: 5px; font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.initial-seer-result p { margin: 0; color: var(--ink); font-size: 11px; }
.initial-seer-result strong { font-size: 13px; }
.initial-seer-result b { color: #387963; }
.role-confirmed { min-height: 54px; padding: 10px 14px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid #cceae2; border-radius: 17px; color: #387963; background: #effbf7; text-align: left; animation: role-confirmed-in .24s ease-out; }
.role-confirmed > span { width: 25px; height: 25px; display: grid; place-items: center; flex: none; border-radius: 50%; color: white; background: var(--mint); font-size: 14px; font-weight: 900; }
.role-confirmed strong, .role-confirmed small { display: block; }
.role-confirmed strong { font-size: 11px; }
.role-confirmed small { margin-top: 2px; color: #5e8b7c; font-size: 9px; }
@keyframes role-confirmed-in { from { opacity: 0; transform: translateY(5px) scale(.98); } }
.wolf-mates { z-index: 1; width: 100%; margin-top: 18px; padding: 12px; border-radius: 14px; color: #bf4b54; background: var(--red-soft); font-size: 10px; font-weight: 700; }
.waiting-note { color: var(--muted); text-align: center; font-size: 10px; }

.timer { display: flex; align-items: center; gap: 10px; }
.timer-ring { --progress: 1; width: 51px; height: 51px; flex: none; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--purple) calc(var(--progress) * 1turn), #e9e5ee 0); }
.timer-ring::before { content: ""; grid-area: 1 / 1; width: 41px; height: 41px; border-radius: 50%; background: white; }
.timer-ring span { z-index: 1; grid-area: 1 / 1; color: var(--purple); font-size: 10px; font-weight: 900; }
.timer-copy strong { display: block; font-size: 10px; }
.timer-copy small { color: var(--muted); font-size: 8px; }
.timer-centered { justify-content: center; margin: 17px 0; }
.discussion-timer-card { overflow: hidden; padding: 20px; border-color: #dcd3f4; background: linear-gradient(145deg, #fff, #f6f2ff); }
.timer-large { gap: 16px; }
.timer-large .timer-ring { width: 104px; height: 104px; }
.timer-large .timer-ring::before { width: 86px; height: 86px; }
.timer-large .timer-ring span { font-family: var(--display); font-size: 25px; letter-spacing: -.04em; }
.timer-large .timer-copy strong { font-family: var(--display); font-size: 17px; }
.timer-large .timer-copy small { display: block; max-width: 190px; margin-top: 5px; font-size: 9px; line-height: 1.55; }
.timer.is-expired .timer-ring { background: conic-gradient(var(--red) 1turn, var(--red-soft) 0); }
.timer.is-expired .timer-ring span { color: var(--red); }
.timer-host-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--control-gap); margin-top: 15px; }
.last-words-card { text-align: center; background: linear-gradient(145deg, #fff, #fff4e9); border-color: #ffd8b9; }
.last-words-avatar { width: 86px; height: 86px; margin: 0 auto 14px; border-radius: 50%; color: var(--avatar-text, white); background: var(--avatar-background, var(--orange)); font-size: 33px; box-shadow: 0 10px 23px rgba(78,65,110,.2); }

.vote-call { min-height: 72px; border-radius: 21px; font-size: 16px; }
.queue { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.queue-chip { padding: 6px 9px; border-radius: 999px; color: #695b41; background: #fff5cc; font-size: 9px; font-weight: 800; }
.queue-chip:first-child { color: #5a4300; background: var(--yellow); }
.voting-now { margin: 12px 0; padding: 15px; border-radius: 18px; text-align: center; background: var(--purple-soft); }
.voting-now strong { display: block; color: var(--purple); font-family: var(--display); font-size: 20px; font-weight: 900; }
.voting-now span { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.vote-turn-timer { justify-content: center; margin: 18px 0; }
.vote-count { min-width: 48px; flex: none; color: var(--red); font-family: var(--display); font-size: 25px; line-height: 1; text-align: center; }
.vote-count small { margin-left: 2px; font-family: var(--body); font-size: 10px; }
.vote-count.is-zero, .vote-count.is-hidden { color: #aaa8b2; }
.turn-overlay { position: fixed; inset: 0; z-index: 70; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); display: grid; place-items: center; overflow: hidden; background: rgba(39,34,57,.82); backdrop-filter: blur(12px); }
.turn-overlay-card { width: min(100%, 510px); max-height: calc(100dvh - 24px); overflow: hidden; padding: 18px; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; border: 1px solid rgba(255,255,255,.7); border-radius: 27px; background: #fffdf9; box-shadow: 0 30px 90px rgba(23,19,41,.35); }
.turn-overlay-head { min-width: 0; }
.turn-overlay-card h2 { margin: 0; font-family: var(--display); font-size: 28px; }
.turn-overlay-head > p { margin: 5px 0 8px; color: var(--muted); font-size: 11px; }
.turn-overlay-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 2px; }
.turn-overlay-actions { padding-top: 10px; background: #fffdf9; }
.turn-timer { justify-content: center; margin: 6px 0 10px; }
.turn-timer .timer-ring { width: 84px; height: 84px; }
.turn-timer .timer-ring::before { width: 69px; height: 69px; }
.turn-timer .timer-ring span { font-size: 22px; }
.inline-vote-grid { gap: 8px; margin: 0; }
.inline-vote-grid .target-card { min-height: 64px; padding: 8px 10px; border-radius: 16px; }
@keyframes vote-card-in { from { opacity: 0; transform: translateY(24px) scale(.95); } }
.phase-defense { background: linear-gradient(135deg, #fff1cc, #fff9e9); box-shadow: 0 12px 30px rgba(224,169,35,.14); }
.phase-defense .phase-label { color: #a97700; }
.phase-defense p:last-child { max-width: 100%; }
.keep-together { white-space: nowrap; }
.defense-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--control-gap); margin-top: 13px; }
.defense-actions + .btn-full { margin-top: 10px; }

.target-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--control-gap); }
.target-card { min-height: 84px; border: 1px solid #e8e2da; border-radius: 18px; padding: 11px; display: flex; align-items: center; gap: 9px; color: var(--ink); text-align: left; background: white; cursor: pointer; }
.target-card.selected { border: 2px solid var(--purple); background: var(--purple-soft); }
.target-card .avatar { width: 35px; height: 35px; }
.no-attack-target { grid-column: 1 / -1; min-height: 68px; justify-content: center; border-style: dashed; color: #765a12; text-align: center; background: #fffaf0; }
.no-attack-target.selected { color: #5d460c; border-color: #dcae37; background: #fff1bd; }
.wolf-attack-target { border-color: #f2c9cd; background: #fff8f8; }
.wolf-attack-target.selected { border-color: var(--red); background: var(--red-soft); }
.target-card strong { display: block; overflow: hidden; max-width: 90px; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.target-card small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }
.ability-card { margin-bottom: 14px; }
.ability-targets { margin: 13px 0; }
.ability-result { margin-top: 13px; padding: 14px; border-radius: 16px; background: var(--blue-soft); }
.ability-result small { display: block; margin-bottom: 5px; color: #377ab5; font-size: 8px; font-weight: 900; }
.ability-result strong { font-size: 11px; }
.result-wolf { color: var(--red); }
.result-human { color: #258b6d; }

.wolf-panel { border-color: #e2d8ff; background: linear-gradient(145deg, #fff, #f1ecff); }
.wolf-heading { display: flex; gap: 10px; align-items: center; }
.wolf-eye { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 15px; color: white; background: var(--purple); font-size: 17px; font-weight: 900; transform: rotate(-3deg); }
.wolf-heading h3 { margin: 0; font-family: var(--display); font-size: 17px; }
.wolf-heading p { margin: 3px 0 0; color: var(--muted); font-size: 8px; }
.wolf-timer { margin: 13px 0; padding: 10px; border-radius: 15px; background: white; }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--control-gap); margin: 13px 0; }
.quick-actions button { min-height: 48px; border: 1px solid #ded4fa; border-radius: 14px; color: #5f4ba8; background: white; font-size: 9px; font-weight: 900; }
.quick-actions .strategy-action { grid-column: 1 / -1; color: #fff; border-color: #7458d6; background: linear-gradient(100deg, #7458d6, #9b68d8); }
.assignment-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--control-gap); }
.assignment-choice { min-height: 68px; padding: 10px; border: 1px solid #e2d8f7; border-radius: 17px; color: #615979; background: #fff; text-align: left; }
.assignment-choice span { width: 29px; height: 29px; margin-bottom: 6px; display: grid; place-items: center; border-radius: 10px; color: #6750bf; background: #f0ebff; font-size: 12px; font-weight: 900; }
.assignment-choice strong { display: block; font-size: 10px; }
.assignment-choice.selected { color: #fff; border-color: #7458d6; background: #7458d6; box-shadow: 0 8px 20px rgba(116,88,214,.2); }
.assignment-choice.selected span { color: #7458d6; background: #fff; }
.message-list { display: flex; flex-direction: column; gap: var(--control-gap); max-height: 320px; overflow: auto; }
.wolf-message { padding: 11px; border: 1px solid #e7e0f5; border-radius: 15px; background: white; }
.message-meta { display: flex; justify-content: space-between; color: #9892a5; font-size: 8px; }
.wolf-message p { margin: 6px 0 8px; color: #52596b; font-size: 10px; line-height: 1.5; }
.wolf-message-own { padding-block: 9px; }
.wolf-message-own > p { margin-bottom: 0; }
.reactions { display: flex; flex-wrap: wrap; gap: 5px; }
.reaction { min-height: 29px; border: 1px solid #e5dff0; border-radius: 999px; padding: 4px 8px; display: inline-flex; align-items: center; gap: 4px; color: #7f7888; background: #faf8fd; font-size: 8px; }
.reaction.active { color: white; border-color: var(--purple); background: var(--purple); }
.proposal-feedback { margin: 7px 0 0; padding: 7px 9px; display: grid; gap: 5px; border-radius: 10px; color: #625a73; background: #f7f3ff; font-size: 9px; list-style: none; }
.proposal-feedback li { display: flex; align-items: baseline; gap: 3px; }
.proposal-feedback li::before { content: "•"; margin-right: 2px; color: #8a72d7; }
.proposal-feedback strong { color: #57449d; }
.free-chat { display: flex; gap: 6px; margin: 9px 0; }
.free-chat .input { min-height: 42px; font-size: 11px; }
.free-chat .btn { min-height: 42px; flex: none; }
.role-guess-picker { position: relative; }
.role-guess-trigger { width: 100%; min-height: 54px; border: 2px solid #bcd8fb; border-radius: 17px; padding: 12px 15px; display: flex; align-items: center; justify-content: space-between; color: var(--ink); background: #fff; box-shadow: 0 0 0 3px rgba(77,155,245,.13); font-family: var(--display); font-size: 17px; font-weight: 900; cursor: pointer; }
.role-guess-trigger:active { transform: scale(.99); }
.role-guess-arrow { color: var(--purple); font-family: var(--body); font-size: 13px; transition: transform .16s ease; }
.role-guess-trigger[aria-expanded="true"] .role-guess-arrow { transform: rotate(180deg); }
.role-guess-menu { position: absolute; z-index: 3; bottom: calc(100% + 7px); left: 0; width: 100%; padding: 6px; border: 1px solid #d7cffa; border-radius: 16px; background: #fff; box-shadow: 0 15px 30px rgba(55,46,88,.18); }
.role-guess-menu button { width: 100%; min-height: 43px; border: 0; border-radius: 11px; padding: 9px 11px; display: flex; align-items: center; justify-content: space-between; color: #4f576b; background: transparent; font-family: var(--display); font-size: 15px; font-weight: 800; text-align: left; cursor: pointer; }
.role-guess-menu button:active, .role-guess-menu button.selected { color: #6045c3; background: var(--purple-soft); }

.history-list { display: grid; gap: var(--control-gap); }
.history-item { padding: 12px; border: 1px solid #ece6df; border-radius: 15px; background: #fffdfa; }
.history-item-head { display: flex; justify-content: space-between; gap: 9px; margin-bottom: 7px; }
.history-item-head strong { font-size: 10px; }
.history-item-head span { color: var(--muted); font-size: 8px; }
.ballot-line { display: flex; align-items: center; gap: 5px; margin-top: 4px; color: #798093; font-size: 9px; }
.ballot-line b { color: var(--ink); }
.ballot-line i { color: var(--purple); font-style: normal; }
.result-strip { padding: 13px; border: 1px solid #cee6fb; border-radius: 16px; background: var(--blue-soft); }
.result-strip + .result-strip { margin-top: 7px; }
.result-strip small { color: #327fc2; font-size: 8px; font-weight: 900; }
.result-strip p { margin: 5px 0 0; font-size: 11px; }
.result-strip b.wolf { color: var(--red); }
.result-strip b.human { color: #289873; }

.note-sheet-head { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.note-sheet-head .sheet-intro { margin-bottom: 0; }
.claim-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--control-gap); }
.claim-choice { min-height: 48px; border: 1px solid #e5ded7; border-radius: 14px; color: #6f7687; background: white; font-size: 9px; font-weight: 800; }
.claim-choice span { display: block; color: var(--purple); font-size: 13px; }
.claim-choice.selected { color: white; border-color: var(--purple); background: var(--purple); }
.claim-choice.selected span { color: white; }
.timing-list { display: grid; gap: var(--control-gap); }
.timing-day { padding: 12px; border: 1px solid #e8e2db; border-radius: 17px; background: white; }
.timing-day > strong { display: block; color: var(--purple); font-size: 11px; }
.timing-day .setting-row { min-height: 48px; padding: 6px 0; }
.confirm-bar { position: sticky; bottom: -1px; margin: 14px -3px -3px; padding-top: 13px; background: linear-gradient(transparent, #fffdf9 18%); }

.bottom-nav { position: fixed; z-index: 40; width: min(calc(100% - 24px), 710px); left: 50%; bottom: calc(10px + env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 6px; display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid #e1dad0; border-radius: 21px; background: rgba(255,255,255,.94); box-shadow: 0 13px 36px rgba(45,54,78,.15); backdrop-filter: blur(18px); }
.bottom-nav button { min-height: 49px; border: 0; border-radius: 15px; color: #8b8f9d; background: transparent; font-size: 9px; font-weight: 800; }
.bottom-nav button.active { color: white; background: linear-gradient(135deg, #8066e4, #654bc8); box-shadow: 0 6px 14px rgba(116,88,214,.22); }
.bottom-nav button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.bottom-nav button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bottom-nav button:first-child svg { fill: currentColor; stroke: none; }
.bottom-nav button span { display: block; font-size: 10px; font-weight: 900; }

.phase-transition { position: fixed; inset: 0; z-index: 120; min-height: 100dvh; overflow: hidden; display: grid; place-items: center; color: white; background: #365ca5; pointer-events: none; animation: transition-out var(--transition-duration, 1900ms) ease both; }
.phase-transition.transition-continuing { animation: none; }
.transition-dusk { background: #141b39; }
.transition-vote { background: #07080c; }
.transition-discussion-end { background: #4e3b9b; }
.transition-victim { background: #682c4b; }
.transition-peace { color: #274e59; background: #dff8e9; }
.transition-execution-result, .transition-omen, .transition-night-arrives, .transition-night-stops, .transition-wolf-win { background: #07080b; }
.transition-village-win { color: #204b4f; background: #e9fff5; }
.transition-dawn, .transition-vote, .transition-discussion-end { --transition-duration: 2600ms; }
.transition-dusk { --transition-duration: 3000ms; }
.transition-victim { --transition-duration: 4200ms; }
.transition-peace { --transition-duration: 3200ms; }
.transition-execution-result { --transition-duration: 3600ms; }
.transition-omen { --transition-duration: 3000ms; }
.transition-night-arrives { --transition-duration: 4200ms; }
.transition-night-stops { --transition-duration: 4700ms; }
.transition-village-win { --transition-duration: 5200ms; }
.transition-wolf-win { --transition-duration: 6000ms; }
.transition-sky { position: absolute; inset: -15vmax; }
.transition-dawn .transition-sky { background: radial-gradient(circle at 50% 72%, #fff8bc 0 7%, #ffbd63 21%, #78bdf4 61%, #365ca5 100%); animation: dawn-rise var(--transition-duration, 1900ms) ease both; }
.transition-dusk .transition-sky { background: radial-gradient(circle at 50% 84%, #ffc16f 0 8%, #8b64b0 33%, #26345e 70%, #141b39 100%); animation: dusk-fall var(--transition-duration, 1900ms) ease both; }
.transition-vote .transition-sky { inset: 0; background: radial-gradient(circle at 50% 44%, rgba(106,117,153,.24) 0 8%, rgba(48,54,76,.16) 25%, transparent 48%), linear-gradient(155deg, #11141c, #050609 65%, #0b0d13); animation: vote-calm var(--transition-duration, 2600ms) ease both; }
.transition-discussion-end .transition-sky { inset: 0; background: radial-gradient(circle at center, #9b84ee 0, #7057c7 36%, #4e3b9b 76%); }
.transition-discussion-end .transition-sky::before { content: ""; position: absolute; left: 50%; top: 50%; width: 155vmax; aspect-ratio: 1; border-radius: 50%; background: repeating-conic-gradient(from -5deg, rgba(255,255,255,.14) 0 3deg, transparent 3deg 12deg, rgba(255,255,255,.055) 12deg 17deg, transparent 17deg 27deg); mask-image: radial-gradient(circle, transparent 0 10%, #000 25%, rgba(0,0,0,.78) 61%, transparent 82%); animation: vote-rays 9s linear infinite; }
.transition-discussion-end .transition-sky::after { content: ""; position: absolute; left: 50%; top: 50%; width: 42vmin; height: 42vmin; border: 1px solid rgba(255,255,255,.24); border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 70px rgba(237,228,255,.34), inset 0 0 35px rgba(255,255,255,.12); }
.transition-victim .transition-sky { background: radial-gradient(circle at 50% 44%, rgba(255,154,157,.48) 0 7%, transparent 24%), radial-gradient(circle at 24% 28%, rgba(255,124,133,.35) 0 2%, transparent 3%), radial-gradient(circle at 76% 66%, rgba(255,124,133,.28) 0 3%, transparent 4%), linear-gradient(145deg, #9e4561, #542540); animation: result-pulse var(--transition-duration, 2300ms) ease both; }
.transition-peace .transition-sky { background: radial-gradient(circle at 50% 42%, #fffbd1 0 10%, rgba(255,224,101,.72) 22%, transparent 42%), radial-gradient(circle at 22% 26%, #fff 0 1%, transparent 2%), radial-gradient(circle at 78% 31%, #fff 0 1.2%, transparent 2.2%), radial-gradient(circle at 68% 76%, #fff 0 1%, transparent 2%), linear-gradient(145deg, #b9f0dc, #7ed5c5); animation: peace-glow var(--transition-duration, 2200ms) ease both; }
.transition-execution-result .transition-sky { inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.22), rgba(0,0,0,.88)), url('/gallows-transition.png') center / cover no-repeat; animation: gallows-breathe var(--transition-duration, 3600ms) ease both; }
.transition-omen .transition-sky, .transition-night-arrives .transition-sky, .transition-night-stops .transition-sky { background: radial-gradient(circle at 50% 20%, rgba(170,35,48,.35), transparent 26%), radial-gradient(circle at 50% 76%, rgba(255,186,91,.16), transparent 34%), linear-gradient(160deg, #050507, #151019 54%, #07080b); }
.transition-wolf-win .transition-sky { background: radial-gradient(circle at 50% 28%, rgba(190,36,51,.42), transparent 24%), radial-gradient(circle at 72% 70%, rgba(255,139,78,.2), transparent 28%), linear-gradient(145deg, #08080b, #25111c 62%, #050506); animation: result-pulse var(--transition-duration, 6000ms) ease both; }
.transition-village-win .transition-sky { background: radial-gradient(circle at 50% 32%, rgba(255,252,178,.95) 0 8%, rgba(255,222,92,.62) 24%, transparent 46%), radial-gradient(circle at 25% 24%, rgba(255,255,255,.9) 0 1.1%, transparent 2.1%), radial-gradient(circle at 76% 36%, rgba(255,255,255,.9) 0 1.1%, transparent 2.1%), linear-gradient(145deg, #fff5a8, #a2ead8 48%, #e9fff5); animation: peace-glow var(--transition-duration, 5200ms) ease both; }
.transition-content { position: relative; z-index: 1; padding: 30px; text-align: center; text-shadow: 0 3px 18px rgba(23,27,59,.4); animation: transition-title var(--transition-duration, 1900ms) cubic-bezier(.2,.8,.2,1) both; }
.transition-mark { width: 82px; height: 82px; margin: 0 auto 16px; display: grid; place-items: center; border: 2px solid rgba(255,255,255,.7); border-radius: 50%; font-size: 42px; background: rgba(255,255,255,.14); box-shadow: 0 0 45px rgba(255,238,159,.4); }
.transition-victim .transition-mark { border-color: rgba(255,224,224,.76); background: rgba(81,19,45,.24); box-shadow: 0 0 48px rgba(255,107,120,.38); }
.transition-vote .transition-mark { border-color: rgba(221,226,241,.72); background: rgba(255,255,255,.09); box-shadow: 0 0 45px rgba(121,134,176,.24); }
.transition-discussion-end .transition-mark { background: rgba(255,255,255,.14); box-shadow: 0 0 45px rgba(237,228,255,.42); }
.transition-peace .transition-mark { color: #2d8c78; border-color: rgba(255,255,255,.92); background: rgba(255,255,255,.58); box-shadow: 0 0 48px rgba(255,239,125,.68); }
.transition-icon { width: 48px; height: 48px; overflow: visible; fill: currentColor; stroke: none; }
.transition-icon-sun { width: 50px; height: 50px; fill: currentColor; }
.transition-icon-claw { width: 51px; height: 51px; filter: drop-shadow(0 0 7px rgba(255,183,187,.42)); transform: rotate(-5deg); }
.transition-icon-ballot { width: 49px; height: 49px; color: #f2f3f8; filter: drop-shadow(0 0 7px rgba(167,180,222,.24)); }
.transition-icon-bell { width: 48px; height: 48px; filter: drop-shadow(0 0 7px rgba(255,255,255,.3)); }
.transition-vote .transition-content { text-shadow: 0 2px 16px rgba(0,0,0,.72); }
.transition-vote .transition-content small { color: #c7cbd7; font-size: 13px; letter-spacing: .04em; }
.transition-content p { margin: 0 0 8px; font-size: 10px; font-weight: 900; letter-spacing: .2em; }
.transition-content h2 { margin: 0; font-family: var(--display); font-size: clamp(34px, 11vw, 58px); }
.transition-content small { display: block; margin-top: 10px; font-size: 11px; }
.execution-result-content, .omen-content, .night-type-content, .win-transition-content { width: min(100%, 680px); }
.execution-result-content { display: grid; gap: 16px; text-shadow: 0 4px 28px rgba(0,0,0,.9); animation: transition-title var(--transition-duration, 3600ms) cubic-bezier(.2,.8,.2,1) both; }
.execution-result-content p, .omen-content p { margin: 0; font-family: var(--display); font-size: clamp(24px, 7.5vw, 48px); line-height: 1.35; letter-spacing: 0; opacity: 0; animation: line-reveal .72s cubic-bezier(.2,.8,.2,1) both; }
.execution-result-content p:nth-child(2), .omen-content p:nth-child(2) { animation-delay: .85s; }
.execution-result-content p:nth-child(3) { color: #ffdf9a; font-size: clamp(34px, 10vw, 66px); animation-delay: 1.75s; }
.omen-content p:first-child { color: #ffdf9a; }
.night-type-content h2 { max-width: 100%; color: #fff8e8; text-shadow: 0 0 28px rgba(183,37,52,.48); }
.night-type-content h2:not(.night-stops-text) { font-size: clamp(24px, 7vw, 44px); line-height: 1.55; }
.night-arrives-line-fixed { display: block; white-space: nowrap; }
.night-arrives-line > span { opacity: 0; animation: type-char .04s linear both; }
.night-stops-text { display: block !important; font-size: clamp(24px, 7vw, 44px) !important; line-height: 1.55; }
.night-stem { display: block !important; opacity: 0; animation: line-reveal .7s ease 0s both !important; }
.night-stops-line { display: block; white-space: nowrap; }
.night-denial { display: inline-block !important; margin-left: .08em; color: #ffde74; opacity: 0; transform: scale(1.35); animation: denial-pop .58s cubic-bezier(.16,1.2,.3,1) 2.15s both !important; text-shadow: 0 0 38px rgba(255,211,87,.72); }
.win-transition-content { text-shadow: 0 3px 24px rgba(0,0,0,.38); }
.win-transition-content h2 { color: #ffef9c; font-size: clamp(40px, 11vw, 72px); white-space: nowrap; }
.transition-village-win .win-transition-content { text-shadow: 0 3px 18px rgba(81,135,125,.18); }
.transition-village-win .win-transition-content p { color: #25776b; }
.transition-village-win .win-transition-content h2 { color: #25776b; }
.transition-village-win .win-transition-content small { color: #32605c; }
.transition-wolf-win .win-transition-content small { color: #f1cfd0; line-height: 1.9; }
@keyframes transition-out { 0%,78% { opacity: 1; } 100% { opacity: 0; } }
@keyframes dawn-rise { from { transform: scale(1.08) translateY(5%); filter: brightness(.55); } to { transform: scale(1.02) translateY(-2%); filter: brightness(1.05); } }
@keyframes dusk-fall { from { transform: scale(1.03) translateY(-2%); filter: brightness(1.25); } to { transform: scale(1.08) translateY(4%); filter: brightness(.7); } }
@keyframes transition-title { 0% { opacity: 0; transform: translateY(20px) scale(.94); } 24%,75% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-8px); } }
@keyframes vote-rays { from { transform: translate(-50%, -50%) rotate(0); } to { transform: translate(-50%, -50%) rotate(1turn); } }
@keyframes vote-calm { from { transform: scale(1.035); filter: brightness(.75); } to { transform: scale(1); filter: brightness(1); } }
@keyframes result-pulse { 0% { transform: scale(1.08); filter: saturate(.8) brightness(.72); } 50% { filter: saturate(1.2) brightness(1.05); } 100% { transform: scale(1); filter: saturate(1) brightness(.88); } }
@keyframes peace-glow { 0% { transform: scale(1.08); filter: brightness(.8); } 48% { filter: brightness(1.18); } 100% { transform: scale(1); filter: brightness(1); } }
@keyframes gallows-breathe { from { transform: scale(1.08); filter: brightness(.62) saturate(.85); } to { transform: scale(1.01); filter: brightness(.88) saturate(1); } }
@keyframes line-reveal { from { opacity: 0; transform: translateY(16px); filter: blur(7px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes type-char { to { opacity: 1; } }
@keyframes denial-pop { 0% { opacity: 0; transform: translateY(10px) scale(1.45); filter: blur(8px); } 100% { opacity: 1; transform: none; filter: none; } }

.winner { min-height: calc(100dvh - 135px); display: flex; flex-direction: column; justify-content: center; text-align: center; }
.winner-mark { width: 112px; height: 112px; margin: 0 auto 20px; display: grid; place-items: center; border-radius: 38px; color: white; background: linear-gradient(145deg, #8066e4, #654bc8); font-family: var(--display); font-size: 42px; font-weight: 900; box-shadow: 0 15px 36px rgba(116,88,214,.24); transform: rotate(-4deg); }
.winner-mark-wolf { background: linear-gradient(145deg, #f06a70, #c94751); box-shadow: 0 15px 36px rgba(201,71,81,.28); }
.winner h2 { margin: 0; font-family: var(--display); font-size: 31px; font-weight: 900; }
.winner > p { margin: 9px 0 22px; color: var(--muted); font-size: 11px; }
.x-result-button { width: min(100%, 320px); min-height: 48px; margin: -7px auto 20px; padding: 11px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border-radius: 15px; color: #fff; background: #0f1012; box-shadow: 0 9px 22px rgba(15,16,18,.18); font-size: 11px; font-weight: 900; text-decoration: none; }
.x-result-button span { font-family: var(--body); font-size: 15px; font-weight: 900; }
.x-result-button:active { transform: scale(.98); }
.winner > .btn-full { margin-top: 16px; }
.eyebrow { margin: 0 0 8px; color: var(--purple); font-size: 9px; font-weight: 900; letter-spacing: .17em; }
.empty { padding: 25px 14px; color: var(--muted); text-align: center; font-size: 10px; line-height: 1.65; }
.toast-region { position: fixed; z-index: 100; top: max(16px, env(safe-area-inset-top)); left: 50%; width: min(calc(100% - 30px), 440px); transform: translateX(-50%); display: grid; gap: 7px; pointer-events: none; }
.toast { padding: 12px 14px; border: 1px solid #e3ddd5; border-radius: 14px; color: var(--ink); background: rgba(255,255,255,.98); box-shadow: var(--shadow-strong); font-size: 10px; font-weight: 700; animation: toast-in .22s ease, toast-out .28s ease 3.7s forwards; }
.toast.error { color: #b9474f; border-color: #ffd2d6; background: #fff7f7; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px); } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.info-page { min-height: 100dvh; padding: max(24px, env(safe-area-inset-top)) 18px calc(34px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
.info-shell { position: relative; z-index: 1; width: min(100%, 720px); margin: 0 auto; }
.info-header { margin-bottom: 18px; }
.info-back { color: var(--purple); font-size: 11px; font-weight: 900; text-decoration: none; }
.info-card { padding: 22px; border: 1px solid rgba(230,224,216,.92); border-radius: 24px; background: rgba(255,255,255,.95); box-shadow: var(--shadow); }
.info-card h1 { margin: 0 0 16px; font-family: var(--display); font-size: 28px; line-height: 1.25; }
.info-card h2 { margin: 22px 0 8px; font-family: var(--display); font-size: 18px; }
.info-card p, .info-card li { color: #596377; font-size: 13px; line-height: 1.9; }
.info-card p { margin: 0 0 14px; }
.info-card ul, .info-card ol { margin: 8px 0 18px; padding-left: 1.4em; }
.info-card a { color: var(--purple); font-weight: 900; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.info-card .pending-note { padding: 14px; border-radius: 16px; color: #765a12; background: #fff7df; font-weight: 800; }
.contact-option { margin: 16px 0; padding: 17px; border: 1px solid #e6dfd5; border-radius: 18px; background: #fffdf9; }
.contact-option h2 { margin-top: 0; }
.contact-option p:last-child { margin-bottom: 0; }
.contact-link { min-height: 44px; padding: 10px 16px; display: inline-flex; align-items: center; justify-content: center; border-radius: 13px; color: #fff !important; background: var(--purple); box-shadow: 0 8px 18px rgba(116,88,214,.2); text-decoration: none; }
.ofuse-support { min-height: 42px; margin: 4px 0 10px; display: flex; justify-content: center; align-items: center; }
.info-card a[data-ofuse-widget-button] { max-width: 100%; }

@media (min-width: 680px) {
  .page { padding-inline: 28px; }
  .home { max-width: 560px; margin: auto; }
  .target-grid { grid-template-columns: repeat(3, 1fr); }
  .role-grid { grid-template-columns: repeat(3, 1fr); }
  .info-page { padding-inline: 28px; }
}

@media (max-width: 380px) {
  .sound-choice-actions { gap: 7px; }
  .sound-choice-button { padding-inline: 8px; gap: 7px; }
}

@media (max-height: 700px) {
  .sound-choice-logo { margin-bottom: 34px; }
  .sound-choice-actions { margin-top: 28px; }
  .turn-overlay { padding-block: 8px; }
  .turn-overlay-card { max-height: calc(100dvh - 16px); padding: 13px; border-radius: 22px; }
  .turn-overlay-card h2 { font-size: 22px; }
  .turn-overlay-head > p { margin-block: 3px 5px; font-size: 9px; }
  .turn-timer { margin-block: 3px 6px; }
  .turn-timer .timer-ring { width: 68px; height: 68px; }
  .turn-timer .timer-ring::before { width: 56px; height: 56px; }
  .turn-timer .timer-ring span { font-size: 18px; }
  .turn-timer .timer-copy strong { font-size: 14px; }
  .turn-timer .timer-copy small { margin-top: 2px; font-size: 8px; }
  .inline-vote-grid .target-card { min-height: 54px; padding: 6px 8px; }
  .turn-overlay-actions { padding-top: 7px; }
  .turn-overlay-actions .btn { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

/* 通信が途切れた夜 */
.connection-backdrop {
  position: fixed;
  z-index: 150;
  inset: 0;
  min-height: 100dvh;
  padding: max(18px, env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom));
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: linear-gradient(180deg, rgba(24, 29, 47, .25), rgba(24, 29, 47, .72));
  backdrop-filter: blur(6px) saturate(.75);
  animation: connection-fade .24s ease both;
}
.connection-dialog {
  width: min(100%, 430px);
  padding: 23px 20px 20px;
  border: 1px solid rgba(255,255,255,.85);
  border-radius: 27px;
  color: #313b52;
  background: rgba(255,253,249,.97);
  box-shadow: 0 28px 80px rgba(18, 22, 39, .35);
  text-align: center;
  animation: connection-rise .34s cubic-bezier(.16,.9,.25,1) both;
}
.connection-kicker { margin: 12px 0 6px; color: #6e59be; font-size: 9px; font-weight: 900; letter-spacing: .16em; }
.connection-dialog h2 { margin: 0; font-family: var(--display); font-size: 22px; line-height: 1.4; }
.connection-dialog > p:not(.connection-kicker):not(.connection-host-wait) { margin: 9px auto 16px; color: #6c7486; font-size: 11px; line-height: 1.8; }
.connection-pulse { width: 50px; height: 50px; margin: 0 auto; position: relative; display: grid; place-items: center; border-radius: 50%; background: #eeeaff; }
.connection-pulse::before, .connection-pulse::after { content: ""; position: absolute; border: 2px solid #826be0; border-radius: 50%; animation: connection-ring 1.7s ease-out infinite; }
.connection-pulse::before { inset: 10px; }
.connection-pulse::after { inset: 2px; animation-delay: .55s; }
.connection-pulse span { width: 10px; height: 10px; z-index: 1; border-radius: 50%; background: #7458d6; box-shadow: 0 0 0 5px rgba(116,88,214,.12); }
.connection-pulse.is-offline { background: #f2f0ee; }
.connection-pulse.is-offline::before, .connection-pulse.is-offline::after { border-color: #aaa5a0; animation: none; opacity: .45; }
.connection-pulse.is-offline span { background: #8d8985; box-shadow: none; }
.connection-pulse.is-restored { background: #e6fbf4; }
.connection-pulse.is-restored::before, .connection-pulse.is-restored::after { border-color: #49b996; animation: none; opacity: .55; }
.connection-pulse.is-restored span { background: #36a986; box-shadow: 0 0 0 5px rgba(73,205,167,.14); }
.connection-safety { margin: 0 0 15px; padding: 11px 12px; display: flex; align-items: center; gap: 10px; border-radius: 15px; background: #f1fbf7; text-align: left; }
.connection-safety > span { width: 27px; height: 27px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: white; background: #44be99; font-weight: 900; }
.connection-safety p { margin: 0; }
.connection-safety strong, .connection-safety small { display: block; }
.connection-safety strong { font-size: 10px; }
.connection-safety small { margin-top: 2px; color: #718077; font-size: 8px; line-height: 1.5; }
.connection-wait { height: 31px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.connection-wait i { width: 7px; height: 7px; border-radius: 50%; background: #8066e4; animation: connection-dot 1s ease-in-out infinite; }
.connection-wait i:nth-child(2) { animation-delay: .15s; }
.connection-wait i:nth-child(3) { animation-delay: .3s; }
.connection-host-wait { margin: 4px 0 0; padding: 13px; border-radius: 15px; color: #6f7687; background: #f4f1ed; font-size: 10px; font-weight: 900; }

.connection-page { min-height: 100dvh; padding: max(28px, env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom)); display: grid; place-items: center; }
.connection-page-card { width: min(100%, 390px); padding: 29px 22px 22px; border: 1px solid rgba(230,224,216,.9); border-radius: 28px; background: rgba(255,255,255,.92); box-shadow: var(--shadow-strong); text-align: center; }
.connection-page-card h1 { margin: 0; font-family: var(--display); font-size: 25px; line-height: 1.45; }
.connection-page-card > p:not(.eyebrow) { margin: 11px 0 20px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.connection-orbit { width: 74px; height: 74px; margin: 0 auto 18px; position: relative; display: grid; place-items: center; border-radius: 50%; border: 1px dashed #9b89e0; background: #f3efff; animation: orbit-turn 7s linear infinite; }
.connection-orbit span { width: 29px; height: 29px; border: 2px solid #7458d6; border-radius: 50% 50% 45% 55%; background: #fff; }
.connection-orbit i { position: absolute; width: 12px; height: 12px; top: 4px; left: 50%; border-radius: 50%; background: #ffd65a; box-shadow: 0 0 17px #ffd65a; }
.connection-orbit.is-offline { filter: grayscale(1); animation-play-state: paused; }

body.service-pause-open { color: #f8f1df; background: #10182b; }
body.service-pause-open .atmosphere { opacity: 0; }
.service-pause {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  padding: max(22px, env(safe-area-inset-top)) 18px calc(22px + env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 10%, rgba(118,139,202,.24), transparent 34%),
    radial-gradient(circle at 18% 84%, rgba(50,117,123,.22), transparent 30%),
    linear-gradient(165deg, #17233d 0%, #10182b 52%, #090e1b 100%);
}
.service-pause::before { content: ""; position: absolute; inset: 0; opacity: .45; background-image: radial-gradient(circle, rgba(255,245,203,.75) 0 1px, transparent 1.4px); background-size: 53px 53px; mask-image: linear-gradient(#000, transparent 72%); }
.service-pause-card { position: relative; z-index: 2; width: min(100%, 460px); text-align: center; animation: pause-arrive .6s cubic-bezier(.2,.8,.2,1) both; }
.service-pause-eyebrow { margin: 18px 0 8px; color: #c8b978; font-size: 9px; font-weight: 900; letter-spacing: .22em; }
.service-pause h1 { max-width: 360px; margin: 0 auto; color: #fff8e7; font-family: var(--display); font-size: clamp(28px, 8vw, 42px); line-height: 1.38; letter-spacing: .01em; text-shadow: 0 4px 24px rgba(0,0,0,.32); }
.service-pause-card > p:not(.service-pause-eyebrow) { max-width: 390px; margin: 15px auto 20px; color: #c9cfdd; font-size: 12px; line-height: 1.95; }
.service-pause-illustration { width: min(100%, 520px); aspect-ratio: 2.6; margin: 0 auto; overflow: hidden; }
.service-pause-illustration img { width: 100%; height: auto; display: block; transform: translateY(-10.5%); }
.service-pause-actions { display: grid; gap: 8px; }
.btn-pause-primary { color: #1d2941; background: linear-gradient(135deg, #f5e7ad, #dcc472); box-shadow: 0 12px 30px rgba(223,199,113,.16), inset 0 1px rgba(255,255,255,.55); }
.btn-pause-ghost { color: #d5daea; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.07); box-shadow: none; }
.night-mist { position: absolute; width: 85vw; height: 18vh; border-radius: 50%; filter: blur(45px); opacity: .11; pointer-events: none; }.night-mist-a { left: -30%; top: 24%; background: #a9bbe8; }.night-mist-b { right: -35%; bottom: 12%; background: #68c3b8; }

@keyframes connection-fade { from { opacity: 0; } }
@keyframes connection-rise { from { opacity: 0; transform: translateY(22px) scale(.97); } }
@keyframes connection-ring { from { opacity: .7; transform: scale(.7); } to { opacity: 0; transform: scale(1.35); } }
@keyframes connection-dot { 0%,100% { transform: translateY(2px); opacity: .45; } 50% { transform: translateY(-3px); opacity: 1; } }
@keyframes orbit-turn { to { transform: rotate(1turn); } }
@keyframes pause-arrive { from { opacity: 0; transform: translateY(13px); } }

@media (min-width: 680px) {
  .connection-backdrop { align-items: center; }
  .service-pause-card { padding-block: 18px; }
}

@media (max-height: 670px) {
  .service-pause { place-items: start center; }
  .service-pause-illustration { width: min(100%, 410px); }
  .service-pause-eyebrow { margin-top: 8px; }
  .service-pause h1 { font-size: 26px; }
  .service-pause-card > p:not(.service-pause-eyebrow) { margin-block: 10px 13px; line-height: 1.7; }
}

@media (prefers-reduced-motion: reduce) {
  .connection-backdrop, .connection-dialog, .connection-pulse::before, .connection-pulse::after,
  .connection-wait i, .connection-orbit, .service-pause-card {
    animation: none !important;
  }
}
