/* ===================================================
   Pi Monitor - Folyadékrendező (Water Sort) Stylesheet
   =================================================== */

.ws-container {
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

/* Header & Stats Bar */
.ws-stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(0, 255, 204, 0.25);
    border-radius: 12px;
    padding: 8px 14px;
    margin-bottom: 14px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
    gap: 8px;
}

.ws-stat-group {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    color: #aaa;
    white-space: nowrap;
}

.ws-stat-group i,
.ws-stat-group svg {
    width: 18px;
    height: 18px;
    color: #00ffcc;
    flex-shrink: 0;
}

.ws-stat-val {
    color: #00ffcc;
    font-weight: 700;
    font-size: 1.2rem;
    text-shadow: 0 0 10px rgba(0, 255, 204, 0.4);
    font-family: monospace;
}

.ws-level-select {
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(0, 255, 204, 0.45);
    color: #00ffcc;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    border-radius: 8px;
    padding: 3px 6px;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: 0 0 8px rgba(0, 255, 204, 0.15);
}

.ws-level-select:hover,
.ws-level-select:focus {
    border-color: #00ffcc;
    box-shadow: 0 0 12px rgba(0, 255, 204, 0.45);
    background: rgba(0, 20, 18, 0.85);
}

.ws-level-select option {
    background: #0d1a18;
    color: #00ffcc;
    font-weight: 600;
    padding: 4px;
}

.ws-stats-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.ws-stats-actions .ws-btn {
    padding: 6px 10px;
    min-height: 36px;
}

/* Action Controls (4 Buttons: Vissza, Újra, +1 Üveg, Szintek) */
.ws-controls {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    width: 100%;
    margin-bottom: 18px;
    box-sizing: border-box;
}

.ws-btn {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(0, 255, 204, 0.4);
    color: #00ffcc;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    touch-action: manipulation;
    min-height: 40px;
    box-sizing: border-box;
    min-width: 0;
    white-space: nowrap;
}

.ws-btn i,
.ws-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.ws-btn:hover:not(:disabled) {
    background: rgba(0, 255, 204, 0.15);
    border-color: #00ffcc;
    box-shadow: 0 0 12px rgba(0, 255, 204, 0.3);
    transform: translateY(-2px);
    color: #fff;
}

.ws-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.ws-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.1);
    color: #888;
}

.ws-btn.helper-btn {
    border-color: #ffcc00;
    color: #ffcc00;
}

.ws-btn.helper-btn:hover:not(:disabled) {
    background: rgba(255, 204, 0, 0.15);
    border-color: #ffe600;
    box-shadow: 0 0 12px rgba(255, 204, 0, 0.3);
    color: #fff;
}

/* Tube Rack / Playground */
.ws-rack {
    position: relative;
    width: 100%;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 28px;
    padding: 25px 5px 15px 5px;
    perspective: 800px;
}

.ws-row {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: clamp(8px, 2.5vw, 18px);
    width: 100%;
}

/* The Glass Tube */
.ws-tube-wrapper {
    position: relative;
    cursor: pointer;
    touch-action: manipulation;
    padding-top: 25px; /* room for lift up animation and cork */
    z-index: 1;
    transition: z-index 0.3s ease;
}

.ws-tube-wrapper.pouring {
    z-index: 150 !important;
}

.ws-tube-group {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
    transform-origin: center 20px;
    will-change: transform;
}

.ws-tube-group.pouring-active {
    transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.ws-tube {
    position: relative;
    width: clamp(44px, 11vw, 62px);
    height: clamp(155px, 34vw, 205px);
    background: rgba(15, 25, 35, 0.55);
    border: 2.5px solid rgba(0, 255, 204, 0.45);
    border-top: none;
    border-radius: 0 0 26px 26px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), inset 0 0 12px rgba(0, 255, 204, 0.15);
    backdrop-filter: blur(4px);
    overflow: hidden;
    display: flex;
    flex-direction: column-reverse;
    margin-top: 3px;
    transition: box-shadow 0.25s ease, 
                border-color 0.25s ease;
}

