* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Arial Black', 'Impact', sans-serif;
            user-select: none;
            -webkit-user-drag: none;
            -webkit-tap-highlight-color: transparent;
        }
        img {
            pointer-events: none;
        }
        body {
            background: url('../img/fn/f6.jpg') no-repeat center center/cover;
            width: 100vw;
            height: 100vh;
            height: 100dvh;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            padding: env(safe-area-inset-top, 12px) env(safe-area-inset-right, 12px) env(safe-area-inset-bottom, 12px) env(safe-area-inset-left, 12px);
        }
        .header-nav {
            display: flex;
            justify-content: space-between;
            align-items: center;
            width: 100%;
            height: 7vh;
            min-height: 48px;
            animation: slideDown 0.6s cubic-bezier(0.25, 1, 0.5, 1) both;
            flex-shrink: 0;
        }
        @keyframes slideDown {
            from {
                opacity: 0;
                transform: translateY(-20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        .brand-title {
            font-family: 'Fredoka', sans-serif;
            font-weight: 700;
            color: #ffffff;
            font-size: 1.8rem;
            letter-spacing: 1.5px;
            text-shadow: 2px 2px 0px #000000;
            transform: skewX(-10deg);
        }
        .difficulty-menu {
            display: flex;
            background: rgba(0, 0, 0, 0.6);
            padding: 4px 12px;
            transform: skewX(-15deg);
            border: 2px solid #ffffff;
            opacity: 0;
            animation: slideDownVolver 0.6s cubic-bezier(0.25, 1, 0.5, 1) 0.1s both;
        }
        @keyframes slideDownVolver {
            from {
                opacity: 0;
                transform: translateY(-30px) skewX(-15deg);
            }
            to {
                opacity: 1;
                transform: translateY(0) skewX(-15deg);
            }
        }
        .diff-btn {
            font-family: 'Fredoka', sans-serif;
            font-weight: 700;
            color: #ffffff;
            text-decoration: none;
            padding: 4px 10px;
            font-size: 0.95rem;
            text-transform: uppercase;
            transform: skewX(15deg);
            transition: color 0.1s, background 0.1s;
            cursor: pointer;
        }
        .diff-btn-home {
            background: #ff3366;
        }
        .diff-btn-home:active {
            background: #ffffff;
            color: #ff3366;
        }
        .main-layout {
            display: flex;
            flex-direction: column;
            width: 100%;
            height: calc(93vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
            margin-top: 1vh;
            gap: 12px;
            overflow: hidden;
        }
        .settings-sidebar {
            width: 100%;
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 6px;
            flex-shrink: 0;
        }
        .menu-option {
            display: flex;
            align-items: center;
            cursor: pointer;
            transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1);
            position: relative;
            opacity: 0;
            animation: topBounceEntrance 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
        }
        .menu-option:nth-child(1) { animation-delay: 0.05s; }
        .menu-option:nth-child(2) { animation-delay: 0.1s; }
        .menu-option:nth-child(3) { animation-delay: 0.15s; }
        .menu-option:nth-child(4) { animation-delay: 0.2s; }

        @keyframes topBounceEntrance {
            0% {
                opacity: 0;
                transform: translateY(-20px) scale(0.9);
            }
            70% {
                transform: translateY(4px) scale(1.02);
            }
            100% {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        .menu-option.active {
            transform: scale(1.03);
        }

        .fused-button {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            background: rgba(20, 20, 20, 0.9);
            border: 2px solid #ffffff;
            padding: 6px 2px;
            color: #ffffff;
            transform: skewX(-8deg);
            width: 100%;
            box-shadow: -2px 3px 0px rgba(0,0,0,0.6);
            transition: background 0.2s, border-color 0.2s, color 0.2s;
            position: relative;
            height: 52px;
        }
        
        .fused-button::after {
            content: '';
            position: absolute;
            right: 0;
            bottom: 0;
            width: 16px;
            height: 16px;
            background: linear-gradient(135deg, 
                transparent 45%, 
                #ffffff 45%, #ffffff 55%, 
                transparent 55%, transparent 70%, 
                #ffffff 70%, #ffffff 80%, 
                transparent 80%
            );
            transform: skewX(8deg);
            opacity: 0.4;
            transition: opacity 0.2s;
            pointer-events: none;
        }

        .fused-diamond {
            width: 24px;
            height: 24px;
            background: #000000;
            transform: rotate(45deg);
            display: flex;
            align-items: center;
            justify-content: center;
            border: 2px solid #ffffff;
            box-shadow: 1px 1px 0px rgba(0,0,0,0.3);
            transition: background 0.2s, border-color 0.2s;
            z-index: 2;
            margin-bottom: 2px;
        }
        .fused-diamond svg {
            transform: rotate(-45deg);
            width: 14px;
            height: 14px;
            fill: #ffffff;
            transition: fill 0.2s;
        }
        .fused-text {
            font-size: 0.65rem;
            text-transform: uppercase;
            letter-spacing: 0px;
            transform: skewX(8deg);
            display: block;
            z-index: 1;
            white-space: nowrap;
            text-overflow: ellipsis;
            overflow: hidden;
            max-width: 100%;
            text-align: center;
        }
        
        .menu-option.active .fused-button {
            background: linear-gradient(135deg, #0080ff 0%, #ff3366 100%);
            border-color: #ffffff;
            color: #ffffff;
            box-shadow: -2px 4px 0px rgba(0, 128, 255, 0.4);
        }
        .menu-option.active .fused-button::after {
            opacity: 0.8;
        }
        .menu-option.active .fused-diamond {
            background: #ffffff;
            border-color: #000000;
        }
        .menu-option.active .fused-diamond svg {
            fill: #000000;
        }
        
        .settings-content {
            width: 100%;
            flex-grow: 1;
            display: flex;
            flex-direction: column;
            position: relative;
            overflow: hidden;
        }
        .panel-section {
            width: 100%;
            display: none;
            flex-direction: column;
            gap: 12px;
            height: 100%;
            overflow-y: auto;
            padding: 6px 4px 20px 4px;
            scrollbar-width: none;
            -ms-overflow-style: none;
            -webkit-overflow-scrolling: touch;
        }
        .panel-section::-webkit-scrollbar {
            display: none;
        }
        .panel-section.active {
            display: flex;
        }
        .p5-row {
            background: #ffffff;
            color: #000000;
            padding: 10px 14px;
            position: relative;
            transform: skewX(-8deg);
            border: 3px solid #000000;
            box-shadow: -4px 4px 0px rgba(0,0,0,0.7);
            display: flex;
            flex-direction: column;
            align-items: stretch;
            justify-content: center;
            min-height: 68px;
            width: 98%;
            margin: 0 auto;
            transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            opacity: 0;
            animation: p5Entrance 0.4s cubic-bezier(0.25, 1, 0.5, 1) forwards;
            flex-shrink: 0;
        }
        .p5-row:nth-child(1) { animation-delay: 0.03s; }
        .p5-row:nth-child(2) { animation-delay: 0.06s; }
        .p5-row:nth-child(3) { animation-delay: 0.09s; }
        .p5-row:nth-child(4) { animation-delay: 0.12s; }
        .p5-row:nth-child(5) { animation-delay: 0.15s; }
        .p5-row:nth-child(6) { animation-delay: 0.18s; }

        @keyframes p5Entrance {
            to {
                opacity: 1;
            }
        }
        .p5-row::after {
            content: '';
            position: absolute;
            right: -12px;
            top: 50%;
            margin-top: -8px;
            width: 0;
            height: 0;
            border-style: solid;
            border-width: 8px 0 8px 12px;
            border-color: transparent transparent transparent #ffffff;
            filter: drop-shadow(2px 2px 0px #000000);
            z-index: 3;
        }
        .p5-row-content {
            transform: skewX(8deg);
            display: flex;
            flex-direction: column;
            width: 100%;
            margin-bottom: 8px;
        }
        .p5-row-controls {
            transform: skewX(8deg);
            display: flex;
            align-items: center;
            justify-content: space-between;
            width: 100%;
            gap: 10px;
        }
        .p5-label {
            font-size: 1rem;
            text-transform: uppercase;
            font-weight: 900;
            color: #000000;
            letter-spacing: -0.3px;
            line-height: 1.1;
        }
        .p5-desc {
            font-family: 'Fredoka', sans-serif;
            font-size: 0.75rem;
            color: #333333;
            font-weight: 700;
            margin-top: 2px;
            line-height: 1.1;
        }
        .p5-val {
            font-family: 'Fredoka', sans-serif;
            font-weight: 700;
            font-size: 0.85rem;
            color: #ff3366;
            min-width: 42px;
            text-align: right;
        }
        .key-bind-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 6px;
            width: 100%;
        }
        .key-box {
            background: #000000;
            border: 2px solid #000000;
            padding: 6px 2px;
            text-align: center;
            cursor: pointer;
            color: #ffffff;
            transition: background 0.1s;
        }
        .key-box:active, .key-box.waiting {
            background: #ff3366;
            color: #ffffff;
        }
        .key-box.waiting .key-value {
            animation: pulse 0.8s infinite;
        }
        @keyframes pulse {
            0% { opacity: 0.3; }
            50% { opacity: 1; }
            100% { opacity: 0.3; }
        }
        .key-num {
            font-family: 'Fredoka', sans-serif;
            font-weight: 700;
            font-size: 0.65rem;
            color: #cccccc;
            text-transform: uppercase;
        }
        .key-value {
            font-size: 1rem;
            font-weight: 900;
        }
        .range-slider {
            -webkit-appearance: none;
            width: 100%;
            height: 14px;
            background: #000000;
            outline: none;
            border: 2px solid #000000;
            flex-grow: 1;
        }
        .range-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 20px;
            height: 24px;
            background: #ff3366;
            cursor: pointer;
            border: 2px solid #000000;
            transform: skewX(-10deg);
        }
        .range-slider:disabled {
            opacity: 0.3;
        }
        .toggle-btn {
            background: #000000;
            border: 2px solid #000000;
            color: #ffffff;
            padding: 6px 14px;
            font-size: 0.85rem;
            cursor: pointer;
            text-transform: uppercase;
            font-weight: 900;
            width: 100%;
            text-align: center;
        }
        .toggle-btn.on {
            background: #ff3366;
            color: #ffffff;
        }
        .btn-action {
            background: #000000;
            border: 2px solid #000000;
            color: #ffffff;
            padding: 6px 14px;
            font-size: 0.85rem;
            cursor: pointer;
            text-transform: uppercase;
            font-weight: 900;
            width: 100%;
            text-align: center;
        }
        .btn-action:active {
            background: #ff3366;
            color: #ffffff;
        }
        .disabled-row {
            opacity: 0.5;
            pointer-events: none;
        }
        body.horizontal-mode .main-layout {
            flex-direction: row;
        }
        body.horizontal-mode .settings-sidebar {
            grid-template-columns: 1fr;
            grid-template-rows: repeat(4, 1fr);
            width: 92px;
            height: 100%;
            flex-shrink: 0;
        }
        body.horizontal-mode .fused-button {
            height: 100%;
        }
        body.horizontal-mode .settings-content {
            flex-grow: 1;
            height: 100%;
        }
        body.horizontal-mode .panel-section {
            flex-direction: column;
            gap: 10px;
        }
        body.horizontal-mode .p5-row {
            width: 100%;
            margin: 0;
        }
        body.horizontal-mode .p5-row-controls {
            justify-content: center;
            gap: 16px;
        }
        body.horizontal-mode .p5-label {
            text-align: center;
        }
        body.horizontal-mode .p5-row-content {
            align-items: center;
            text-align: center;
        }
        body.horizontal-mode .key-bind-grid {
            grid-template-columns: repeat(4, 1fr);
        }
        @media (orientation: landscape) and (max-height: 500px) {
            .header-nav {
                height: 12vh;
                min-height: 44px;
            }
            .brand-title {
                font-size: 1.4rem;
            }
            body.horizontal-mode .settings-sidebar {
                width: 78px;
                gap: 10px;
            }
            .fused-button {
                height: 100%;
                padding: 8px 2px;
            }
            .fused-diamond {
                width: 30px;
                height: 30px;
            }
            .fused-diamond svg {
                width: 17px;
                height: 17px;
            }
            .fused-text {
                font-size: 0.72rem;
            }
            .p5-row {
                min-height: 84px;
                padding: 14px 20px;
            }
            .p5-label {
                font-size: 1.15rem;
            }
            .p5-desc {
                font-size: 0.85rem;
            }
            .p5-val {
                font-size: 1rem;
                min-width: 54px;
            }
            .range-slider {
                height: 20px;
            }
            .range-slider::-webkit-slider-thumb {
                width: 30px;
                height: 34px;
            }
            .toggle-btn, .btn-action {
                padding: 14px 20px;
                font-size: 1.05rem;
                max-width: 320px;
                margin: 0 auto;
            }
            .key-bind-grid {
                gap: 14px;
            }
            .key-box {
                padding: 14px 4px;
            }
            .key-num {
                font-size: 0.78rem;
            }
            .key-value {
                font-size: 1.3rem;
            }
        }
