/* Trappole Pazze */
.ct-wrap { max-width: 1200px; margin: 0 auto; padding: 1rem 1rem 3rem; }
.ct-wrap [hidden] { display: none !important; }
.ct-head { text-align: center; margin-bottom: .8rem; }
.ct-head h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.6rem); }
.ct-logo {
    font-weight: 900; letter-spacing: -.02em; color: #ffd21f;
    text-shadow: 0 2px 0 #b07b00, 0 4px 0 #6b4a00, 0 8px 18px rgba(0,0,0,.45);
    display: inline-block; transform: rotate(-2deg);
}
.ct-head p { margin: .4rem 0 0; color: var(--text-muted, #94a3b8); }

.ct-app {
    background: linear-gradient(180deg, #1b1e26, #0d0f14);
    border: 1px solid rgba(255, 210, 31, .25); border-radius: 22px;
    padding: .7rem; box-shadow: 0 20px 50px -15px rgba(0,0,0,.6);
    user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.ct-app:fullscreen { display: flex; flex-direction: column; border-radius: 0; }
.ct-app:fullscreen .ct-stage { flex: 1; height: auto; }

.ct-hud { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .6rem; }
.ct-hud-left, .ct-hud-right { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.ct-pill {
    display: flex; align-items: center; gap: .45rem; background: #0a0c10; border: 1px solid #2c313c;
    border-radius: 12px; padding: .35rem .7rem; min-height: 44px; color: #f1f5f9;
}
.ct-pill small { color: #94a3b8; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.ct-pill b { font-variant-numeric: tabular-nums; font-size: 1.1rem; }
.ct-starnow { color: #facc15; letter-spacing: 1px; }
.ct-balls { display: flex; gap: 4px; }
.ct-ball-dot { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #b9c2cc 45%, #3b4250); }
.ct-ball-dot.off { background: #262b35; box-shadow: inset 0 1px 3px #000; }
.ct-icon-btn {
    min-width: 44px; height: 44px; border-radius: 12px; border: 1px solid #2c313c; background: #161a22;
    color: #f1f5f9; font-size: 1.15rem; cursor: pointer;
}
.ct-icon-btn:hover { background: #222834; }

.ct-gauge {
    width: 44px; height: 44px; border-radius: 50%; position: relative;
    background: radial-gradient(circle, #fff 55%, #e5e7eb 56%, #9ca3af 100%);
    border: 3px solid #0a0c10; box-shadow: 0 0 0 2px #f6c20f;
}
.ct-gauge-needle {
    position: absolute; left: 50%; top: 50%; width: 3px; height: 17px; margin-left: -1.5px; margin-top: -16px;
    background: #e11d2a; border-radius: 2px; transform-origin: 50% 16px; transition: transform .1s linear;
}
.ct-gauge::after { content: ''; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; margin: -3.5px; border-radius: 50%; background: #e11d2a; }
.ct-gauge.ct-danger { animation: ctPulse .5s infinite alternate; }
@keyframes ctPulse { to { box-shadow: 0 0 0 2px #ef4444, 0 0 16px #ef4444; } }

.ct-stage { position: relative; height: min(68vh, 700px); min-height: 320px; border-radius: 16px; overflow: hidden; background: #07080b; touch-action: none; }
.ct-stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }

.ct-hint {
    position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); max-width: 92%;
    background: rgba(10,12,16,.9); color: #fde68a; border: 1px solid #f6c20f; border-radius: 12px;
    padding: .55rem .9rem; font-weight: 600; text-align: center; pointer-events: none;
}
.ct-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.55); color: #fde68a; font-weight: 700; }

.ct-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(4,6,10,.6); backdrop-filter: blur(3px); padding: 12px; }
#ctReady { background: rgba(4,6,10,.25); backdrop-filter: none; pointer-events: none; }
.ct-card {
    background: #12151c; border: 2px solid #f6c20f; border-radius: 20px; padding: 1.1rem; color: #f1f5f9;
    width: min(760px, 100%); max-height: 100%; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.ct-card-sm { width: min(420px, 100%); text-align: center; }
.ct-card h2 { margin: 0 0 .5rem; color: #ffd21f; }
.ct-card p { color: #cbd5e1; margin: .4rem 0; }
.ct-go { color: #22e36b !important; font-weight: 800; animation: ctBlink 1s infinite; }
@keyframes ctBlink { 50% { opacity: .35; } }
.ct-actions { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; margin-top: .8rem; }
.ct-btn {
    min-height: 48px; padding: 0 1.1rem; border-radius: 12px; border: 1px solid #2c313c; background: #1d222c;
    color: #f1f5f9; font-weight: 700; font-size: 1rem; cursor: pointer;
}
.ct-btn:hover { background: #262c38; }
.ct-btn-main { background: linear-gradient(180deg, #ffe066, #f6c20f); color: #1a1300; border-color: #a87a00; }
.ct-btn-main:hover { background: linear-gradient(180deg, #fff08a, #ffcf2a); }
.ct-btn-wide { width: 100%; margin-bottom: .8rem; }
.ct-end-stars { font-size: 2.6rem; letter-spacing: .3rem; min-height: 1em; }
.ct-end-stars span { color: #374151; display: inline-block; }
.ct-end-stars span.on { color: #facc15; animation: ctStar .45s both cubic-bezier(.34,1.56,.64,1); text-shadow: 0 0 14px rgba(250,204,21,.6); }
@keyframes ctStar { from { transform: scale(0) rotate(-90deg); } to { transform: scale(1); } }

.ct-menu-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.ct-totstars { color: #facc15; font-weight: 800; }
.ct-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.ct-lvl {
    min-height: 48px; border-radius: 10px; border: 1px solid #2c313c; background: #1a1e27; color: #f1f5f9;
    cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2px;
}
.ct-lvl b { font-size: .95rem; }
.ct-lvl i { font-style: normal; font-size: .62rem; color: #facc15; line-height: 1; }
.ct-lvl i em { font-style: normal; color: #374151; }
.ct-lvl.done { background: #1f2a1f; border-color: #3f6212; }
.ct-lvl.current { border-color: #f6c20f; box-shadow: 0 0 0 2px rgba(246,194,15,.35); }
.ct-lvl.locked { opacity: .45; cursor: default; }
.ct-lvl:not(.locked):hover { background: #262c38; }

.ct-controls { display: flex; flex-direction: column; align-items: center; gap: .4rem; margin-top: .7rem; }
.ct-press {
    width: min(420px, 100%); height: 84px; border-radius: 42px; border: 0; cursor: pointer; touch-action: none;
    background: radial-gradient(ellipse at 50% 30%, #ff6b6b, #e11d2a 55%, #8f0d16);
    box-shadow: 0 8px 0 #5c0810, 0 14px 24px rgba(0,0,0,.5), inset 0 2px 0 rgba(255,255,255,.35);
    color: #fff; font-weight: 900; font-size: 1.25rem; letter-spacing: .08em; text-shadow: 0 2px 0 rgba(0,0,0,.4);
    transition: transform .05s, box-shadow .05s;
}
.ct-press.is-down, .ct-press:active { transform: translateY(6px); box-shadow: 0 2px 0 #5c0810, 0 6px 12px rgba(0,0,0,.5), inset 0 2px 0 rgba(255,255,255,.25); }
.ct-keys { color: #64748b; font-size: .82rem; margin: 0; text-align: center; }

.ct-seo { margin-top: 2rem; max-width: 820px; }
.ct-seo h2 { font-size: 1.25rem; }
.ct-seo p { color: var(--text-muted, #94a3b8); line-height: 1.65; }

@media (max-width: 700px) {
    .ct-wrap { padding: .5rem .5rem 2rem; }
    .ct-stage { height: 62vh; }
    .ct-grid { grid-template-columns: repeat(5, 1fr); }
    .ct-pill small { display: none; }
    .ct-hud { justify-content: center; }
}
@media (pointer: coarse) { .ct-keys { display: none; } }