/* Glass Tube Top Rim */
.ws-tube-rim {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: calc(clamp(44px, 11vw, 62px) + 8px);
    height: 7px;
    background: rgba(0, 255, 204, 0.7);
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.5);
    z-index: 5;
    pointer-events: none;
    transition: background 0.25s, box-shadow 0.25s;
}

/* Cylindrical Glass Reflection Highlight */
.ws-tube::before {
    content: '';
    position: absolute;
    top: 0;
    left: 4px;
    width: 6px;
    height: 92%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.15) 80%, transparent 100%);
    border-radius: 3px;
    z-index: 4;
    pointer-events: none;
}

.ws-tube::after {
    content: '';
    position: absolute;
    top: 0;
    right: 3px;
    width: 3px;
    height: 90%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    border-radius: 2px;
    z-index: 4;
    pointer-events: none;
}

/* Selected Tube state: Lifted Up with Neon Glow */
.ws-tube-wrapper.selected .ws-tube-group {
    transform: translateY(-24px) scale(1.04);
}

.ws-tube-wrapper.selected .ws-tube {
    border-color: #00ffcc;
    box-shadow: 0 16px 35px rgba(0, 255, 204, 0.5), inset 0 0 18px rgba(0, 255, 204, 0.35);
}

.ws-tube-wrapper.selected .ws-tube-rim {
    background: #00ffcc;
    box-shadow: 0 0 14px #00ffcc;
}

/* Completed Tube state: Celebratory pulse & cork */
.ws-tube-wrapper.completed .ws-tube {
    border-color: #00ffcc;
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.4), inset 0 0 15px rgba(0, 255, 204, 0.2);
}

.ws-cork {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(clamp(44px, 11vw, 62px) - 10px);
    height: 15px;
    background: linear-gradient(180deg, #d4a373 0%, #a9714b 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px 4px 2px 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    z-index: 6;
}

.ws-cork.newly-completed {
    animation: corkPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes corkPop {
    from {
        opacity: 0;
        transform: translate(-50%, -20px) scale(0.6);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }
}

/* Shake Animation for Invalid Move */
.ws-tube-wrapper.shake .ws-tube-group {
    animation: tubeShake 0.4s ease;
}

@keyframes tubeShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px) rotate(-3deg); }
    40% { transform: translateX(7px) rotate(2.5deg); }
    60% { transform: translateX(-5px) rotate(-2deg); }
    80% { transform: translateX(4px) rotate(1deg); }
}

/* Liquid Layer */
.ws-liquid-layer {
    width: 100%;
    height: 25%;
    position: relative;
    box-sizing: border-box;
    transition: height 0.55s ease-in-out, opacity 0.55s ease-in-out;
    flex-shrink: 0;
    box-shadow: inset 0 -2px 6px rgba(0, 0, 0, 0.25), inset 0 2px 6px rgba(255, 255, 255, 0.2);
    overflow: visible;
}

/* Bottom liquid segment rounded to match tube bottom */
.ws-tube .ws-liquid-layer:first-child {
    border-radius: 0 0 22px 22px;
}

/* SVG Sinusoidal Wave Surface Container - ONLY rendered on top-most liquid surface layer */
.ws-liquid-layer .ws-wave-surface-container {
    display: none;
}

.ws-liquid-layer:last-child .ws-wave-surface-container {
    display: block;
    position: absolute;
    top: -6px;
    left: 0;
    width: 100%;
    height: 12px;
    pointer-events: none;
    z-index: 10;
    overflow: visible;
}

.ws-surface-wave-svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}

.ws-wave-path-primary {
    fill: rgba(255, 255, 255, 0.45);
    stroke: rgba(255, 255, 255, 0.65);
    stroke-width: 0.8px;
    filter: drop-shadow(0 1px 3px rgba(255, 255, 255, 0.4));
    will-change: d;
}

.ws-wave-path-secondary {
    fill: rgba(255, 255, 255, 0.22);
    will-change: d;
}

/* Impact wave ripple when target tube receives liquid stream */
.ws-liquid-layer.splash .ws-wave-surface-container {
    animation: waveImpactRipple 0.6s ease-out;
}

