/**
 * YouPac Stylesheet - 100% Brand Youfriend
 * Classic Maze Retro Layout con Misure Standardizzate YouSnake e Tasti Diagonali Game Boy
 */

.yf-game-youpac {
    background: #0f1422;
    border: 2px solid #232d42;
    border-radius: 16px;
    padding: 12px;
    max-width: 380px;
    margin: 10px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #f8fafc;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(250, 204, 21, 0.08);
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.yf-game-youpac .yf-game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #1e293b;
}

.yf-game-youpac .yf-player-info {
    font-size: 13px;
    font-weight: 700;
}

.yf-game-youpac .yf-player-badge {
    background: #1e293b;
    padding: 4px 10px;
    border-radius: 20px;
    color: #facc15;
    border: 1px solid #334155;
}

.yf-game-youpac .yf-guest-badge {
    font-size: 11px;
    color: #94a3b8;
}

.yf-game-youpac .yf-guest-badge a {
    color: #facc15;
    text-decoration: underline;
}

.yf-game-youpac .yf-header-controls {
    display: flex;
    gap: 8px;
}

.yf-game-youpac .yf-icon-btn {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.15s ease;
    touch-action: manipulation;
}

.yf-game-youpac .yf-icon-btn:hover {
    background: #334155;
    border-color: #facc15;
}

.yf-game-youpac .yf-game-layout {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.yf-game-youpac .yf-canvas-wrapper {
    position: relative;
    width: 280px;
    height: 360px;
    border-radius: 12px;
    overflow: hidden;
    background: #060810;
    border: 2px solid #1e293b;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.9);
}

#yf-youpac-canvas {
    display: block;
    width: 280px;
    height: 360px;
    background: #060810;
    image-rendering: pixelated;
}

.yf-game-youpac .yf-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 11, 20, 0.92);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
    backdrop-filter: blur(4px);
    z-index: 10;
}

.yf-game-youpac .yf-overlay.yf-show {
    display: flex;
}

.yf-game-youpac .yf-overlay h2 {
    font-size: 26px;
    font-weight: 900;
    letter-spacing: 2px;
    margin: 0 0 10px;
    color: #facc15;
    text-shadow: 0 0 12px rgba(250, 204, 21, 0.6);
}

.yf-game-youpac .yf-overlay p {
    font-size: 12px;
    color: #cbd5e1;
    margin: 0 0 16px;
    line-height: 1.4;
}

.yf-game-youpac .yf-arcade-btn {
    background: linear-gradient(135deg, #eab308, #ca8a04);
    color: #0f172a;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(234, 179, 8, 0.4);
    transition: all 0.15s ease;
    letter-spacing: 1px;
    touch-action: manipulation;
}

.yf-game-youpac .yf-arcade-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(234, 179, 8, 0.6);
}

.yf-game-youpac .yf-game-sidebar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
    flex: 1;
    min-width: 65px;
}

.yf-game-youpac .yf-stat-box {
    background: #141a29;
    border: 1px solid #232d42;
    border-radius: 8px;
    padding: 6px 3px;
    text-align: center;
}

.yf-game-youpac .yf-stat-label {
    display: block;
    font-size: 9px;
    color: #94a3b8;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.yf-game-youpac .yf-stat-value {
    display: block;
    font-size: 13px;
    font-weight: 800;
    color: #facc15;
    font-family: monospace, monospace;
}

/* ============================================================== */
/* CONTROLLER GAME BOY RETRÒ XL (MISURE YOUSNAKE + TASTI DIAGONALI) */
/* ============================================================== */
.yf-game-youpac .yf-gamepad-controls {
    margin-top: 12px;
    background: #090c14;
    border: 2px solid #222b40;
    border-radius: 18px;
    padding: 12px 10px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.7);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.yf-game-youpac .yf-gamepad-label {
    display: block;
    text-align: center;
    font-size: 9px;
    letter-spacing: 1.5px;
    color: #475569;
    font-weight: 800;
    margin-top: 6px;
}

