/* Not Connect 4 on the phone: the bar, the series, the grid you aim on, the Drop button.
   Dark rules first, then the light theme. */
.c4p { display: flex; flex-direction: column; gap: 10px; padding: 8px 12px 20px; min-height: 100%; }
.c4p-bar:empty, .c4p-acts:empty, .c4p-last:empty { display: none; }
.c4p-turn .tclock { flex: none; }
.c4p-turn.idle .avatar { flex: none; }

/* the series strip */
.c4p-score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 16px; background: rgba(0,0,0,.28); }
.c4p-side { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center; min-width: 0; --d: 30px; }
.c4p-side .c4d { position: relative; grid-row: 1 / 3; }
.c4p-side .nm { font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c4p-side b { grid-row: 1 / 3; grid-column: 3; font-size: 28px; font-weight: 900; font-variant-numeric: tabular-nums; }
.c4p-side small { font-size: 12px; color: var(--label-2); font-weight: 600; }
.c4p-side.on .c4d { box-shadow: 0 0 0 3px #ffb800, 0 0 14px rgba(255,184,0,.7), inset 0 0 0 calc(var(--d) * .06) var(--rim); }
.c4p-score .c4p-side:last-child { grid-template-columns: auto 1fr auto; direction: rtl; text-align: right; }
.c4p-score .c4p-side:last-child > * { direction: ltr; }
.c4p-mid { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.c4p-mid b { font-size: 15px; font-weight: 900; }
.c4p-mid small { font-size: 11px; color: var(--label-2); font-weight: 700; letter-spacing: .04em; white-space: nowrap; }

/* the grid you aim on */
.c4p-pad { position: relative; align-self: center; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; padding-top: 2px; }
.c4p-pad .c4-stage { margin: 0 auto; }
.c4p-pad .c4-discs { overflow: hidden; } /* discs let out by the slider vanish under the grid */
.c4p-slots { position: absolute; left: 0; right: 0; top: 2px; display: grid; grid-template-columns: repeat(7, var(--cell)); align-items: end; pointer-events: none; z-index: 1; }
.c4p-slots i { justify-self: center; width: 0; height: 0; margin-bottom: 4px; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 8px solid rgba(255,255,255,.14); }
.c4p-pad.live .c4p-slots i.ok { border-top-color: rgba(255,210,63,.75); animation: c4p-slot 1.4s ease-in-out infinite; }
.c4p-slots i.full { opacity: 0; }
@keyframes c4p-slot { 50% { transform: translateY(3px); } }
.c4p-pad.live .c4-board { filter: drop-shadow(0 0 0 transparent) drop-shadow(0 6px 14px rgba(0,0,0,.4)); }

/* under the grid */
.c4p-acts { display: flex; flex-direction: column; gap: 8px; }
.c4p-drop { min-height: 56px; font-size: 19px; font-weight: 900; letter-spacing: .01em; }
.c4p-drop.red:not([disabled]) { background: linear-gradient(180deg, #ff5148, #d11f28); color: #fff; box-shadow: 0 8px 22px rgba(209,31,40,.4); }
.c4p-drop.yellow:not([disabled]) { background: linear-gradient(180deg, #ffd84a, #f0b400); color: #2a1d00; box-shadow: 0 8px 22px rgba(240,180,0,.4); }
.c4p-drop[disabled] { opacity: .55; }
.c4p-hint { text-align: center; font-size: 14px; color: var(--label-2); }
.c4p-last { text-align: center; font-size: 13px; color: var(--label-2); min-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* between games and the end */
.c4p-between, .c4p-final { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 18px; background: rgba(0,0,0,.32); }
.c4p-between > b, .c4p-final > b { font-size: 26px; font-weight: 900; font-style: italic; line-height: 1.05; letter-spacing: -.01em; }
.c4p-between.won, .c4p-final.won { background: linear-gradient(120deg, #34d364, #1f9f48); color: #fff; box-shadow: 0 10px 30px rgba(40,180,90,.4); }
.c4p-final > span { font-size: 14px; font-weight: 600; opacity: .85; }
.c4p-cd { display: flex; flex-direction: column; gap: 3px; }
.c4p-cd > span:last-child { font-size: 12px; opacity: .8; }
.c4p-between.won .tclock.bar u { background: #fff; }
.c4p-between.won .tclock.bar i { background: rgba(255,255,255,.25); }
.c4p-between .tclock.bar u { background: #ffd23f; }

/* moments */
.c4p-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; --mc: #ffd23f; background: radial-gradient(circle, color-mix(in srgb, var(--mc) 55%, transparent), rgba(0,0,0,.55) 75%); animation: c4p-moment 2.6s ease both; }
.c4p-moment.red { --mc: #ff4b42; } .c4p-moment.draw { --mc: #8e9bb5; }
@keyframes c4p-moment { 0% { opacity: 0; } 8% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
.c4p-moment .big { font-size: 58px; font-weight: 900; font-style: italic; line-height: .92; text-align: center; color: #fff; letter-spacing: -.03em; text-shadow: 4px 4px 0 var(--mc), 8px 8px 0 rgba(0,0,0,.3); transform: rotate(-6deg); animation: c4p-slam .5s cubic-bezier(.2,1.5,.4,1) both; }
.c4p-moment.yellow .big { color: #1d4fb6; text-shadow: 4px 4px 0 #ffd23f, 8px 8px 0 rgba(0,0,0,.25); }
@keyframes c4p-slam { from { transform: rotate(-6deg) scale(3); opacity: 0; } }
.c4p-moment .who { display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,.72); color: #fff; font-size: 18px; font-weight: 800; padding: 8px 18px 8px 8px; border-radius: 999px; max-width: 90vw; --d: 36px; }
.c4p-moment.draw .who { padding-left: 18px; }
.c4p-moment .who .c4d { position: relative; flex: none; }
.c4p-moment.small { background: none; justify-content: flex-start; padding-top: 30vh; }
.c4p-moment .pill { display: flex; align-items: center; gap: 10px; background: #1c1c1e; color: #fff; font-size: 17px; font-weight: 800; padding: 12px 20px 12px 12px; border-radius: 999px; box-shadow: 0 16px 40px rgba(0,0,0,.4); animation: c4p-slam2 .45s cubic-bezier(.2,1.4,.4,1) both; }
.c4p-moment.k-timeup .pill { background: #ff453a; padding-left: 20px; }
@keyframes c4p-slam2 { from { transform: scale(.6); opacity: 0; } }
.c4p-coin { width: 30px; height: 30px; border-radius: 50%; flex: none; background: radial-gradient(circle at 35% 30%, #fff6c8, #e8b923 55%, #a7790a); box-shadow: inset 0 0 0 3px #c9971a; animation: c4p-flip .8s ease-in-out 2; }
@keyframes c4p-flip { 50% { transform: scaleX(.08); } }

/* light theme */
[data-theme="light"] .c4p-score { background: rgba(255,255,255,.82); box-shadow: 0 4px 14px rgba(80,50,20,.1); }
[data-theme="light"] .c4p-between:not(.won), [data-theme="light"] .c4p-final:not(.won) { background: rgba(255,255,255,.85); box-shadow: 0 4px 14px rgba(80,50,20,.1); }
[data-theme="light"] .c4p-slots i { border-top-color: rgba(120,80,30,.18); }
[data-theme="light"] .c4p-pad.live .c4p-slots i.ok { border-top-color: #e8a400; }
[data-theme="light"] .c4p-between:not(.won) .tclock.bar u { background: #e8a400; }
[data-theme="light"] .c4p-pad.live .c4-board { filter: drop-shadow(0 6px 14px rgba(80,50,20,.28)); }

/* the gold your-turn frame: kept to the very edge so it never washes over the grid */
body.g-notconnect4.nup-myturn::after { box-shadow: inset 0 0 0 5px #ffc400, inset 0 0 14px rgba(255,196,0,.5); animation: c4p-frame 1.6s ease-in-out infinite; }
@keyframes c4p-frame { 50% { box-shadow: inset 0 0 0 7px #ffc400, inset 0 0 22px rgba(255,196,0,.6); } }