@keyframes waveImpactRipple {
    0% { transform: scaleY(1) scaleX(1); opacity: 0.9; }
    30% { transform: scaleY(2.2) scaleX(1.1) translateY(-2px); opacity: 1; }
    60% { transform: scaleY(1.5) scaleX(1.05) translateY(-1px); opacity: 0.95; }
    100% { transform: scaleY(1) scaleX(1) translateY(0); opacity: 0.85; }
}

/* Spout Lip Markers for Pixel-Perfect Stream Alignment */
.ws-spout-marker {
    position: absolute;
    top: 2px;
    width: 2px;
    height: 2px;
    pointer-events: none;
    opacity: 0;
    z-index: 10;
}
.ws-spout-left {
    left: 2px;
}
.ws-spout-right {
    right: 2px;
}

/* Internal Liquid Slanting & Sloshing when Tilted */
.ws-tube-group.pouring-right .ws-liquid-layer {
    transform-origin: right top;
    animation: liquidSloshRight 0.65s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite alternate;
}

.ws-tube-group.pouring-right .ws-liquid-layer::after {
    animation: meniscusSloshRight 0.65s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite alternate;
    background: rgba(255, 255, 255, 0.65);
}

.ws-tube-group.pouring-left .ws-liquid-layer {
    transform-origin: left top;
    animation: liquidSloshLeft 0.65s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite alternate;
}

.ws-tube-group.pouring-left .ws-liquid-layer::after {
    animation: meniscusSloshLeft 0.65s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite alternate;
    background: rgba(255, 255, 255, 0.65);
}

@keyframes liquidSloshRight {
    0% { transform: skewY(-12deg) scaleY(1.06) translateX(1px); }
    50% { transform: skewY(-16deg) scaleY(1.12) translateX(3px); }
    100% { transform: skewY(-10deg) scaleY(1.04) translateX(0px); }
}

@keyframes meniscusSloshRight {
    0% { transform: rotate(10deg) scaleX(1.1); }
    50% { transform: rotate(17deg) scaleX(1.22) translateY(-1px); }
    100% { transform: rotate(7deg) scaleX(1.05); }
}

@keyframes liquidSloshLeft {
    0% { transform: skewY(12deg) scaleY(1.06) translateX(-1px); }
    50% { transform: skewY(16deg) scaleY(1.12) translateX(-3px); }
    100% { transform: skewY(10deg) scaleY(1.04) translateX(0px); }
}

@keyframes meniscusSloshLeft {
    0% { transform: rotate(-10deg) scaleX(1.1); }
    50% { transform: rotate(-17deg) scaleX(1.22) translateY(-1px); }
    100% { transform: rotate(-7deg) scaleX(1.05); }
}

/* Surface splash animation when receiving liquid */
.ws-liquid-layer.splash::after {
    animation: liquidSplash 0.35s ease-out;
}

@keyframes liquidSplash {
    0% { transform: scaleY(1); background: rgba(255, 255, 255, 0.95); }
    50% { transform: scaleY(2.4); background: rgba(255, 255, 255, 0.7); }
    100% { transform: scaleY(1); background: rgba(255, 255, 255, 0.35); }
}

/* Subtle bubbling effect */
.ws-bubble {
    position: absolute;
    bottom: 2px;
    width: 3px;
    height: 3px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    pointer-events: none;
    animation: floatBubble 2.2s infinite linear;
}

@keyframes floatBubble {
    0% {
        transform: translateY(0) scale(0.8);
        opacity: 0.2;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-24px) scale(1.2);
        opacity: 0;
    }
}

/* SVG Liquid Pour Stream Overlay */
.ws-pour-svg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1200;
    overflow: visible;
}

.ws-stream-glow {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.45;
    filter: blur(3px);
    transition: opacity 0.15s ease-in-out;
}

.ws-stream-core {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 14 6;
    animation: streamFlow 0.25s linear infinite;
    transition: opacity 0.15s ease-in-out;
}

@keyframes streamFlow {
    from { stroke-dashoffset: 0; }
    to { stroke-dashoffset: -20; }
}

