:root{
  font-family:-apple-system,BlinkMacSystemFont,"Hiragino Sans","Yu Gothic",system-ui,sans-serif;
  color:#25211d;
  background:#fff8f0;
  --bg:#fff8f0;
  --paper:#fffdf9;
  --ink:#25211d;
  --muted:#776f67;
  --line:#eaded2;
  --accent:#ff6b4a;
  --accent-dark:#e95234;
  --yellow:#ffcf5a;
  --blue:#4d8cf5;
  --green:#35a86b;
  --adult:#7e4dc6;
  --shadow:0 14px 42px rgba(70,45,24,.10);
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:var(--bg)}
body{min-height:100svh}
button,input{font:inherit}
button{cursor:pointer}
.hidden{display:none!important}
.app-shell{width:min(100%,760px);min-height:100svh;margin:0 auto;background:var(--bg);padding-bottom:env(safe-area-inset-bottom)}
.topbar{height:64px;padding:9px 14px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid rgba(55,42,30,.08);background:rgba(255,248,240,.92);backdrop-filter:blur(14px);position:sticky;top:0;z-index:20}
.brand-btn{border:0;background:transparent;padding:0;display:flex;align-items:center;gap:9px;text-align:left;color:var(--ink)}
.brand-mark{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;background:var(--accent);color:#fff;font-size:22px;font-weight:900;transform:rotate(-4deg)}
.brand-btn strong{display:block;font-size:17px;letter-spacing:.02em}.brand-btn small{display:block;font-size:9px;color:var(--muted);margin-top:1px}
.icon-btn{width:38px;height:38px;border-radius:12px;border:1px solid var(--line);background:var(--paper);font-size:18px;color:var(--ink)}
.view{padding:18px 14px 28px}
.hero{padding:28px 8px 24px}.hero-kicker,.eyebrow{font-size:10px;font-weight:900;letter-spacing:.14em;color:var(--accent);text-transform:uppercase}.hero h1{font-size:42px;line-height:1.03;margin:8px 0 13px;letter-spacing:-.04em}.hero h1 span{color:var(--accent)}.hero p{margin:0;color:var(--muted);font-size:14px;line-height:1.65;max-width:500px}
.section-head{display:flex;align-items:end;justify-content:space-between;margin:12px 3px 10px}.section-head h2{margin:0;font-size:20px}.section-head span{font-size:10px;color:var(--muted)}
.game-card{width:100%;display:grid;grid-template-columns:58px 1fr 24px;align-items:center;gap:12px;border:1px solid var(--line);border-radius:20px;background:var(--paper);padding:16px;text-align:left;color:var(--ink);box-shadow:var(--shadow)}
.game-card:active{transform:scale(.992)}.game-icon{width:58px;height:58px;border-radius:18px;background:linear-gradient(135deg,#ff7758,#ffba62);display:grid;place-items:center;color:white;font-size:31px;font-weight:900}.game-title-row{display:flex;align-items:center;gap:8px}.game-copy h3{font-size:18px;margin:0}.game-copy p{font-size:12px;color:var(--muted);margin:5px 0 9px;line-height:1.45}.game-meta{display:flex;gap:7px}.game-meta span,.ready-badge{font-size:9px;font-weight:800;border-radius:999px;padding:3px 7px;background:#f5eee7;color:#6a5f56}.ready-badge{background:#e8f7ee;color:#278453}.arrow{font-size:30px;color:#b6aa9e}
.coming-note{margin-top:13px;border:1px dashed #d9cbbb;border-radius:16px;padding:13px 15px;color:var(--muted);display:grid;gap:4px}.coming-note strong{font-size:12px;color:#5a5048}.coming-note span{font-size:11px;line-height:1.5}
.back-btn,.text-btn{border:0;background:transparent;padding:7px 0;color:var(--muted)}.screen-title{font-size:30px;margin:5px 0 16px}.setup-card,.play-card{border:1px solid var(--line);background:var(--paper);border-radius:22px;padding:17px;box-shadow:var(--shadow)}
.field-head{margin:4px 1px 8px;display:flex;align-items:center;justify-content:space-between}.field-head:not(:first-child){margin-top:22px}.field-head strong{font-size:14px}.field-head span{font-size:10px;color:var(--muted)}
.count-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:7px}.count-grid button{height:42px;border-radius:12px;border:1px solid var(--line);background:#fff;color:var(--ink);font-weight:800}.count-grid button.active{background:var(--accent);border-color:var(--accent);color:#fff}
.name-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:7px}.name-grid input{width:100%;height:42px;padding:0 11px;border-radius:11px;border:1px solid var(--line);background:#fff;color:var(--ink);outline:none}.name-grid input:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(255,107,74,.10)}
.category-list{display:grid;grid-template-columns:repeat(2,1fr);gap:7px}.category-item{min-height:46px;border:1px solid var(--line);border-radius:13px;background:#fff;display:flex;align-items:center;gap:9px;padding:9px 11px;cursor:pointer}.category-item input{width:19px;height:19px;accent-color:var(--accent);margin:0}.category-item span{font-size:12px;font-weight:700}.category-item.adult{border-color:rgba(126,77,198,.24);background:#fbf8ff}.category-item.adult input{accent-color:var(--adult)}.adult-pill{margin-left:auto;font-size:8px!important;color:#fff;background:var(--adult);padding:2px 5px;border-radius:999px}.adult-note{font-size:10px;color:var(--muted);margin:7px 2px 0}
.primary-btn,.secondary-btn{width:100%;min-height:48px;border-radius:14px;font-weight:900;border:1px solid transparent}.primary-btn{background:var(--accent);color:#fff;box-shadow:0 8px 18px rgba(255,107,74,.18)}.primary-btn:disabled{opacity:.4;box-shadow:none}.secondary-btn{background:#fff;border-color:var(--line);color:var(--ink)}.setup-card>.primary-btn{margin-top:22px}
.game-view{padding-top:8px}.game-status{height:26px;padding:0 3px;display:flex;align-items:center;justify-content:space-between;font-size:9px;font-weight:900;letter-spacing:.08em;color:var(--muted)}.game-status span:last-child{color:var(--accent)}.state-card{min-height:calc(100dvh - 64px - 26px - 22px)}.state-card h2{margin:6px 0 15px;font-size:27px;line-height:1.24;letter-spacing:-.02em}.choice-preview{display:grid;grid-template-columns:1fr 1fr;gap:9px}.choice-card{min-height:142px;border-radius:18px;padding:15px;display:flex;flex-direction:column;justify-content:space-between}.choice-card span,.vote-btn span{font-size:25px;font-weight:1000}.choice-card strong{font-size:18px;line-height:1.35}.choice-card.a{background:#fff0d6;color:#674d10}.choice-card.b{background:#e8f1ff;color:#1f518c}.bottom-actions{margin-top:18px;display:grid;gap:8px}.text-danger-btn{border:0;background:transparent;color:#b4554a;font-size:12px;padding:6px}.center-state{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}.center-state h2{margin-bottom:8px}.center-state p{font-size:12px;color:var(--muted);line-height:1.6;max-width:360px}.center-state .primary-btn{margin-top:16px;max-width:390px}.pass-avatar{width:82px;height:82px;border-radius:28px;background:linear-gradient(135deg,var(--accent),#ffad54);color:#fff;display:grid;place-items:center;font-size:39px;font-weight:1000;margin:10px 0 15px;box-shadow:0 10px 24px rgba(255,107,74,.22)}
.vote-top{display:flex;align-items:flex-start;justify-content:space-between}.vote-top h2{margin-bottom:4px}.vote-top>span{font-size:11px;font-weight:800;color:var(--muted);padding-top:5px}.voteScreen h3,.vote-state h3{font-size:17px}.vote-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:14px}.vote-btn{border:0;border-radius:20px;min-height:230px;padding:17px;display:flex;flex-direction:column;align-items:flex-start;justify-content:space-between;text-align:left}.vote-btn strong{font-size:20px;line-height:1.35}.vote-a{background:#ffcf65;color:#5d4310}.vote-b{background:#78a9ff;color:#102e5c}.privacy-tip{text-align:center;color:var(--muted);font-size:10px;margin:13px 0 0}.ready-icon{width:68px;height:68px;border-radius:50%;display:grid;place-items:center;background:#e8f7ee;color:var(--green);font-size:33px;font-weight:900;margin-bottom:14px}
.result-state{display:flex;flex-direction:column}.minority-headline{font-size:29px;font-weight:1000;line-height:1.1;color:var(--accent);margin:5px 0 7px}.result-state h2{font-size:16px;margin:0 0 10px;color:var(--muted);font-weight:700}.result-columns{display:grid;grid-template-columns:1fr 1fr;gap:8px;min-height:0;flex:1}.result-choice{border-radius:17px;padding:12px;display:flex;flex-direction:column;min-width:0}.result-choice.a{background:#fff0d6;color:#674d10}.result-choice.b{background:#e8f1ff;color:#1f518c}.result-choice.minority{outline:3px solid var(--accent);box-shadow:0 0 0 4px rgba(255,107,74,.12)}.result-choice .result-letter{font-size:22px;font-weight:1000}.result-choice .result-answer{font-size:13px;font-weight:900;line-height:1.35;margin:3px 0 7px}.result-choice .count{font-size:23px;font-weight:1000}.result-choice .names{margin-top:auto;display:flex;flex-wrap:wrap;gap:4px;padding-top:8px}.name-chip{font-size:9px;font-weight:800;background:rgba(255,255,255,.65);padding:4px 6px;border-radius:999px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bottom-actions.compact{grid-template-columns:1.45fr 1fr;margin-top:9px}
.menu-dialog{width:min(92vw,430px);border:1px solid var(--line);border-radius:22px;background:var(--paper);color:var(--ink);padding:18px;box-shadow:0 20px 60px rgba(70,45,24,.2)}.menu-dialog::backdrop{background:rgba(42,29,18,.48);backdrop-filter:blur(4px)}.menu-dialog h3{margin:0 0 10px}.menu-dialog>.secondary-btn{margin-top:8px}.menu-dialog>.text-btn{width:100%;margin-top:7px}.danger{color:#a8493d;border-color:#edd2ce}.dialog-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}.confirm-dialog p{color:var(--muted);font-size:12px;line-height:1.5}.danger-solid{background:#b84f40}
body.game-active{height:100dvh;overflow:hidden;overscroll-behavior:none}body.game-active .app-shell{height:100dvh;min-height:0;display:flex;flex-direction:column;overflow:hidden}body.game-active .topbar{flex:0 0 56px;height:56px}body.game-active .brand-btn small{display:none}body.game-active .brand-mark{width:34px;height:34px;border-radius:10px;font-size:19px}body.game-active #gameView{height:calc(100dvh - 56px);min-height:0;display:grid;grid-template-rows:26px minmax(0,1fr);padding:4px 9px max(5px,env(safe-area-inset-bottom));overflow:hidden}body.game-active .state-card{min-height:0;height:100%;overflow:hidden;padding:14px}body.game-active .choice-card{min-height:125px}body.game-active .vote-btn{min-height:210px}
@media(max-height:720px){body.game-active .topbar{flex-basis:50px;height:50px}body.game-active #gameView{height:calc(100dvh - 50px);grid-template-rows:22px minmax(0,1fr);padding-top:2px}.game-status{height:22px}.state-card h2{font-size:23px;margin-bottom:10px}.choice-card{min-height:112px;padding:12px}.choice-card strong{font-size:16px}.vote-btn{min-height:185px}.vote-btn strong{font-size:18px}.pass-avatar{width:70px;height:70px;font-size:33px}.result-choice{padding:9px}.minority-headline{font-size:25px}}
@media(max-width:390px){.hero h1{font-size:38px}.view{padding-left:10px;padding-right:10px}.setup-card{padding:14px}.category-list{grid-template-columns:1fr 1fr}.state-card{padding:12px}.choice-preview,.vote-grid,.result-columns{gap:6px}.choice-card strong{font-size:16px}.vote-btn{padding:14px}.vote-btn strong{font-size:18px}}


/* Ver.1.0.1 result readability */
.result-choice .names-label{
  margin-top:8px;
  font-size:9px;
  font-weight:900;
  letter-spacing:.04em;
  opacity:.62;
}
.result-choice .names{
  margin-top:4px;
  padding-top:0;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:5px;
  align-content:start;
}
.name-chip{
  display:block;
  min-width:0;
  font-size:12px;
  line-height:1.15;
  font-weight:900;
  text-align:center;
  background:rgba(255,255,255,.76);
  padding:6px 5px;
  border-radius:9px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.result-choice .result-answer{
  font-size:14px;
}
@media(max-height:720px){
  .result-choice .names-label{margin-top:5px;font-size:8px}
  .result-choice .names{gap:4px}
  .name-chip{font-size:11px;padding:5px 4px;border-radius:8px}
}
@media(max-width:360px){
  .name-chip{font-size:10.5px;padding:5px 3px}
}


/* Ver.1.1 匿名投票 */
.anonymous-card .game-icon { background: linear-gradient(145deg,#6758dd,#8b75ff); color:#fff; }
.adult-toggle-row { margin-top:22px; padding:16px; border:1px solid var(--line); border-radius:16px; display:flex; align-items:center; justify-content:space-between; gap:14px; background:rgba(255,255,255,.04); }
.adult-toggle-row > div { display:grid; gap:4px; }
.adult-toggle-row span { font-size:12px; opacity:.64; }
.adult-toggle-row input { width:26px; height:26px; accent-color:var(--accent); flex:0 0 auto; }
.anonymous-note { margin:10px 0 4px; padding:12px 14px; border-radius:13px; background:#f3efff; border:1px solid #d8cff8; font-size:12px; line-height:1.55; color:#51476f; font-weight:700; }
.anon-question-state { justify-content:space-between; }
.anon-question-text { font-size:clamp(25px,7vw,38px); line-height:1.38; text-align:center; margin:18px 0 12px; }
.anonymous-rule-pill { margin:0 auto 14px; width:max-content; max-width:100%; padding:7px 12px; border-radius:999px; font-size:11px; background:rgba(103,88,221,.14); border:1px solid rgba(139,117,255,.28); color:#dcd6ff; }
.anon-vote-question { font-size:21px; line-height:1.4; margin:8px 0 7px; }
.candidate-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-top:10px; }
.candidate-btn { min-height:62px; border-radius:15px; border:1px solid var(--line); color:#fff; background:linear-gradient(145deg,rgba(50,42,125,.85),rgba(30,25,79,.95)); display:flex; align-items:center; gap:9px; padding:8px 10px; text-align:left; }
.candidate-btn:active { transform:scale(.98); }
.candidate-avatar { width:35px; height:35px; border-radius:50%; display:grid; place-items:center; flex:0 0 auto; background:#8b75ff; color:#fff; font-weight:900; }
.candidate-avatar.small { width:30px; height:30px; font-size:12px; }
.candidate-btn strong { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.anon-result-state { overflow:hidden; }
.anon-result-list { display:grid; gap:7px; margin:8px 0 5px; }
.anon-result-row { display:grid; grid-template-columns:minmax(92px,1.2fr) minmax(70px,2fr) 46px; align-items:center; gap:8px; min-height:45px; padding:6px 8px; border:1px solid var(--line); border-radius:13px; background:rgba(255,255,255,.04); }
.anon-result-row.top { border-color:rgba(255,199,65,.68); background:rgba(255,199,65,.09); }
.anon-result-name { display:flex; align-items:center; gap:7px; min-width:0; }
.anon-result-name strong { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.anon-bar-track { height:8px; border-radius:999px; background:rgba(255,255,255,.1); overflow:hidden; }
.anon-bar-track span { display:block; height:100%; min-width:0; border-radius:inherit; background:linear-gradient(90deg,#6758dd,#a48fff); }
.anon-result-row.top .anon-bar-track span { background:linear-gradient(90deg,#ffb02e,#ffd56d); }
.anon-vote-count { text-align:right; white-space:nowrap; }
.anon-vote-count strong { font-size:23px; line-height:1; }
.anon-vote-count small { font-size:10px; opacity:.65; margin-left:2px; }
.anonymous-secret-note { text-align:center; font-size:10px; opacity:.52; margin:3px 0; }

body.game-active #anonGameView { height:calc(100dvh - var(--topbar-h,58px)); overflow:hidden; }
body.game-active #anonGameView .state-card { min-height:0; height:100%; }
@media (max-height:760px) {
  .anon-question-text { font-size:24px; margin:10px 0 8px; }
  .candidate-grid { gap:5px; margin-top:6px; }
  .candidate-btn { min-height:48px; padding:5px 8px; border-radius:11px; }
  .candidate-avatar { width:29px; height:29px; font-size:12px; }
  .anon-vote-question { font-size:17px; margin:3px 0; }
  .anon-result-list { gap:4px; margin:4px 0; }
  .anon-result-row { min-height:36px; padding:3px 6px; grid-template-columns:minmax(82px,1.15fr) minmax(55px,2fr) 40px; gap:5px; }
  .candidate-avatar.small { width:24px; height:24px; font-size:10px; }
  .anon-vote-count strong { font-size:18px; }
}
@media (min-width:560px) {
  .candidate-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
