/* Platformer worlds on the Games page: canvas stage, HUD, touch controls and the question panel. */
.sg-tile-actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.sg-tile-actions .sg-btn { margin-top: 0; }
.sg-chip-world { background: #e3f4e8; color: #1b5e20; }

.wp-root { display: flex; flex-direction: column; gap: 8px; }
.wp-hud { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 14px; }
.wp-hud-item { font-weight: 600; }
.wp-assist-badge { background: #fff4d6; border: 1px solid #e0b84b; border-radius: 10px; padding: 1px 10px; font-weight: 500; }
.wp-hud .sg-btn:last-child { margin-left: auto; }
.wp-stage { position: relative; width: 100%; height: min(62vh, 448px); min-height: 260px; border-radius: 10px; overflow: hidden; background: #cfe8f3; }
.wp-canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.wp-canvas:focus-visible { outline: 3px solid var(--brand-primary, #667eea); outline-offset: -3px; }
.wp-help { font-size: 13px; color: #4a5160; margin: 0; }

.wp-panel {
    position: absolute;
    inset: 12px;
    overflow: auto;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}
.wp-panel[hidden] { display: none; }
.wp-panel .sg-card { box-shadow: none; border: none; padding: 0; }
.wp-panel-title { margin: 0 0 8px; font-size: 16px; }
.wp-pause { right: auto; bottom: auto; left: 50%; transform: translateX(-50%); width: min(520px, calc(100% - 24px)); }
.wp-pause h3 { margin: 0 0 12px; }
.wp-check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; margin-bottom: 12px; }
.wp-check input { width: 20px; height: 20px; margin-top: 1px; }

.wp-touch { display: none; justify-content: space-between; gap: 12px; }
.wp-touch-btn {
    min-width: 64px;
    min-height: 64px;
    font-size: 28px;
    border-radius: 14px;
    border: 2px solid #8a94a6;
    background: #fff;
    color: #1f2937;
    touch-action: none;
    user-select: none;
}
.wp-touch-jump { margin-left: auto; }
@media (pointer: coarse) {
    .wp-touch { display: flex; }
}

.wp-dot { position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px #263238; pointer-events: none; }
.wp-dot[hidden] { display: none; }
.wp-comfort { border: 1px solid #dfe3ea; border-radius: 8px; padding: 8px 12px; margin: 0 0 12px; }
.wp-comfort legend { font-size: 13px; font-weight: 600; padding: 0 4px; }
.wp-range { display: flex; flex-direction: column; gap: 4px; font-size: 14px; margin-bottom: 8px; }
.sg-world-story { background: #eef4ff; border-left: 4px solid var(--brand-primary, #667eea); border-radius: 6px; padding: 8px 12px; font-size: 14px; margin: 0 0 8px; }
.wp-gate-line { font-style: italic; margin: 0 0 6px; color: #37474f; }
.wp-banner { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); margin: 0; background: rgba(38, 50, 56, 0.88); color: #fff; padding: 8px 16px; border-radius: 8px; font-weight: 600; max-width: calc(100% - 24px); text-align: center; }
.wp-banner[hidden] { display: none; }
.wp-emotes { display: flex; flex-wrap: wrap; gap: 6px; }
.wp-roster { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; }
.wp-roster li { background: #f1f3f7; border-radius: 10px; padding: 2px 10px; }
.wp-roster .wp-roster-me { background: #e3f4e8; font-weight: 600; }
.sg-join { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.sg-join label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.sg-join input { font-size: 20px; letter-spacing: 0.15em; text-transform: uppercase; width: 9ch; padding: 6px 8px; border: 1px solid #cfd4dc; border-radius: 6px; }
.sg-match-ranking { margin: 8px 0; }
.sg-match-score { font-size: 1.5rem; font-weight: 700; margin: 6px 0; }
.sg-store-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.sg-store-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; border: 1px solid #e0e0e0; border-radius: 10px; background: #fff; }
.sg-store-worn { border-color: #43a047; box-shadow: 0 0 0 2px rgba(67, 160, 71, 0.25); }
.sg-store-preview { width: 64px; height: 64px; background: #eef4fb; border-radius: 8px; }
.sg-store-name { font-weight: 600; }
.sg-store-balance { font-size: 1.2rem; font-weight: 700; }
.sg-comp-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.sg-comp-yours { font-weight: 700; }
.wp-controls { border: 1px solid #cfd8dc; border-radius: 8px; padding: 8px 12px; margin: 8px 0; }
.wp-controls-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.wp-control-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
/* Door mode keeps the middle of the view clear: a side column, or a short strip on narrow screens. */
.wp-panel-doors { inset: 8px 8px 8px auto; width: min(320px, 40%); opacity: 0.96; }
@media (max-width: 640px) { .wp-panel-doors { inset: 8px 8px auto; width: auto; max-height: 36%; } }
.wp-door-letter { display: inline-block; min-width: 1.4em; padding: 0 4px; border-radius: 4px; background: #263238; color: #ffffff; text-align: center; }
/* "+10" rising from the player after an answer. */
.wp-score-pop { position: absolute; z-index: 3; transform: translate(-50%, -100%); font: 800 28px/1 system-ui, sans-serif; color: #2e7d32; text-shadow: 0 2px 0 #ffffff, 0 0 8px #ffffff; pointer-events: none; animation: wp-score-rise 1.5s ease-out forwards; }
.wp-score-partial { color: #e65100; }
.wp-score-incorrect { color: #c62828; }
.wp-score-still { animation-name: wp-score-fade; }
@keyframes wp-score-rise {
    0% { opacity: 0; transform: translate(-50%, -80%) scale(0.8); }
    15% { opacity: 1; transform: translate(-50%, -100%) scale(1.15); }
    100% { opacity: 0; transform: translate(-50%, -280%) scale(1); }
}
@keyframes wp-score-fade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .wp-score-pop { animation-name: wp-score-fade; } }
.wp-toast { position: absolute; z-index: 3; left: 50%; bottom: 12px; transform: translateX(-50%); max-width: calc(100% - 24px); margin: 0; padding: 6px 14px; border-radius: 8px; background: rgba(255, 255, 255, 0.95); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2); font-size: 15px; pointer-events: none; }
.wp-toast[hidden] { display: none; }