/* Droplet Particle in Stream */
.ws-stream-droplet {
    position: fixed;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1201;
    animation: dropletFall 0.3s ease-in forwards;
}

@keyframes dropletFall {
    0% { transform: translateY(0) scale(1); opacity: 0.9; }
    100% { transform: translateY(20px) scale(0.3); opacity: 0; }
}

/* Victory & Info Modals */
.ws-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ws-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.ws-modal-card {
    background: #111;
    border: 2px solid #00ffcc;
    border-radius: 20px;
    padding: 24px 18px;
    width: 90%;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 15px 50px rgba(0, 255, 204, 0.25);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-height: 88vh;
    overflow-y: auto;
    box-sizing: border-box;
}

.ws-modal-overlay.active .ws-modal-card {
    transform: scale(1);
}

.ws-modal-title {
    color: #00ffcc;
    font-size: 1.85rem;
    margin-top: 0;
    margin-bottom: 8px;
    text-shadow: 0 0 15px rgba(0, 255, 204, 0.5);
}

.ws-modal-subtitle {
    color: #bbb;
    font-size: 0.95rem;
    margin-bottom: 18px;
    line-height: 1.4;
}

.ws-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}

.ws-modal-actions .ws-btn {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    font-weight: 700;
    min-height: 46px;
    border-radius: 12px;
    justify-content: center;
    box-sizing: border-box;
    white-space: normal;
}

.ws-modal-actions .ws-btn-primary {
    background: rgba(0, 255, 204, 0.22);
    border-color: #00ffcc;
    color: #fff;
    box-shadow: 0 0 15px rgba(0, 255, 204, 0.3);
}

.ws-modal-actions .ws-btn-primary:hover {
    background: rgba(0, 255, 204, 0.38);
    box-shadow: 0 0 22px rgba(0, 255, 204, 0.5);
    transform: translateY(-2px);
}

.ws-modal-actions .ws-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(0, 255, 204, 0.3);
    color: #00ffcc;
}

.ws-modal-actions .ws-btn-secondary:hover {
    background: rgba(0, 255, 204, 0.12);
    color: #fff;
    border-color: #00ffcc;
    transform: translateY(-2px);
}

.ws-modal-footer-btns {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    width: 100%;
    box-sizing: border-box;
}

.ws-modal-footer-btns .ws-btn {
    width: 100%;
    padding: 10px 14px;
    min-height: 42px;
    box-sizing: border-box;
    justify-content: center;
    font-size: 0.95rem;
}

/* Level Grid in Level Selector Modal */
.ws-level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    gap: 10px;
    margin: 20px 0;
    max-height: 50vh;
    overflow-y: auto;
    padding: 5px;
}

.ws-level-btn {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 204, 0.3);
    color: #00ffcc;
    border-radius: 10px;
    height: 48px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ws-level-btn:hover {
    background: rgba(0, 255, 204, 0.2);
    border-color: #00ffcc;
    transform: scale(1.06);
}

.ws-level-btn.active {
    background: #00ffcc;
    color: #111;
    box-shadow: 0 0 15px rgba(0, 255, 204, 0.6);
}

.ws-level-btn.completed {
    border-color: #00ffcc;
    position: relative;
}

.ws-level-btn.completed::after {
    content: '★';
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 0.65rem;
    color: #ffcc00;
}

.ws-level-btn.locked {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.1);
    color: #777;
}

/* Variant Badge in Header */
.ws-variant-badge {
    background: rgba(0, 255, 204, 0.12);
    border: 1px solid rgba(0, 255, 204, 0.4);
    color: #00ffcc;
    border-radius: 20px;
    padding: 2px 7px;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: all 0.2s;
    user-select: none;
    touch-action: manipulation;
    white-space: nowrap;
    margin-left: 2px;
}

.ws-variant-badge:hover {
    background: rgba(0, 255, 204, 0.25);
    border-color: #00ffcc;
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.3);
    transform: scale(1.04);
}

.ws-variant-badge:active {
    transform: scale(0.96);
}

