.code-cover { background: linear-gradient(115deg,#872f40 0 45%,#332d3e 45% 54%,#1f5279 54%); color: white; }
.code-shell { max-width: 810px; padding-bottom: 2.5rem; }
.code-top, .code-actions, .code-clue { display:flex; align-items:center; gap:.65rem; flex-wrap:wrap; }
.code-top { justify-content:space-between; margin-bottom:1rem; }
.code-top h1 { margin:0; }
.code-teams { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.65rem; }
.code-team { padding:.65rem .85rem; border-left:5px solid; border-radius:6px; background:var(--bg-card); overflow-wrap:anywhere; }
.code-team.red { border-color:#f36972; } .code-team.blue { border-color:#58aef2; }
.code-team small { display:block; color:var(--text-secondary); }
.code-role, #code-help { margin:.65rem 0; } .code-role { font-weight:700; }
#code-turn { font-size:clamp(1.15rem,4vw,1.65rem); }
.code-clue { align-items:flex-end; margin:.75rem 0; }
.code-clue label { min-width:0; flex:1 1 6rem; } .code-clue label:first-child { flex:2 1 9rem; }
.code-clue input,.code-clue select { margin:.25rem 0 0; }
.code-board { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:clamp(3px,.8vw,8px); }
.code-card { display:flex; flex-direction:column; justify-content:center; align-items:center; width:100%; min-height:clamp(59px,10vw,87px); padding:3px; border:2px solid transparent; border-radius:7px; line-height:1.1; font-family:inherit; font-weight:700; font-size:clamp(.72rem,2.4vw,1.05rem); color:#292520; background:#f1e5cb; overflow-wrap:anywhere; text-align:center; touch-action:manipulation; }
.code-card:disabled { opacity:1; }
.code-card span { min-width:0; max-width:100%; } .code-card small { display:block; font-size:.66em; font-weight:600; margin-top:.3em; }
.code-card.red { background:#ffc3bd; color:#562021; border-color:#cf5c59; }
.code-card.blue { background:#b6dcff; color:#132f50; border-color:#5399ce; }
.code-card.neutral { background:#e9dfca; color:#3b3125; border-color:#aa9572; }
.code-card.assassin { background:#292631; color:white; border-color:#9280af; }
.code-card.revealed { border-style:dashed; }
.code-card.selected { outline:3px solid var(--accent); outline-offset:-3px; }
.code-actions { margin:.8rem 0; }
#code-setup label { display:block; margin:.5rem 0; } #code-setup select { margin-top:.15rem; }
#code-log ol { padding: .6rem 0 .4rem 1.4rem; }
#code-log li { margin-bottom:.3rem; }
/* Leave room for the persistent menu and theme buttons on a narrow screen. */
@media (max-width: 860px) {
    #screen-codenames { padding-top:calc(max(.75rem, env(safe-area-inset-top)) + 3rem); }
    .code-card { font-size:clamp(.77rem,3.4vw,1.05rem); }
}
