/* Not Codenames on the phones: the team picker, a big whose-turn bar, the grid,
   the clue composer and the touch sheet. Dark rules first, then the light theme. */
.cnp { --red: #d9412f; --blue: #2d6fd6; --gold: #ffb800; display: flex; flex-direction: column; gap: 10px; padding-bottom: 18px; }
.cnp .t-red, .cnp.t-red, .cnp-moment.t-red { --tc: var(--red); --tc2: #a82a1c; }
.cnp .t-blue, .cnp.t-blue, .cnp-moment.t-blue { --tc: var(--blue); --tc2: #1c4fa6; }
.cnp [hidden] { display: none !important; }
.cnp .avatar.xs { width: 17px; height: 17px; font-size: 9px; box-shadow: 0 0 0 1.5px #fff; }

/* ---- picking teams ---- */
.cnp-logo { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 0 0; }
.cnp-not { font-family: var(--cn-font); background: var(--red); color: #fff; font-size: 16px; font-weight: 900; letter-spacing: .18em; padding: 4px 6px 4px 10px; border-radius: 6px; transform: rotate(-7deg); }
.cnp-lword { font-family: var(--cn-font); font-size: 40px; font-weight: 900; letter-spacing: .05em; line-height: 1; }
.cnp-hint { text-align: center; color: var(--label-2); font-size: 15px; }
.cnp-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cnp-team { --tc: var(--red); --tc2: #a82a1c; text-align: left; border: 3px solid transparent; border-radius: 20px; padding: 0 0 10px; background: rgba(0,0,0,.3); color: var(--text); display: flex; flex-direction: column; gap: 8px; overflow: hidden; cursor: pointer; min-height: 210px; transition: transform .12s, border-color .2s; }
.cnp-team.t-blue { --tc: var(--blue); --tc2: #1c4fa6; }
.cnp-team:active { transform: scale(.98); }
.cnp-team.mine { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(255,184,0,.25), 0 10px 26px rgba(0,0,0,.3); }
.cnp-tn { font-family: var(--cn-font); font-size: 28px; font-weight: 900; letter-spacing: .06em; color: #fff; background: linear-gradient(135deg, var(--tc), var(--tc2)); padding: 8px 12px; display: flex; align-items: center; }
.cnp-tn i { font-style: normal; margin-left: auto; font-size: 16px; background: rgba(255,255,255,.25); border-radius: 999px; padding: 2px 10px; }
.cnp-mems { display: flex; flex-direction: column; gap: 6px; padding: 0 10px; flex: 1; }
.cnp-mem { display: flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 700; min-width: 0; flex-wrap: wrap; }
.cnp-mem em { font-style: normal; font-size: 11px; color: var(--label-2); font-weight: 600; }
.cnp-spytag { font-size: 9px; font-weight: 900; letter-spacing: .12em; background: var(--gold); color: #1b1b1b; padding: 2px 6px; border-radius: 999px; }
.cnp-empty { color: var(--label-3); font-size: 14px; }
.cnp-join { margin: 0 10px; text-align: center; font-size: 13px; font-weight: 800; padding: 7px; border-radius: 10px; background: color-mix(in srgb, var(--tc) 22%, transparent); color: var(--text); }
.cnp-team.mine .cnp-join { background: var(--gold); color: #1b1b1b; }
.cnp-spybtn { background: linear-gradient(120deg, #ffd60a, #ffb000); color: #1b1b1b; font-weight: 800; }
.cnp-spybtn.on, .cnp-spybtn.alt { background: var(--bg-3); color: var(--text); }
.cnp-explain { font-size: 14px; color: var(--label-2); line-height: 1.4; text-align: center; padding: 0 6px; }
.cnp-explain b { color: var(--text); }
.cnp-undec { font-size: 14px; color: var(--label-2); text-align: center; }
.cnp-lead { background: rgba(0,0,0,.3); border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.cnp-ltitle { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--label-2); }
.cnp-lrow { display: grid; grid-template-columns: 1fr 1.3fr; gap: 8px; }
.cnp-prob { font-size: 13px; color: var(--label-2); line-height: 1.35; }
.cnp-prob.no { color: #ff8a7a; font-weight: 700; }
.cnp-wait { text-align: center; color: var(--label-2); font-size: 15px; padding: 8px; }

/* ---- whose turn ---- */
.cnp-bar { display: flex; flex-direction: column; gap: 2px; border-radius: 18px; padding: 12px 14px; }
.cnp-bar b { font-family: var(--cn-font); font-size: 30px; font-weight: 900; font-style: italic; letter-spacing: .01em; line-height: 1; }
.cnp-bar span { font-size: 15px; font-weight: 700; }
.cnp-bar.me { background: linear-gradient(120deg, #ffd60a, #ffb000); color: #1b1b1b; box-shadow: 0 10px 30px rgba(255,190,0,.45); animation: cnp-pop .35s cubic-bezier(.2,1.4,.4,1) both, cnp-throb 1.6s ease-in-out .4s infinite; }
.cnp-bar.end { background: linear-gradient(135deg, var(--tc), var(--tc2)); color: #fff; animation: cnp-pop .35s cubic-bezier(.2,1.4,.4,1) both; }
.cnp-bar.idle { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 8px; background: rgba(0,0,0,.3); color: var(--label-2); }
.cnp-bar.idle span { font-weight: 600; }
.cnp-bar.idle b { font-size: 16px; font-style: normal; font-family: var(--font); color: var(--tc); }
.cnp-bar.idle small { margin-left: auto; font-size: 13px; }
.cnp-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--tc); box-shadow: 0 0 10px var(--tc); }
@keyframes cnp-pop { from { transform: scale(.85); opacity: 0; } }
@keyframes cnp-throb { 50% { box-shadow: 0 10px 40px rgba(255,190,0,.75); transform: scale(1.015); } }
body.cnp-myturn::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 15; box-shadow: inset 0 0 0 5px #ffc400, inset 0 0 50px rgba(255,196,0,.45); animation: cnp-frame 1.6s ease-in-out infinite; }
@keyframes cnp-frame { 50% { box-shadow: inset 0 0 0 7px #ffc400, inset 0 0 80px rgba(255,196,0,.6); } }
.cnp-scores { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--label-2); font-weight: 600; }
.cnp-sc b { font-family: var(--cn-font); font-size: 24px; font-weight: 900; color: var(--tc); margin-right: 3px; vertical-align: -2px; }
.cnp-me { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--tc, #888) 22%, transparent); color: var(--text); }

/* ---- the clue in play ---- */
.cnp-cluebox:empty { display: none; }
.cnp-clue { display: flex; align-items: center; gap: 10px; border-radius: 16px; padding: 8px 10px; background: linear-gradient(135deg, var(--tc), var(--tc2)); color: #fff; }
.cnp-clue.wait { justify-content: center; font-weight: 700; font-size: 14px; }
.cnp-cw { font-family: var(--cn-font); font-size: 26px; font-weight: 900; letter-spacing: .03em; background: #fffdf7; color: #1d1813; border-radius: 9px; padding: 2px 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; animation: cnp-pop .4s cubic-bezier(.2,1.5,.4,1) both; }
.cnp-cn { flex: none; width: 38px; height: 38px; border-radius: 50%; background: #1d1813; color: #fff; font-family: var(--cn-font); font-size: 24px; font-weight: 900; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 3px #fff; }
.cnp-pips { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.cnp-pips i { width: 12px; height: 12px; border-radius: 50%; background: #fff; }
.cnp-pips i.used { background: transparent; box-shadow: inset 0 0 0 2px rgba(255,255,255,.5); }
.cnp-pips em { font-style: normal; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.cnp-clock { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-weight: 800; font-size: 14px; }
.cnp-clock .timer { flex: 1; }

/* ---- the grid ---- */
.cnp-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin: 0 -8px; transition: opacity .3s, filter .3s; }
.cnp-cell { position: relative; min-width: 0; }
.cnp-cell .cncard { height: auto; aspect-ratio: 1.38; }
.cnp-grid .cncard .cn-echo, .cnp-grid .cncard .cn-seal { display: none; }
.cnp-grid .cncard .cn-band { height: 58%; bottom: 12%; left: 5%; right: 5%; padding: 0 1.5cqw; }
.cnp-grid .cncard .cn-w { font-size: min(21cqw, calc(190cqw / var(--len, 6))); }
.cnp-grid .cncard .cn-tag { right: 3cqw; bottom: 3cqw; padding: 1cqw 2.5cqw; }
.cnp-grid .cncard .cn-tag .cn-w { font-size: min(12cqw, calc(110cqw / var(--len, 6))); }
.cnp-grid .cncard.cnp-can { cursor: pointer; }
.cnp-grid .cncard.cnp-can .cn-in { box-shadow: 0 1.2cqw 3cqw rgba(0,0,0,.3), inset 0 0 0 .7cqw rgba(255,255,255,.7), inset 0 0 0 2cqw rgba(255,184,0,.35); }
.cnp-grid .cncard.cnp-sel .cn-in { outline: 3px solid var(--gold); outline-offset: 1px; transform: scale(1.06); z-index: 2; }
.cnp-grid .cncard[class*="key-"] { cursor: pointer; }
.cnp-pts { position: absolute; right: 2px; top: 2px; display: flex; gap: 1px; z-index: 3; }
.cnp.waiting .cnp-grid { opacity: .7; filter: saturate(.75); }
.cnp-grid .cncard.cnp-in .cn-in { animation: cnp-in .5s cubic-bezier(.2,1.2,.35,1) both; animation-delay: inherit; }
@keyframes cnp-in { from { transform: translateY(-30vh) rotate(-8deg) scale(.6); opacity: 0; } 60% { opacity: 1; } }
.cnp-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 12px; font-size: 12px; font-weight: 700; color: var(--label-2); }
.cnp-legend:empty { display: none; }
.cnp-lg { display: inline-flex; align-items: center; gap: 5px; }
.cnp-lg i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.cnp-lg.k-red i { background: var(--red); } .cnp-lg.k-blue i { background: var(--blue); }
.cnp-lg.k-bystander i { background: #e3d2a8; box-shadow: inset 0 0 0 2px #cdb889; } .cnp-lg.k-assassin i { background: #0b0b0c; box-shadow: inset 0 0 0 2px #e5392b; }
.cnp-tip { font-size: 13px; color: var(--label-2); text-align: center; }
.cnp-log { font-size: 13px; line-height: 1.4; color: var(--label-2); text-align: center; }
.cnp-log div:last-child { color: var(--text); font-weight: 600; }
.cnp-log .l-assassin, .cnp-log .l-oops { color: #ff8a7a !important; }

/* ---- the dock ---- */
.cnp.docked { padding-bottom: 196px; }
.cnp-dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; max-width: 520px; margin: 0 auto; padding: 12px 14px calc(var(--safe-bottom) + 14px); background: linear-gradient(to top, rgba(10,12,18,.96) 75%, rgba(10,12,18,0)); display: flex; flex-direction: column; gap: 8px; }
.cnp-compose { display: flex; flex-direction: column; gap: 8px; }
.cnp-crow { display: flex; gap: 8px; }
.cnp-crow input[type=text] { flex: 1; font-family: var(--cn-font); font-size: 22px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; min-height: 52px; background: #fffdf7; color: #1d1813; border-radius: 14px; }
.cnp-crow input::placeholder { text-transform: none; font-family: var(--font); font-weight: 500; font-size: 16px; letter-spacing: 0; color: #9a8f7c; }
.cnp-crow .btn { width: auto; flex: none; padding: 0 22px; font-weight: 800; }
.cnp-nums { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 4px; }
.cnp-n { border: none; border-radius: 10px; min-height: 44px; font-family: var(--cn-font); font-size: 20px; font-weight: 900; background: var(--bg-3); color: var(--text); cursor: pointer; padding: 0; }
.cnp-n.on { background: var(--gold); color: #1b1b1b; box-shadow: 0 4px 14px rgba(255,184,0,.45); }
.cnp-end { min-height: 56px; font-weight: 800; background: var(--bg-3); }
.cnp-end:not(:disabled) { background: #fff; color: #1d1813; }
.cnp-take { background: linear-gradient(120deg, #ffd60a, #ffb000); color: #1b1b1b; font-weight: 800; }

/* ---- the touch sheet and the key sheet ---- */
.cnp-ov { position: fixed; inset: 0; z-index: 40; background: rgba(4,6,12,.62); backdrop-filter: blur(3px); display: flex; align-items: flex-end; justify-content: center; padding: 12px; animation: cnp-fade .15s both; }
@keyframes cnp-fade { from { opacity: 0; } }
.cnp-sheet { width: 100%; max-width: 480px; background: #161a24; border: 1px solid rgba(255,255,255,.12); border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 -10px 40px rgba(0,0,0,.5); animation: sheet-up .25s cubic-bezier(.2,1,.3,1) both; }
.cnp-bigcard { width: min(72vw, 300px); aspect-ratio: 1.45; align-self: center; margin: 4px 0 6px; animation: cnp-lift .3s cubic-bezier(.2,1.3,.4,1) both; }
@keyframes cnp-lift { from { transform: translateY(60px) scale(.7); opacity: 0; } }
.cnp-q { font-size: 22px; font-weight: 700; text-align: center; }
.cnp-q b { font-family: var(--cn-font); font-weight: 900; letter-spacing: .03em; }
.cnp-sub { font-size: 14px; color: var(--label-2); text-align: center; line-height: 1.35; }
.cnp-touch { min-height: 58px; font-size: 19px; font-weight: 800; }

/* ---- the big moments, on every phone ---- */
.cnp-moment { position: fixed; inset: 0; z-index: 90; pointer-events: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 20px; background: radial-gradient(circle, color-mix(in srgb, var(--tc) 60%, transparent), rgba(0,0,0,.72) 75%); animation: cnp-moment 3.6s ease both; }
.cnp-moment.assassin { background: radial-gradient(circle at 50% 40%, rgba(229,57,43,.6), rgba(0,0,0,.88) 72%); }
@keyframes cnp-moment { 0% { opacity: 0; } 8% { opacity: 1; } 82% { opacity: 1; } 100% { opacity: 0; } }
.cnp-mcard { width: min(66vw, 280px); aspect-ratio: 1.45; transform: rotate(-4deg); animation: cnp-slam .55s cubic-bezier(.2,1.5,.4,1) both; filter: drop-shadow(0 20px 30px rgba(0,0,0,.5)); }
.cnp-moment.assassin .cnp-mcard { animation: cnp-slam .55s cubic-bezier(.2,1.5,.4,1) both, cnp-shake .4s .55s ease-in-out 3; }
@keyframes cnp-slam { from { transform: rotate(-4deg) scale(2.6); opacity: 0; } }
@keyframes cnp-shake { 25% { transform: rotate(-6deg) translateX(-8px); } 75% { transform: rotate(-2deg) translateX(8px); } }
.cnp-moment .big { font-family: var(--cn-font); font-size: 64px; font-weight: 900; font-style: italic; line-height: .95; color: #fff; text-align: center; letter-spacing: .01em; text-shadow: 4px 4px 0 var(--tc), 8px 8px 0 rgba(0,0,0,.3); transform: rotate(-3deg); }
.cnp-moment.assassin .big { color: #ff4a39; text-shadow: 4px 4px 0 #000, 8px 8px 0 rgba(0,0,0,.4); }
.cnp-moment .who { background: rgba(0,0,0,.7); color: #fff; font-size: 16px; font-weight: 700; padding: 10px 18px; border-radius: 18px; text-align: center; line-height: 1.4; max-width: 92vw; }
.cnp-moment .who b { color: var(--gold, #ffb800); }

/* ---- the light theme: daylight paper ---- */
[data-theme="light"] .cnp-team, [data-theme="light"] .cnp-lead { background: rgba(255,255,255,.82); box-shadow: 0 6px 18px rgba(60,40,10,.08); }
[data-theme="light"] .cnp-team.mine { box-shadow: 0 0 0 4px rgba(255,184,0,.35), 0 10px 26px rgba(60,40,10,.12); }
[data-theme="light"] .cnp-spybtn.on, [data-theme="light"] .cnp-spybtn.alt { background: #fff; box-shadow: 0 2px 8px rgba(60,40,10,.1); }
[data-theme="light"] .cnp-prob.no { color: #c0321f; }
[data-theme="light"] .cnp-bar.idle { background: rgba(255,255,255,.82); box-shadow: 0 4px 14px rgba(60,40,10,.08); }
[data-theme="light"] .cnp-log .l-assassin, [data-theme="light"] .cnp-log .l-oops { color: #c0321f !important; }
[data-theme="light"] .cnp-dock { background: linear-gradient(to top, rgba(246,241,229,.97) 75%, rgba(246,241,229,0)); }
[data-theme="light"] .cnp-n { background: #fff; box-shadow: 0 2px 6px rgba(60,40,10,.1); }
[data-theme="light"] .cnp-n.on { background: var(--gold); }
[data-theme="light"] .cnp-crow input[type=text] { box-shadow: inset 0 0 0 1.5px rgba(120,90,40,.25); }
[data-theme="light"] .cnp-end { background: #fff; box-shadow: 0 2px 8px rgba(60,40,10,.1); }
[data-theme="light"] .cnp-end:not(:disabled) { background: #1d1813; color: #fff; }
[data-theme="light"] .cnp-ov { background: rgba(40,30,10,.3); }
[data-theme="light"] .cnp-sheet { background: #fbf8f1; border-color: rgba(0,0,0,.06); box-shadow: 0 -10px 40px rgba(60,40,10,.2); }
