/* piramide.css */

/* ============================================================
   CONTAINER
   ============================================================ */
.container-pir {
    --card-h: clamp(75px, calc((100dvh - 265px) / 4 - 6px), 140px);
    max-width: 600px;
    margin: 0 auto;
    padding: 0 8px 24px;
    text-align: center;
}

.container-pir .game-container {
    background: url('../img/Fondo_Pergamino.webp') center center / cover no-repeat,
        linear-gradient(160deg, #e8d5b0, #d4b882);
    border: 2px solid #A07840;
    border-radius: 16px;
    padding: 16px 14px;
    min-height: calc(4 * var(--card-h) + 180px);
}

/* ============================================================
   TITLE AREA
   ============================================================ */
.subtitle-container {
    text-align: center;
    padding: 1rem 1rem 0.6rem;
}

.subtitle-wrapper {
    position: relative;
    display: inline-block;
}

.page-subtitle {
    font-family: 'Reggae One', cursive;
    font-size: 1.8rem;
    font-weight: 400;
    color: var(--wn-text, #e0e0e0);
    margin: 0;
    text-align: center;
    display: inline-block;
    vertical-align: middle;
}

.btn-help {
    background: rgba(255, 107, 0, 0.15);
    border: 1.5px solid rgba(255, 107, 0, 0.4);
    color: #FF6B00;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    position: absolute;
    right: -38px;
    top: 50%;
    transform: translateY(-50%);
    transition: background 0.2s;
    line-height: 1;
}

.btn-help:hover {
    background: rgba(255, 107, 0, 0.3);
}

/* ============================================================
   INSTRUCTION PHRASE
   ============================================================ */
.pir-instruction {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 6px 0 18px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #4e342e 0%, #3e2723 100%);
    border: 1px solid #6d4c41;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    color: #d4b896;
    font-size: 1rem;
    line-height: 1.4;
}

.pir-instruction-sub {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 6px;
    font-size: 0.82rem;
    color: rgba(212, 184, 150, 0.9);
    text-align: center;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px dashed rgba(212, 184, 150, 0.2);
    letter-spacing: 0.4px;
    font-style: italic;
}

.pir-sub-part {
    white-space: nowrap;
}

.pir-attr-name {
    font-family: 'Bangers', cursive;
    font-size: 1.3rem;
    letter-spacing: 1px;
    color: #ff6b00;
    text-shadow: 0 0 12px rgba(255, 107, 0, 0.55);
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 107, 0, 0.25);
    line-height: 1.5;
}

/* ============================================================
   PYRAMID LAYOUT
   ============================================================ */
.pir-pyramid-wrap {
    display: flex;
    align-items: stretch;
    gap: 6px;
    width: 100%;
    position: relative;
}

@media (min-width: 481px) {
    .pir-pyramid-wrap {
        padding: 0 34px;
    }
}

.pir-pyramid {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin: 0 0 16px;
    position: relative;
    z-index: 1;
    min-height: calc(4 * var(--card-h) + 18px);
}

.pir-row {
    display: flex;
    justify-content: center;
    gap: 6px;
    width: 100%;
}

.pir-loading {
    padding: 40px;
    color: #5A3200;
}

/* ============================================================
   CARD — base
   ============================================================ */
.pir-card {
    flex: 0 0 calc(25% - 4.5px);
    max-width: 148px;
    position: relative;
    background: linear-gradient(160deg, #2a1a12 0%, #1a0e08 100%);
    border: 2px solid #5d4037;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.18s, box-shadow 0.18s, transform 0.14s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.55);
}

.pir-card:hover:not(.correct):not(.wrong) {
    border-color: #9c7060;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.65);
    transform: translateY(-2px);
}

.pir-card-img {
    width: 100%;
    height: var(--card-h);
    object-fit: cover;
    object-position: top center;
    display: block;
    background: #1a0e08;
}

.pir-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top,
        rgba(0, 0, 0, 0.96) 0%,
        rgba(0, 0, 0, 0.72) 50%,
        rgba(0, 0, 0, 0.2) 80%,
        transparent 100%);
    padding: 20px 4px 5px;
    box-sizing: border-box;
    pointer-events: none;
}

.pir-card-name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    color: #f5e6c8;
    font-size: clamp(0.52rem, 2.2vw, 0.72rem);
    font-weight: 700;
    text-align: center;
    line-height: 1.25;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.pir-card-value {
    display: none;
    color: #ff8c00;
    font-size: clamp(0.5rem, 2vw, 0.68rem);
    font-weight: bold;
    text-align: center;
    margin-top: 3px;
    letter-spacing: 0.3px;
    text-shadow: 0 0 6px rgba(255, 140, 0, 0.5);
}