.ws-variant-badge i,
.ws-variant-badge svg {
    width: 12px;
    height: 12px;
    color: #00ffcc;
    flex-shrink: 0;
}

/* Variant Grid in Modal */
.ws-variant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
    gap: 6px;
    margin-top: 10px;
}

.ws-variant-btn {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 204, 0.3);
    color: #00ffcc;
    border-radius: 8px;
    height: 38px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    position: relative;
}

.ws-variant-btn:hover {
    background: rgba(0, 255, 204, 0.2);
    border-color: #00ffcc;
    transform: scale(1.05);
}

.ws-variant-btn.active {
    background: #00ffcc;
    color: #111;
    box-shadow: 0 0 12px rgba(0, 255, 204, 0.5);
}

.ws-variant-btn.completed::after {
    content: '★';
    position: absolute;
    top: 1px;
    right: 3px;
    font-size: 0.6rem;
    color: #ffcc00;
}

/* Confetti Canvas */
#ws-confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2100;
}

/* Mobile & Tablet Optimizations */
@media screen and (max-width: 580px) {
    .ws-stats-bar {
        padding: 6px 10px;
        gap: 6px;
    }

    .ws-stat-group {
        gap: 4px;
        font-size: 0.85rem;
    }

    .ws-stat-group i,
    .ws-stat-group svg {
        width: 15px;
        height: 15px;
    }

    .ws-stat-val {
        font-size: 1.05rem;
    }

    .ws-level-select {
        font-size: 0.84rem;
        padding: 2px 4px;
    }

    .ws-variant-badge {
        font-size: 0.72rem;
        padding: 2px 6px;
    }

    .ws-stats-actions .ws-btn {
        padding: 6px;
        min-height: 32px;
        min-width: 32px;
    }

    .ws-controls {
        gap: 6px;
    }

    .ws-controls .ws-btn {
        padding: 6px 3px;
        font-size: 0.78rem;
        gap: 4px;
        min-height: 36px;
    }

    .ws-controls .ws-btn i,
    .ws-controls .ws-btn svg {
        width: 14px;
        height: 14px;
    }

    .ws-rack {
        gap: 18px;
        padding-top: 15px;
    }

    .ws-row {
        gap: 6px;
    }
}

@media screen and (max-width: 460px) {
    .card {
        padding: 12px 6px 10px 6px !important;
        width: 98% !important;
    }

    .ws-stats-bar {
        padding: 6px 8px;
        gap: 4px;
    }

    .ws-tube {
        width: clamp(36px, 9.8vw, 44px);
        height: clamp(128px, 30vw, 150px);
    }
    .ws-tube-rim {
        width: calc(clamp(36px, 9.8vw, 44px) + 6px);
    }
    .ws-row {
        gap: clamp(4px, 1.6vw, 8px);
    }
}

@media screen and (max-width: 380px) {
    .card {
        padding: 10px 4px 8px 4px !important;
        width: 99% !important;
    }

    .ws-stats-bar {
        padding: 5px 4px;
        gap: 3px;
    }

    .ws-stat-group {
        font-size: 0.78rem;
    }

    .ws-stat-val {
        font-size: 0.95rem;
    }

    .ws-level-select {
        font-size: 0.76rem;
        padding: 1px 3px;
    }

    .ws-variant-badge {
        font-size: 0.68rem;
        padding: 1px 4px;
    }

    .ws-stat-label {
        display: none; /* Hide 'Lépés:' text on very small screens, show footprint + number */
    }

    .ws-controls .ws-btn {
        padding: 5px 2px;
        font-size: 0.72rem;
        gap: 2px;
    }

    .ws-controls .ws-btn i,
    .ws-controls .ws-btn svg {
        width: 12px;
        height: 12px;
    }

    .ws-tube {
        width: clamp(32px, 9.2vw, 40px);
        height: clamp(118px, 28vw, 138px);
    }
    .ws-tube-rim {
        width: calc(clamp(32px, 9.2vw, 40px) + 5px);
    }
    .ws-row {
        gap: clamp(3px, 1.2vw, 6px);
    }
}
