/* Un Tratto (One Line) */
.ol-app { max-width: 980px; margin: 0 auto; padding: 18px 16px 40px; color: #1e1b4b; }
.ol-app [hidden] { display: none !important; }

.ol-hero { text-align: center; margin-bottom: 16px; }
.ol-hero h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); margin: 0 0 8px; font-weight: 800;
    background: linear-gradient(90deg, #06b6d4, #8b5cf6 55%, #ec4899); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ol-hero p { margin: 0 auto; max-width: 680px; color: #475569; line-height: 1.55; }

.ol-game {
    position: relative; border-radius: 26px; padding: 14px; overflow: hidden;
    background:
        radial-gradient(1200px 500px at 15% -10%, rgba(56, 189, 248, .22), transparent 60%),
        radial-gradient(900px 500px at 110% 110%, rgba(236, 72, 153, .22), transparent 60%),
        linear-gradient(160deg, #0f1235 0%, #1a1147 55%, #230d3d 100%);
    box-shadow: 0 30px 60px -25px rgba(30, 20, 90, .6), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.ol-game::before { /* puntinato di fondo */
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35;
    background-image: radial-gradient(rgba(255, 255, 255, .18) 1px, transparent 1.4px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(closest-side, #000 40%, transparent);
            mask-image: radial-gradient(closest-side, #000 40%, transparent);
}

.ol-top { position: relative; display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.ol-chip {
    display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 16px;
    border-radius: 16px; color: #e0e7ff; font: inherit;
    background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12);
    backdrop-filter: blur(6px);
}
.ol-chip b { font-size: 1.25rem; color: #fff; }
.ol-chip small { color: #a5b4fc; }
.ol-chip-lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: #a5b4fc; }
.ol-chip-btn { cursor: pointer; transition: background .15s, transform .15s; }
.ol-chip-btn:hover { background: rgba(255, 255, 255, .14); }
.ol-chip-btn::after { content: "▾"; color: #a5b4fc; margin-left: 2px; }
.ol-chip-stars { margin-left: auto; color: #fde68a; font-size: 1.1rem; }
.ol-chip-stars b { color: #fde68a; }

.ol-stage { position: relative; height: min(68vh, 620px); min-height: 340px; margin: 10px 0; touch-action: none; }
.ol-stage canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; cursor: pointer; touch-action: none; -webkit-user-select: none; user-select: none; }

.ol-tag {
    position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
    padding: 6px 14px; border-radius: 999px; font-size: .85rem; font-weight: 600; white-space: nowrap;
    color: #fde68a; background: rgba(250, 204, 21, .12); border: 1px solid rgba(250, 204, 21, .35);
    max-width: calc(100% - 20px); overflow: hidden; text-overflow: ellipsis;
}
.ol-msg {
    position: absolute; left: 50%; bottom: 8px; transform: translate(-50%, 8px);
    padding: 8px 16px; border-radius: 12px; font-weight: 600; font-size: .95rem; text-align: center;
    color: #e0e7ff; background: rgba(15, 18, 53, .75); border: 1px solid rgba(165, 180, 252, .25);
    opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; max-width: calc(100% - 24px);
}
.ol-msg.is-on { opacity: 1; transform: translate(-50%, 0); }
.ol-msg.is-bad { color: #fecdd3; border-color: rgba(244, 63, 94, .5); background: rgba(76, 5, 25, .75); }

.ol-bar { position: relative; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.ol-btn {
    min-height: 48px; min-width: 48px; padding: 0 18px; border-radius: 14px; cursor: pointer;
    font: inherit; font-weight: 700; color: #e0e7ff;
    background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16);
    transition: background .15s, transform .1s, opacity .15s;
}
.ol-btn:hover { background: rgba(255, 255, 255, .16); }
.ol-btn:active { transform: scale(.96); }
.ol-btn:disabled { opacity: .35; cursor: default; }
.ol-btn.is-icon { padding: 0; font-size: 1.15rem; }
.ol-btn.is-hint { color: #fde68a; border-color: rgba(250, 204, 21, .4); }
.ol-btn.is-primary { color: #fff; border: 0; background: linear-gradient(90deg, #06b6d4, #8b5cf6, #ec4899); box-shadow: 0 8px 22px -8px rgba(139, 92, 246, .8); }

.ol-win { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10, 8, 35, .45); backdrop-filter: blur(3px); animation: olFade .3s ease; }
.ol-win-card {
    text-align: center; padding: 26px 28px; border-radius: 24px; color: #e0e7ff; width: min(360px, calc(100% - 32px));
    background: linear-gradient(160deg, rgba(40, 30, 110, .95), rgba(60, 16, 80, .95));
    border: 1px solid rgba(255, 255, 255, .15); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6);
    animation: olPop .35s cubic-bezier(.2, 1.4, .4, 1);
}
.ol-win-card h2 { margin: 6px 0; color: #fff; font-size: 1.6rem; }
.ol-win-card p { margin: 0 0 18px; color: #c7d2fe; }
.ol-win-stars { font-size: 2.6rem; letter-spacing: 6px; }
.ol-win-stars i { font-style: normal; color: rgba(255, 255, 255, .15); display: inline-block; }
.ol-win-stars i.is-on { color: #fde047; text-shadow: 0 0 18px rgba(253, 224, 71, .7); animation: olStar .5s both; }
.ol-win-stars i.is-on:nth-child(2) { animation-delay: .12s; }
.ol-win-stars i.is-on:nth-child(3) { animation-delay: .24s; }
.ol-win-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.ol-picker { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: rgba(8, 6, 30, .6); backdrop-filter: blur(4px); }
.ol-picker-card {
    width: min(760px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 18px; border-radius: 24px; color: #e0e7ff;
    background: linear-gradient(160deg, #141541, #22103f); border: 1px solid rgba(255, 255, 255, .12);
}
.ol-picker-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ol-picker-head h2 { margin: 0; color: #fff; font-size: 1.3rem; }
.ol-worlds { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 10px; scrollbar-width: thin; }
.ol-world {
    flex: 0 0 auto; min-height: 48px; padding: 6px 14px; border-radius: 14px; cursor: pointer; font: inherit;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: #c7d2fe; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1);
}
.ol-world span { font-weight: 700; font-size: .9rem; }
.ol-world small { color: #fde68a; font-size: .72rem; }
.ol-world.is-active { color: #fff; background: linear-gradient(135deg, rgba(6, 182, 212, .35), rgba(139, 92, 246, .45)); border-color: rgba(165, 180, 252, .5); }
.ol-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.ol-cell {
    position: relative; aspect-ratio: 1; border-radius: 16px; cursor: pointer; padding: 0; font: inherit;
    background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); color: #fff;
    transition: transform .12s, background .15s;
}
.ol-cell:hover:not(:disabled) { transform: translateY(-2px); background: rgba(255, 255, 255, .1); }
.ol-cell canvas { position: absolute; inset: 10% 10% 22%; width: 80%; height: 68%; opacity: .9; }
.ol-cell-n { position: absolute; top: 6px; left: 9px; font-weight: 800; font-size: .85rem; color: #c7d2fe; }
.ol-cell-s { position: absolute; bottom: 5px; left: 0; right: 0; text-align: center; font-size: .8rem; letter-spacing: 2px; }
.ol-cell-s i { font-style: normal; color: rgba(255, 255, 255, .18); }
.ol-cell-s i.on { color: #fde047; }
.ol-cell.is-done { border-color: rgba(6, 182, 212, .45); }
.ol-cell.is-current { box-shadow: 0 0 0 2px #a78bfa; }
.ol-cell.is-locked { cursor: default; opacity: .45; }
.ol-cell.is-locked canvas { display: none; }
.ol-cell.is-locked .ol-cell-n { inset: 0; display: grid; place-items: center; font-size: 1.4rem; }

.ol-how, .ol-seo { margin-top: 28px; background: #fff; border-radius: 20px; padding: 22px; box-shadow: 0 10px 30px -18px rgba(30, 27, 75, .35); }
.ol-how h2, .ol-seo h2 { margin: 0 0 12px; font-size: 1.3rem; color: #312e81; }
.ol-seo h2 + p { margin-top: 0; }
.ol-seo p { color: #475569; line-height: 1.65; }
.ol-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.ol-steps li { display: flex; gap: 10px; align-items: flex-start; color: #475569; line-height: 1.5; }
.ol-steps b { flex: 0 0 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #06b6d4, #8b5cf6); }

@keyframes olFade { from { opacity: 0; } }
@keyframes olPop { from { transform: scale(.8); opacity: 0; } }
@keyframes olStar { from { transform: scale(0) rotate(-40deg); } 70% { transform: scale(1.3); } }

@media (max-width: 600px) {
    .ol-app { padding: 12px 10px 30px; }
    .ol-game { padding: 10px; border-radius: 20px; }
    .ol-stage { height: min(62vh, 520px); }
    .ol-btn { padding: 0 14px; }
    .ol-chip { padding: 6px 12px; }
}