/* Position badge (top-left) */
.pir-card-pos {
    position: absolute;
    top: 4px;
    left: 5px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.88), rgba(20, 10, 0, 0.82));
    color: #ff6b00;
    font-family: 'Bangers', cursive;
    font-size: clamp(0.68rem, 2.4vw, 0.95rem);
    line-height: 1;
    padding: 2px 5px;
    border-radius: 5px;
    border: 1px solid rgba(255, 107, 0, 0.3);
    z-index: 2;
    text-shadow: 0 0 6px rgba(255, 107, 0, 0.4);
}

/* ============================================================
   CARD — FACE DOWN
   ============================================================ */
.pir-card.pir-face-down {
    background: linear-gradient(160deg, #1c1008 0%, #110a04 100%);
    border-color: #6d4c41;
}

.pir-card.pir-face-down:hover {
    border-color: #9c7060;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.65);
    transform: translateY(-2px);
}

.pir-card-back {
    width: 100%;
    height: var(--card-h);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.pir-card-back-icon {
    font-family: 'Bangers', cursive;
    font-size: clamp(1.6rem, 5vw, 2.4rem);
    color: #4a3728;
    text-shadow: 0 0 14px rgba(93, 64, 55, 0.8);
    line-height: 1;
    user-select: none;
}

.pir-card-back-hint {
    font-size: clamp(0.55rem, 1.4vw, 0.7rem);
    color: rgba(74, 55, 40, 1);
    font-family: 'Roboto', sans-serif;
    letter-spacing: 0.02em;
    user-select: none;
    text-align: center;
    line-height: 1;
}

@keyframes pirFlip {
    0% { transform: scale(0.72); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.pir-card.pir-revealing {
    animation: pirFlip 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes pirDemoA {
    0%   { transform: translate(0, 0) scale(1); opacity: 1; }
    15%  { transform: translate(0, -13px) scale(1.1); opacity: 1; }
    65%  { transform: translate(var(--pir-dx), calc(var(--pir-dy) - 13px)) scale(1.1); opacity: 1; }
    80%  { transform: translate(var(--pir-dx), var(--pir-dy)) scale(1); opacity: 1; }
    92%  { transform: translate(var(--pir-dx), var(--pir-dy)) scale(1); opacity: 1; }
    100% { transform: translate(var(--pir-dx), var(--pir-dy)) scale(1); opacity: 0; }
}

@keyframes pirDemoB {
    0%   { transform: translate(0, 0) scale(1); opacity: 1; }
    15%  { transform: translate(0, 6px) scale(0.93); opacity: 0.65; }
    65%  { transform: translate(var(--pir-dx), calc(var(--pir-dy) + 6px)) scale(0.93); opacity: 0.65; }
    80%  { transform: translate(var(--pir-dx), var(--pir-dy)) scale(1); opacity: 1; }
    92%  { transform: translate(var(--pir-dx), var(--pir-dy)) scale(1); opacity: 1; }
    100% { transform: translate(var(--pir-dx), var(--pir-dy)) scale(1); opacity: 0; }
}

@keyframes pirDemoBadge {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
    14%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    86%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
}

.pir-demo-badge {
    position: fixed;
    padding: 6px 16px;
    background: rgba(8, 4, 1, 0.93);
    color: #ff6b00;
    border: 1px solid rgba(255, 107, 0, 0.55);
    border-radius: 20px;
    font-size: 0.78rem;
    font-family: 'Roboto', sans-serif;
    font-weight: 600;
    letter-spacing: 0.04em;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1001;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.65);
    transform: translate(-50%, -50%);
    animation: pirDemoBadge 2.2s ease-in-out forwards;
}

@keyframes pirIdlePulse {
    0%, 100% {
        border-color: #6d4c41;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.55);
        transform: translateY(0);
    }
    50% {
        border-color: #ff6b00;
        box-shadow: 0 0 0 2px rgba(255, 107, 0, 0.2), 0 0 18px rgba(255, 107, 0, 0.5);
        transform: translateY(-3px);
    }
}

.pir-card.pir-idle-hint {
    animation: pirIdlePulse 1.1s ease-in-out 2;
}

/* ============================================================
   CARD — DRAG STATES
   ============================================================ */
.pir-card[draggable="true"] { cursor: grab; }

.pir-card.dragging {
    opacity: 0.38;
    transform: scale(0.95);
    border-style: dashed;
}

.pir-card.drag-over {
    border-color: #ff6b00;
    box-shadow: 0 0 0 2px rgba(255, 107, 0, 0.3), 0 0 20px rgba(255, 107, 0, 0.6);
    transform: scale(1.06) translateY(-2px);
}

/* ============================================================
   CARD — SELECTED STATE
   ============================================================ */
.pir-card.selected {
    border-color: #ff6b00;
    box-shadow: 0 0 0 2px rgba(255, 107, 0, 0.25), 0 0 22px rgba(255, 107, 0, 0.65);
    transform: scale(1.07) translateY(-2px);
    z-index: 5;
}

/* ============================================================
   CARD — CORRECT (green)
   ============================================================ */
@keyframes pirFill {
    0%   { transform: scale(0.82); opacity: 0.5; }
    60%  { transform: scale(1.07); }
    80%  { transform: scale(0.97); }
    100% { transform: scale(1); opacity: 1; }
}

.pir-card.correct {
    background: linear-gradient(160deg, #0a2410 0%, #071a0c 100%);
    border: 2px solid #4CAF50;
    cursor: default;
    box-shadow:
        0 0 0 1px rgba(76, 175, 80, 0.2),
        0 0 22px rgba(76, 175, 80, 0.4),
        0 4px 14px rgba(0, 0, 0, 0.55);
    animation: pirFill 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.pir-card.correct .pir-card-name { color: #e8ffe8; }

.pir-card.correct .pir-card-value {
    display: block;
    color: #a5d6a7;
    text-shadow: none;
}

/* ============================================================
   CARD — WRONG (red)
   ============================================================ */
@keyframes pirReveal {
    0%   { transform: scale(0.85); opacity: 0; }
    70%  { transform: scale(1.04); }
    100% { transform: scale(1); opacity: 1; }
}

.pir-card.wrong {
    background: linear-gradient(160deg, #2a0e0e 0%, #1c0808 100%);
    border: 2px solid #e57373;
    cursor: default;
    box-shadow:
        0 0 0 1px rgba(229, 115, 115, 0.2),
        0 0 18px rgba(229, 115, 115, 0.38),
        0 4px 14px rgba(0, 0, 0, 0.55);
    animation: pirReveal 0.4s ease-out forwards;
}

.pir-card.wrong .pir-card-img { opacity: 0.72; }

.pir-card.wrong .pir-card-overlay {
    background: linear-gradient(to top,
        rgba(100, 20, 20, 0.96) 0%,
        rgba(80, 20, 20, 0.55) 55%,
        transparent 100%);
}

.pir-card.wrong .pir-card-name { color: #ffcdd2; }

.pir-card.wrong .pir-card-value {
    display: block;
    color: #ef9a9a;
    text-shadow: none;
}

/* ============================================================
   FOOTER: SUBMIT
   ============================================================ */
.pir-footer { margin: 10px 0 6px; }

.pir-submit-btn {
    font-family: 'Bangers', cursive;
    font-size: 1.2rem;
    letter-spacing: 1.5px;
    padding: 10px 48px;
    background: linear-gradient(135deg, #4e342e 0%, #3e2723 100%);
    color: #ff6b00;
    border: 1px solid #6d4c41;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    display: inline-block;
}

.pir-submit-btn:hover {
    background: linear-gradient(135deg, #6d4c41 0%, #4e342e 100%);
    border-color: #8d6e63;
}

.pir-submit-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.pir-submit-btn:disabled {
    opacity: 0.45;
    cursor: default;
    transform: none;
}

/* ============================================================
   WIN / LOSE — mismo ancho que el game-container
   ============================================================ */
.container-pir .game-result-wrapper {
    max-width: 100%;
    width: 100%;
}

.container-pir .game-result-wrapper .game-result-modal {
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
}

/* ============================================================
   WIN / LOSE MODAL COLOURS
   ============================================================ */
#pirWinMsg .game-result-modal {
    background: url('../img/Fondo_Pergamino.webp') center center / cover no-repeat;
    background-color: #a0d4b0;
    background-blend-mode: multiply;
    border-color: #3c7355;
    box-shadow: 0 8px 32px rgba(34, 197, 94, 0.25), inset 0 0 20px rgba(85, 139, 110, 0.3);
}

#pirLoseMsg .game-result-modal {
    background: url('../img/Fondo_Pergamino.webp') center center / cover no-repeat;
    background-color: #eaa4a8;
    background-blend-mode: multiply;
    border-color: #a83f47;
    box-shadow: 0 8px 32px rgba(239, 68, 68, 0.25), inset 0 0 20px rgba(181, 79, 87, 0.3);
}

/* ============================================================
   RANKING DISTRIBUTION CHART
   ============================================================ */
.pir-ranking-container { width: 100%; }

.pir-ranking {
    width: 100%;
    padding: 14px 16px;
    box-sizing: border-box;
    background: url('../img/Fondo_Pergamino.webp') center center / cover no-repeat;
    background-color: #CE9D66;
    border: 2px solid #C19A6B;
    border-radius: 12px;
}

.pir-ranking-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

.pir-ranking-header::before,
.pir-ranking-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(139, 90, 43, 0.4);
}

.pir-ranking-title {
    font-family: 'Reggae One', cursive;
    font-size: 0.8rem;
    color: #4A2E15;
    letter-spacing: 1px;
    white-space: nowrap;
}

.pir-ranking-rows {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.pir-ranking-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pir-ranking-label {
    font-family: 'Reggae One', cursive;
    font-size: 0.9rem;
    font-weight: 700;
    color: rgba(92, 64, 51, 0.55);
    width: 40px;
    flex-shrink: 0;
    text-align: right;
    line-height: 1;
}

.pir-ranking-bar-wrap {
    flex: 1;
    height: 22px;
    background: rgba(139, 90, 43, 0.15);
    border-radius: 4px;
    overflow: hidden;
}

.pir-ranking-bar {
    height: 100%;
    width: 0;
    background: rgba(139, 90, 43, 0.3);
    border-radius: 4px;
    transition: width 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

.pir-ranking-pct {
    font-size: 0.78rem;
    font-weight: 700;
    color: rgba(92, 64, 51, 0.45);
    width: 36px;
    flex-shrink: 0;
    text-align: right;
}

.pir-ranking-pct.is-zero { color: rgba(92, 64, 51, 0.4); font-weight: normal; }

.pir-ranking-row.pir-ranking-user .pir-ranking-label { color: #ff6b00; }

.pir-ranking-row.pir-ranking-user .pir-ranking-bar {
    background: #ff6b00;
    box-shadow: 0 0 10px rgba(255, 107, 0, 0.4);
}

.pir-ranking-row.pir-ranking-user .pir-ranking-pct { color: #1a0f0a; }

/* ============================================================
   SCALE BAR (desktop sides)
   ============================================================ */
.pir-scale-bar { display: none; }

.pir-scale-label {
    writing-mode: vertical-rl;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    line-height: 1;
    white-space: nowrap;
}

.pir-scale-high {
    transform: rotate(180deg);
    color: #ff6b00;
    text-shadow: 0 0 8px rgba(255, 107, 0, 0.45);
    padding-bottom: 10px;
    margin-bottom: 5px;
}

.pir-scale-low {
    color: #4a3728;
    padding-top: 4px;
}

.pir-scale-gradient {
    flex: 1;
    width: 3px;
    border-radius: 2px;
    background: linear-gradient(to bottom, #ff6b00 0%, #8d6e63 55%, #3e2723 100%);
    box-shadow: 0 0 8px rgba(255, 107, 0, 0.25);
    min-height: 24px;
}

/* ============================================================
   BACKGROUND ARROW (mobile sides)
   ============================================================ */
.pir-mobile-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;
    top: 0;
    bottom: 0;
    width: 28px;
    z-index: 0;
    opacity: 0.5;
    pointer-events: none;
}

.pir-mobile-arrow--left  { left: 4px; }
.pir-mobile-arrow--right { right: 4px; }

.pir-mobile-arrow-label {
    font-size: 0.52rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #000;
    white-space: nowrap;
    writing-mode: vertical-rl;
    line-height: 1;
    flex-shrink: 0;
    margin: 7px 0;
}

.pir-mobile-arrow-high { transform: rotate(180deg); }

.pir-mobile-arrow-shaft {
    flex: 1;
    width: 8px;
    background: #000;
    border-radius: 2px;
    position: relative;
    margin: 7px 0;
}

.pir-mobile-arrow-shaft::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-bottom: 12px solid #000;
}

.pir-mobile-arrow-shaft::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-top: 12px solid #000;
}

/* ============================================================
   HOW TO PLAY
   ============================================================ */

.pir-howto-steps {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 4px;
}

.pir-howto-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(90, 50, 0, 0.2);
    border-radius: 10px;
    padding: 12px 10px;
    text-align: center;
}

.pir-howto-icon {
    font-size: 1.6rem;
    line-height: 1;
}

.pir-howto-card strong {
    color: #3E2000;
    font-size: 0.82rem;
    line-height: 1.3;
}

.pir-howto-card small {
    color: #6b4a20;
    font-size: 0.75rem;
    line-height: 1.4;
}

/* ============================================================
   TUTORIAL MODAL
   ============================================================ */
.pir-tutorial-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 13, 20, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.pir-tutorial-overlay.hidden {
    display: none;
}

.pir-tutorial-box {
    background: url('../img/Fondo_Pergamino.webp') center center / cover no-repeat;
    background-color: #CE9D66;
    border: 2px solid #C19A6B;
    border-radius: 20px;
    padding: 32px 28px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    text-align: center;
}

.pir-tutorial-title {
    font-family: 'Reggae One', system-ui, sans-serif;
    font-size: 1.5rem;
    color: #4A2E15;
    margin: 0 0 20px;
}

.pir-tutorial-steps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 24px;
    text-align: left;
}

.pir-tut-step {
    background: rgba(139, 90, 43, 0.12);
    border: 1px solid rgba(139, 90, 43, 0.3);
    border-radius: 12px;
    padding: 12px 10px;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 10px;
    text-align: left;
}

.pir-tut-step-emoji {
    font-size: 1.6rem;
    line-height: 1;
    grid-row: 1 / -1;
    grid-column: 1;
    align-self: center;
}

.pir-tut-step h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: #4A2E15;
    margin: 0 0 2px;
    grid-row: 1;
    grid-column: 2;
    align-self: end;
}

.pir-tut-step p {
    font-size: 0.78rem;
    color: #5c4033;
    margin: 0;
    line-height: 1.4;
    grid-row: 2;
    grid-column: 2;
    align-self: start;
}

.pir-tutorial-play-btn {
    display: inline-block;
    padding: 13px 40px;
    background: linear-gradient(135deg, var(--wn-orange) 0%, var(--wn-orange-dark) 100%);
    border: none;
    border-radius: 50px;
    color: #fff;
    font-family: 'Reggae One', system-ui, sans-serif;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(255, 107, 0, 0.4);
    transition: transform 0.15s, filter 0.15s;
}

.pir-tutorial-play-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

/* ============================================================
   MOBILE
   ============================================================ */
@media (max-width: 600px) {
    .pir-tutorial-steps {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .container-pir {
        --card-h: clamp(66px, calc((100dvh - 240px) / 4 - 5px), 120px);
    }

    .pir-pyramid { gap: 5px; min-height: calc(4 * var(--card-h) + 15px); }
    .pir-row     { gap: 5px; }

    .pir-card {
        flex: 0 0 calc(25% - 3.75px);
        border-radius: 8px;
    }

    .pir-card-overlay { padding: 18px 3px 4px; }

    .pir-card.correct,
    .pir-card.wrong { border-width: 2px; }

    .pir-submit-btn {
        padding: 10px 32px;
        font-size: 1rem;
    }

    .pir-mobile-arrow {
        bottom: auto;
        height: calc(4 * var(--card-h) + 15px);
    }

    .pir-scale-bar { display: none; }

    .pir-howto-steps {
        grid-template-columns: 1fr;
    }

    .pir-howto-card {
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        column-gap: 16px;
        align-items: center;
        text-align: left;
        padding: 14px 18px;
    }

    .pir-howto-card > :first-child {
        grid-row: 1 / -1;
        grid-column: 1;
        font-size: 2.2rem;
        margin-bottom: 0;
        align-self: center;
    }

    .pir-howto-card strong {
        grid-row: 1;
        grid-column: 2;
        align-self: end;
        margin-bottom: 2px;
        font-size: 0.9rem;
    }

    .pir-howto-card small {
        grid-row: 2;
        grid-column: 2;
        align-self: start;
    }

    .pir-tut-steps {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 360px) {
    .pir-pyramid { gap: 4px; min-height: calc(4 * var(--card-h) + 12px); }
    .pir-row     { gap: 4px; }

    .pir-card {
        flex: 0 0 calc(25% - 3px);
    }

    .pir-card-name {
        -webkit-line-clamp: 1;
        line-clamp: 1;
    }

    .pir-card-overlay { padding: 14px 3px 3px; }
}
