/* Undercover: secret envelopes, a visible speaking circle and deliberate vote confirmation. */
.page-game .game-shell.theme-undercover:not(.wide) .play:has(> [data-infiltration]) { display:block }
.page-game .game-shell.session-game.theme-undercover:not(.wide) .play > form[data-infiltration] { border:0; padding:0; max-width:none }
.uc-presets + .uc-composition { max-width:none }
.theme-undercover [data-custom] > .uc-custom-help { grid-column:1/-1 }
.theme-undercover .play > .uc-header { width:100%; max-width:none; margin:0 0 1.4rem; text-align:left }
.uc-phases { display:flex; flex-wrap:wrap; gap:.4rem 1.3rem; padding:0 0 .7rem; margin:0 0 1rem; list-style:none; border-bottom:1px solid var(--site-line) }
.uc-phases li { font-size:.8rem; color:var(--site-muted); padding:.25rem 0 }
.uc-phases li[aria-current=step] { color:var(--site-violet); font-weight:800; box-shadow:0 2px 0 var(--site-violet) }
.uc-status { display:flex; flex-wrap:wrap; justify-content:space-between; gap:.5rem 1rem; font-size:.86rem; color:var(--site-muted); margin:0 0 .4rem }
.uc-header h2 { margin:0 0 .4rem!important; color:var(--site-ink); font-size:clamp(1.5rem,3vw,2.5rem)!important; line-height:1.2 }
.theme-undercover .play .uc-header > p { margin:.3rem 0; max-width:none; text-align:left; color:var(--site-muted) }
.uc-presets { display:flex; flex-wrap:wrap; gap:.4rem; margin:.5rem 0 1rem }
.uc-presets button { padding:.45rem .75rem; border:1px solid #bcb0cf; background:#fff; border-radius:.5rem; color:var(--site-ink); min-height:42px }
.uc-presets button:hover { border-color:var(--site-violet); background:#f5f0fb }
.uc-composition { padding:.7rem 0; color:var(--site-ink); border-block:1px solid var(--site-line); font-size:.92rem; margin:0 0 1rem }
.uc-composition[data-valid=false] { color:#923549 }
.theme-undercover [data-infiltration] .session-fields { grid-template-columns:repeat(3,minmax(0,1fr)) }
.theme-undercover [data-infiltration] label:has([name=theme]) { grid-column:1/-1 }
.theme-undercover [data-infiltration] [data-custom] { grid-template-columns:repeat(2,minmax(0,1fr)) }
.uc-names { margin:.7rem 0 1rem; border:0!important; padding:0!important; background:none!important }
.uc-names summary { color:var(--site-ink); font-weight:650; cursor:pointer; padding:.6rem 0 }
.uc-names textarea { display:block; width:100%; min-height:6.5rem; font:inherit; border:1px solid #bcb0cf; border-radius:.5rem; padding:.6rem; resize:vertical; background:white; color:var(--site-ink) }
.uc-names p,.uc-custom-help { color:var(--site-muted); font-size:.84rem; line-height:1.6 }
.uc-deal { display:grid; grid-template-columns:minmax(0,1fr) minmax(16rem,1fr); align-items:center; gap:clamp(1rem,4vw,4rem); width:min(100%,66rem); margin:auto }
.uc-deal-copy { text-align:left }
.uc-deal-copy h3 { font-size:clamp(1.6rem,4vw,2.8rem); margin:.3rem 0; color:var(--site-ink) }
.uc-deal-copy p { color:var(--site-muted) }
.uc-deal-progress { width:100%; height:.4rem; accent-color:var(--site-violet) }
.theme-undercover .uc-deal .infiltration-card { position:relative; width:100%; min-height:22rem; margin:0; border:1px solid #c2b5d3; border-bottom:6px solid #a899ba; border-radius:1rem 1rem 1rem .2rem; padding:2rem; box-shadow:0 12px 30px -24px #2c1c48; background:#e9e1f2; color:var(--site-ink); perspective:800px }
.theme-undercover .uc-deal .infiltration-card:not(.is-open)::before { content:''; position:absolute; inset:8%; border:1px solid #c7b8d9; clip-path:polygon(0 0,50% 45%,100% 0,100% 100%,0 100%); pointer-events:none }
.uc-seal { display:grid; place-items:center; width:4rem; height:4rem; border-radius:50%; background:#6a518e; color:#fff; font-size:2rem; font-weight:750; margin-bottom:1rem; box-shadow:inset 0 0 0 5px #ffffff1a }
.theme-undercover .uc-deal .infiltration-card.is-open { background:#fffdf8; color:var(--site-ink); border-bottom-color:#d2c2ae }
.theme-undercover .uc-deal .infiltration-card strong { font-size:clamp(1.5rem,3.3vw,2.9rem); line-height:1.2 }
.uc-deal .infiltration-card > .uc-card-foot { font-size:.85rem; font-weight:500; color:#5c4d69; margin-top:1rem }
.uc-deal .infiltration-card .meta { font-size:.82rem; color:var(--site-muted) }
.uc-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(15rem,.48fr); gap:clamp(1rem,3vw,2.5rem); align-items:start; width:100%; max-width:86rem; margin:0 auto }
.uc-circle { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:.65rem }
.uc-person { position:relative; padding:.85rem; background:#fff; border:1px solid #ddd3e6; border-radius:.65rem; min-width:0; min-height:110px; text-align:left; overflow-wrap:anywhere }
.uc-person-number { color:#6b607e; font-size:.8rem }
.uc-person strong { display:block; font-size:1rem; margin:.25rem 0; line-height:1.3 }
.uc-person small { display:block; color:var(--site-muted); font-size:.76rem; line-height:1.5 }
.uc-person.is-current { border:2px solid var(--site-violet); background:#f7f2ff; box-shadow:0 3px 0 #d8c9eb }
.uc-person.is-out { background:#f2eff6; border-style:dashed }
.uc-turn { padding:1.3rem 0; border-top:3px solid var(--site-violet); text-align:left }
.uc-turn h3 { margin:0 0 .6rem; font-size:1.4rem; color:var(--site-ink) }
.uc-turn label { font-size:.88rem; display:block; font-weight:650; margin:.7rem 0 .3rem }
.uc-turn .actions { justify-content:flex-start!important }
.theme-undercover .infiltration-ballot { border:0; padding:0; background:none; max-width:none; gap:.65rem }
.theme-undercover .infiltration-seat { min-height:110px; border-radius:.65rem; padding:.75rem; background:white }
.theme-undercover .infiltration-seat[aria-current=true] { border-color:var(--site-violet); background:#f2eaf9; color:var(--site-ink); box-shadow:inset 0 0 0 1px var(--site-violet) }
.uc-ballot-note { grid-column:1/-1; font-size:.78rem; color:var(--site-muted); min-height:1.2em; line-height:1.4; font-weight:400 }
.uc-vote-tally { font-size:1.25rem; color:var(--site-violet) }
.uc-review { width:min(100%,52rem); margin-inline:auto; text-align:left }
.uc-review .scores { margin:1rem 0; width:100%; max-width:none }
.uc-review > p { line-height:1.7 }
.uc-result { width:min(100%,66rem); margin:auto }
.uc-result-grid { display:grid; grid-template-columns:1fr 1fr; gap:1.5rem }
.uc-result .infiltration-key { max-width:none; margin:0 }
.uc-event-log { text-align:left; margin-top:1.5rem }
.uc-event-log li { padding:.35rem 0; font-size:.9rem; color:var(--site-muted) }
@media(prefers-reduced-motion:no-preference) {
  .uc-person.is-current { animation:uc-turn-in .25s ease-out }
  .uc-deal .is-open { animation:uc-unseal .28s ease-out }
  @keyframes uc-turn-in { from { transform:translateY(3px); background:#e7daf7 } to { transform:none; background:#f7f2ff } }
  @keyframes uc-unseal { from { transform:rotateY(-12deg); opacity:.7 } to { transform:rotateY(0); opacity:1 } }
}
@media(max-width:900px) {
  .uc-circle { grid-template-columns:repeat(3,minmax(0,1fr)) }
  .uc-layout { grid-template-columns:minmax(0,1fr) }
  .uc-turn { grid-row:1; padding-top:.8rem }
}
@media(min-width:1000px) {
  .uc-circle:has(> .uc-person:nth-child(13)) { grid-template-columns:repeat(5,minmax(0,1fr)) }
}
@media(max-width:600px) {
  .theme-undercover [data-infiltration] .session-fields { grid-template-columns:repeat(2,minmax(0,1fr)) }
  .uc-deal { grid-template-columns:minmax(0,1fr); gap:1rem }
  .uc-deal-copy h3 { font-size:1.7rem }
  .theme-undercover .uc-deal .infiltration-card { min-height:15rem; padding:1.5rem }
  .uc-circle { grid-template-columns:repeat(2,minmax(0,1fr)) }
  .uc-result-grid { grid-template-columns:minmax(0,1fr) }
  .uc-person { padding:.65rem; min-height:94px }
}
@media(max-height:550px) and (orientation:landscape) {
  .uc-deal { grid-template-columns:1fr 1fr }
  .theme-undercover .uc-deal .infiltration-card { min-height:11rem; padding:1rem }
  .uc-header { margin-bottom:.6rem!important }
}

.page-game .game-shell.theme-undercover:has(.uc-header) {
  --uc-stage:#f4ebdd;--uc-ink:#19354c;--uc-accent:#2a5b71;
  background:radial-gradient(ellipse at 20% 0,#fff8eb,var(--uc-stage) 78%);color:var(--uc-ink);
}
.page-game .game-shell.theme-undercover:has(.uc-header) .game-toolbar {
  background:var(--uc-stage);color:var(--uc-ink);border-color:#c5b4a0;
}
.page-game .game-shell.theme-undercover:has(.uc-header) .game-toolbar .button,
.page-game .game-shell.theme-undercover .play .button.secondary {
  background:#fff7e6;color:var(--uc-ink);border-color:#ac9a84;
}
.page-game .game-shell.theme-undercover .play .button:not(.secondary) {
  background:var(--uc-accent);color:white;border-color:var(--uc-accent);
}
.theme-undercover .play > .uc-header {margin-bottom:1rem}
.uc-phases {gap:.45rem .6rem;border-color:#cbb89e}
.uc-phases li {padding:.33rem .55rem;color:#4c5964;border-radius:5px}
.uc-phases li[aria-current=step] {color:#fff9ec;background:#24495f;box-shadow:0 2px 0 #c78b42}
.uc-header h2 {color:var(--uc-ink);overflow-wrap:anywhere}
.theme-undercover .play .uc-header > p {color:#405666}
.uc-deal-copy :is(h3,p) {color:var(--uc-ink);overflow-wrap:anywhere}
.uc-deal-progress {accent-color:#337b89}
.theme-undercover .uc-deal .infiltration-card {
  min-width:0;background:repeating-linear-gradient(9deg,#ffffff06 0 1px,transparent 1px 5px),linear-gradient(140deg,#3b6176,#214056);
  color:#fff3d9;border-color:#a79069;border-bottom-color:#273a47;
  box-shadow:inset 0 0 0 3px #d3e0dd30,0 11px 24px #273a4728;
}
.theme-undercover .uc-deal .infiltration-card:not(.is-open)::before {border-color:#b2cbd27d}
.uc-seal {background:#bd823c;color:#1e344a;box-shadow:inset 0 0 0 4px #fff2c24a}
.theme-undercover .uc-deal .infiltration-card.is-open {
  background:#fff4d8;color:#1c4056;border-color:#b9a17a;border-bottom-color:#a89067;
}
.uc-deal .infiltration-card:is(.is-open) :is(.uc-card-foot,.meta) {color:#405b69}
.theme-undercover .uc-deal .infiltration-card strong {min-width:0;overflow-wrap:anywhere}
.uc-circle {
  padding:.75rem;border:1px solid #aa9774;border-radius:10px;
  background:linear-gradient(145deg,#334e64,#243e55);box-shadow:inset 0 0 0 3px #b8bec336,0 4px 0 #263949;
}
.uc-person,.theme-undercover .infiltration-seat {
  color:var(--uc-ink);background:linear-gradient(145deg,#fff7df,#f2dfb9);
  border-color:#c8a974;box-shadow:0 2px 0 #b0976a;
}
.uc-person-number,.uc-person small,.uc-ballot-note {color:#425968}
.uc-person.is-current,.theme-undercover .infiltration-seat[aria-current=true] {
  border-color:#216075;background:#bfe9ed;color:#13334b;
  box-shadow:0 0 0 2px #79bfc7,0 3px 0 #12485c;
}
.uc-person.is-current small {font-weight:750;color:#234f62}
.uc-person.is-out {background:#e9e7dc;border-style:dashed;box-shadow:none}
.uc-turn {
  padding:clamp(.85rem,2.3vw,1.5rem);border:1px solid #c6b08d;border-top:3px solid #a77b45;border-radius:8px;
  background:repeating-linear-gradient(0deg,transparent 0 26px,#80949918 26px 27px),#fff6e3;
  box-shadow:0 3px 0 #a48f6b50;
}
.uc-turn h3,.uc-turn label {color:var(--uc-ink)}
.theme-undercover .play .uc-turn input {min-height:46px;background:#fffefa;border-color:#91a8b0;color:var(--uc-ink)}
.uc-vote-tally,.theme-undercover .infiltration-seat .seat-number {color:#24536a}
@media(min-width:901px) {
  .uc-circle:has(> .uc-person:nth-child(6):last-child) {grid-template-columns:repeat(3,minmax(0,1fr))}
  .uc-circle:has(> .uc-person:nth-child(10):last-child) {grid-template-columns:repeat(5,minmax(0,1fr))}
}
@media(prefers-reduced-motion:no-preference) {
  @keyframes uc-turn-in {
    from {transform:translateY(2px);box-shadow:0 0 0 1px #79bfc7}
    to {transform:none;box-shadow:0 0 0 2px #79bfc7,0 3px 0 #12485c}
  }
}
@media(max-width:600px) {
  .page-game .game-shell.theme-undercover.wide .play:has(.uc-header) {
    min-height:0;justify-content:flex-start;margin-block:0;padding-block:1rem 1.65rem;
  }
  .uc-phases {gap:.28rem .3rem;margin-bottom:.7rem}
  .uc-phases li {font-size:.7rem;padding:.25rem .38rem}
  .uc-person {min-height:80px}
  .uc-circle {padding:.57rem;gap:.52rem}
  .theme-undercover .uc-deal .infiltration-card {min-height:12rem}
}