.yf-game-youpac .yf-dpad-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.yf-game-youpac .yf-dpad {
    display: grid;
    grid-template-columns: 54px 54px 54px;
    grid-template-rows: 54px 54px 54px;
    gap: 0;
    background: #181e2e;
    padding: 3px;
    border-radius: 14px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5), inset 0 1px 2px rgba(255, 255, 255, 0.1);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.yf-game-youpac .yf-dpad-empty {
    width: 54px;
    height: 54px;
}

.yf-game-youpac .yf-dpad-center {
    width: 54px;
    height: 54px;
    background: #20273a;
    border: 1px solid #2d3752;
}

.yf-game-youpac .yf-dpad-btn {
    width: 54px;
    height: 54px;
    background: linear-gradient(145deg, #2b354d, #1e2537);
    border: 1px solid #3d4a6c;
    color: #e2e8f0;
    font-size: 20px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    transition: all 0.05s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.yf-game-youpac .yf-dpad-up { border-radius: 12px 12px 0 0; border-bottom: none; }
.yf-game-youpac .yf-dpad-left { border-radius: 12px 0 0 12px; border-right: none; }
.yf-game-youpac .yf-dpad-right { border-radius: 0 12px 12px 0; border-left: none; }
.yf-game-youpac .yf-dpad-down { border-radius: 0 0 12px 12px; border-top: none; }

.yf-game-youpac .yf-dpad-btn:active,
.yf-game-youpac .yf-dpad-btn.yf-btn-pressed {
    background: #facc15 !important;
    color: #0f172a !important;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6) !important;
    transform: scale(0.96);
    border-color: #facc15;
}

.yf-game-youpac .yf-action-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.yf-game-youpac .yf-action-buttons {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 4px;
    min-height: 100px;
}

.yf-game-youpac .yf-action-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Stagger Game Boy: B (sinistra) più in basso, A (destra) più in alto */
.yf-game-youpac .yf-action-slot:first-child,
.yf-game-youpac .yf-action-slot.yf-slot-b {
    transform: translateY(16px);
}

.yf-game-youpac .yf-action-slot:last-child,
.yf-game-youpac .yf-action-slot.yf-slot-a {
    transform: translateY(-16px);
}

.yf-game-youpac .yf-round-btn {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.25);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    transition: all 0.05s ease;
}

.yf-game-youpac .yf-btn-pac-pause {
    background: linear-gradient(145deg, #334155, #1e293b);
    color: #fff;
    box-shadow: 0 6px 0 #0f172a, 0 8px 16px rgba(0, 0, 0, 0.4);
}

.yf-game-youpac .yf-btn-pac-pause:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #0f172a;
}

.yf-game-youpac .yf-btn-pac-action {
    background: linear-gradient(145deg, #eab308, #ca8a04);
    color: #0f172a;
    box-shadow: 0 6px 0 #854d0e, 0 8px 16px rgba(234, 179, 8, 0.4);
}

.yf-game-youpac .yf-btn-pac-action:active,
.yf-game-youpac .yf-btn-pac-action.yf-btn-pressed {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #854d0e;
}

.yf-game-youpac .yf-btn-name {
    font-size: 20px;
    font-weight: 900;
    line-height: 1;
}

.yf-game-youpac .yf-btn-sub {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 1px;
    opacity: 0.95;
    margin-top: 2px;
}

@media (max-width: 370px) {
    .yf-game-youpac {
        padding: 8px 6px;
    }
    .yf-canvas-wrapper,
    #yf-youpac-canvas {
        width: 240px !important;
        height: 310px !important;
    }
    .yf-dpad {
        grid-template-columns: 48px 48px 48px;
        grid-template-rows: 48px 48px 48px;
    }
    .yf-dpad-empty,
    .yf-dpad-center,
    .yf-dpad-btn {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
    .yf-round-btn {
        width: 56px;
        height: 56px;
    }
    .yf-btn-name {
        font-size: 18px;
    }
    .yf-game-youpac .yf-action-slot:first-child,
    .yf-game-youpac .yf-action-slot.yf-slot-b {
        transform: translateY(12px);
    }
    .yf-game-youpac .yf-action-slot:last-child,
    .yf-game-youpac .yf-action-slot.yf-slot-a {
        transform: translateY(-12px);
    }
}
