        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        html, body {
            overflow: hidden;
            overscroll-behavior: none;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: url('/table-1.jpg') repeat fixed;
            background-size: 256px 256px;
            color: white;
            min-height: 100vh;
        }

        .container {
            max-width: 1400px;
            margin: 0 auto;
            padding: 20px;
        }

        .header {
            text-align: center;
            margin-bottom: 20px;
            padding: 30px;
        }

        .logo {
            font-size: clamp(1.3rem, 5vw, 3rem);
            font-weight: bold;
            margin-bottom: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: clamp(8px, 2.4vw, 15px);
        }

        .logo-text {
            color: #ffe7b8;
            background: linear-gradient(120deg, #fff4d0 0%, #f2c97d 42%, #cb9238 64%, #ffe7b8 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            text-shadow: 0 8px 22px rgba(0, 0, 0, 0.65);
            display: inline-block;
            white-space: nowrap;
        }

        .sconce {
            position: relative;
            width: clamp(30px, 7vw, 40px);
            height: clamp(72px, 18vw, 90px);
            transform: translateY(-20px);
            filter: drop-shadow(0 4px 6px rgba(0,0,0,0.8));
        }

        .sconce::before {
            content: "";
            position: absolute;
            top: 10px;
            left: 50%;
            transform: translateX(-50%);
            width: clamp(68px, 17vw, 90px);
            height: clamp(68px, 17vw, 90px);
            background: radial-gradient(circle, rgba(255,180,0,0.5), rgba(255,150,0,0) 70%);
            z-index: 0;
            filter: blur(15px);
        }

        .sconce .holder {
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: clamp(24px, 5.6vw, 30px);
            height: clamp(18px, 6vw, 25px);
            background: linear-gradient(#8d6e63, #5d4037);
            border-radius: 0 0 15px 15px;
            box-shadow: inset 0 2px 4px rgba(255,255,255,0.2), inset 0 -4px 6px rgba(0,0,0,0.7), 0 3px 6px rgba(0,0,0,0.6);
            z-index: 2;
        }

        .sconce .flame {
            position: absolute;
            bottom: clamp(14px, 4vw, 20px);
            left: 50%;
            transform: translateX(-50%);
            width: clamp(16px, 4.8vw, 20px);
            height: clamp(24px, 7vw, 30px);
            background: radial-gradient(circle at 50% 80%, #fffadd 0%, #ff9800 60%, rgba(255,152,0,0) 70%);
            border-radius: 50%;
            animation: flicker 0.6s infinite alternate;
            filter: blur(1px);
            box-shadow: 0 0 10px 3px rgba(255,150,0,0.8), 0 0 25px 10px rgba(255,120,0,0.6);
            z-index: 1;
        }

        .sconce span {
            position: absolute;
            bottom: clamp(22px, 6vw, 30px);
            left: 50%;
            width: clamp(6px, 2vw, 8px);
            height: clamp(6px, 2vw, 8px);
            background: rgba(255, 235, 59, 0.9);
            border-radius: 50%;
            animation: rise 1s infinite ease-out;
        }

        .sconce span:nth-of-type(2) { animation-delay: 0.3s; }
        .sconce span:nth-of-type(3) { animation-delay: 0.6s; }

        @keyframes flicker {
            0% { transform: translateX(-50%) scale(1); }
            50% { transform: translateX(-50%) scale(1.2); }
            100% { transform: translateX(-50%) scale(1); }
        }

        @keyframes rise {
            0% { transform: translate(-50%, 0) scale(1); opacity: 1; }
            100% { transform: translate(-50%, -40px) scale(0); opacity: 0; }
        }

        .setup-section {
            background: rgba(255,255,255,0.05);
            padding: 30px;
            border-radius: 15px;
            margin-bottom: 30px;
            border: 1px solid rgba(255,255,255,0.1);
        }

        .input-group {
            margin-bottom: 20px;
        }

        .input-group label {
            display: block;
            margin-bottom: 8px;
            font-weight: 600;
            color: #4ecdc4;
        }

        .input-group input {
            width: 100%;
            padding: 12px;
            border: 2px solid rgba(255,255,255,0.2);
            border-radius: 8px;
            background: rgba(255,255,255,0.1);
            color: white;
            font-size: 16px;
            transition: all 0.3s ease;
        }

        .input-group input:focus {
            outline: none;
            border-color: #4ecdc4;
            box-shadow: 0 0 20px rgba(78, 205, 196, 0.3);
        }

        .btn {
            background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
            border: none;
            color: white;
            padding: 12px 24px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 16px;
            font-weight: 600;
            transition: all 0.3s ease;
            text-transform: uppercase;
            letter-spacing: 1px;
            margin: 5px;
        }

        .btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 25px rgba(0,0,0,0.3);
        }

        .btn:disabled {
            background: #666;
            cursor: not-allowed;
            transform: none;
        }

        .tab-bar {
            display: flex;
            border-bottom: 1px solid rgba(255,255,255,0.1);
            margin-bottom: 10px;
        }

        .tab-btn {
            background: #1a1a1a;
            border: 1px solid rgba(255,255,255,0.1);
            border-bottom: none;
            color: #ccc;
            padding: 8px 16px;
            cursor: pointer;
            margin-right: 4px;
            border-top-left-radius: 6px;
            border-top-right-radius: 6px;
            transition: background 0.3s, color 0.3s;
        }

        .tab-btn:hover {
            background: #333;
            color: #fff;
        }

        .tab-btn.active {
            background: #000;
            color: #4ecdc4;
            border-color: #4ecdc4;
        }

        .status-box {
            position: fixed;
            top: 20px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0,0,0,0.8);
            padding: 10px 20px;
            border-radius: 8px;
            color: #fff;
            z-index: 2000;
            display: none;
            max-width: 90%;
            text-align: center;
        }

        .status-box.success { border: 2px solid #4ecdc4; }
        .status-box.error { border: 2px solid #ff6b6b; }
        .status-box.loading { border: 2px solid #aaa; }

        /* Allow End Turn button to sit with Ready in battle controls */
        #endTurnBtn {
            position: static;
            bottom: auto;
            left: auto;
            transform: none;
            z-index: auto;
        }


        .connect-section {
            margin-top: 5px;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .user-row {
            display: flex;
            align-items: center;
            margin-top: 0;
        }

        .quest-overlay {
            position: fixed;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: clamp(40px, 10vh, 80px) clamp(18px, 6vw, 48px);
            background-color: rgba(10, 6, 2, 0);
            backdrop-filter: blur(2px);
            -webkit-backdrop-filter: blur(2px);
            z-index: 1500;
            pointer-events: none;
            visibility: hidden;
            transition: background-color 0.35s ease, visibility 0s linear 0.35s;
        }

        .quest-overlay.visible {
            background-color: rgba(10, 6, 2, 0.78);
            pointer-events: auto;
            visibility: visible;
            transition: background-color 0.35s ease, visibility 0s;
        }

        .quest-overlay.no-transition {
            transition: none !important;
        }

        .quest-menu {
            position: relative;
            width: min(460px, 92vw);
            transform-origin: top center;
            transform: translateY(-120vh) rotate(-4deg);
            opacity: 0;
            pointer-events: none;
            --rope-overhang: clamp(160px, 23vh, 240px);
            --rope-anchor-length: clamp(54px, 7vw, 80px);
            --rope-angle: 34deg;
            --rope-width: clamp(20px, 3vw, 28px);
            filter: none;
            will-change: transform;
        }

        .quest-menu.open {
            pointer-events: auto;
            transform: translateY(0);
            opacity: 1;
            animation: quest-drop 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
        }

        .quest-menu.closing {
            pointer-events: none;
            animation: quest-close 0.55s ease-in forwards;
        }

        .quest-hanger {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 0;
            pointer-events: none;
            z-index: 0;
            transform-origin: top center;
        }

        .quest-peg {
            position: absolute;
            top: calc(-1 * var(--rope-overhang) - clamp(26px, 5vw, 42px));
            left: 50%;
            width: clamp(24px, 3.2vw, 34px);
            height: clamp(24px, 3.2vw, 34px);
            transform: translateX(-50%);
            border-radius: 50%;
            background: radial-gradient(circle at 32% 28%, rgba(255, 230, 178, 0.95), rgba(161, 102, 40, 0.85));
            box-shadow: 0 10px 22px rgba(0, 0, 0, 0.55), inset 0 3px 6px rgba(0, 0, 0, 0.4);
            border: 1px solid rgba(255, 243, 218, 0.55);
            z-index: 3;
        }

        .quest-peg::after {
            content: '';
            position: absolute;
            inset: 20%;
            border-radius: 50%;
            background: radial-gradient(circle, rgba(255, 255, 255, 0.65), rgba(255, 214, 141, 0));
            filter: blur(1px);
            opacity: 0.75;
        }

        .quest-rope {
            position: absolute;
            top: calc(-1 * var(--rope-overhang));
            left: calc(50% - var(--rope-width) / 2);
            width: var(--rope-width);
            height: calc(var(--rope-overhang) + var(--rope-anchor-length));
            background-image: url('/rope.png');
            background-repeat: repeat-y;
            background-size: 100% auto;
            background-position: top center;
            opacity: 0;
            transform-origin: top center;
            transition: opacity 0.45s ease;
            filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.3));
            box-shadow: none;
            mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 78%, rgba(0, 0, 0, 0) 100%);
            -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 78%, rgba(0, 0, 0, 0) 100%);
            pointer-events: none;
            z-index: 2;
        }

        .quest-rope.rope-left {
            transform: rotate(calc(-1 * var(--rope-angle)));
        }

        .quest-rope.rope-right {
            transform: rotate(var(--rope-angle));
        }

        .quest-menu.open .quest-rope {
            opacity: 1;
        }

        .quest-menu.closing .quest-rope {
            animation: quest-rope-close 0.55s ease-in forwards;
        }

        @keyframes quest-drop {
            0% { transform: translateY(-120vh) rotate(-8deg); opacity: 0; }
            50% { transform: translateY(22px) rotate(4deg); opacity: 1; }
            70% { transform: translateY(-14px) rotate(-2.6deg); }
            85% { transform: translateY(7px) rotate(1.4deg); }
            100% { transform: translateY(0) rotate(0deg); opacity: 1; }
        }

        @keyframes quest-sway {
            0% { transform: rotate(-1.8deg); }
            50% { transform: rotate(1.8deg); }
            100% { transform: rotate(-1.4deg); }
        }

        @keyframes quest-close {
            0% { transform: translateY(0) rotate(0deg); opacity: 1; }
            35% { transform: translateY(16px) rotate(2deg); }
            100% { transform: translateY(-120vh) rotate(-8deg); opacity: 0; }
        }

        @keyframes quest-rope-close {
            0% { opacity: 1; }
            70% { opacity: 1; }
            100% { opacity: 0; }
        }

        .quest-board {
            position: relative;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: clamp(16px, 2.6vw, 26px);
            padding: clamp(92px, 19vw, 124px) clamp(42px, 9vw, 60px) clamp(112px, 22vw, 142px);
            width: min(420px, 90vw);
            color: #f9edd0;
            text-align: center;
            background: url('/menu1.png') no-repeat center;
            background-size: 100% 100%;
            border: none;
            transform-origin: top center;
            margin: 0 auto;
            z-index: 1;
            box-shadow: none;
            filter: drop-shadow(0 22px 40px rgba(0, 0, 0, 0.48));
            will-change: transform;
        }

        .quest-menu.open .quest-board,
        .quest-menu.open .quest-hanger {
            animation: quest-sway 5s ease-in-out 0.9s infinite alternate;
        }

        .quest-menu.closing .quest-board,
        .quest-menu.closing .quest-hanger {
            animation: none;
        }

        .quest-board > * {
            position: relative;
            z-index: 1;
        }

        .quest-options {
            position: relative;
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: clamp(14px, 2.4vw, 22px);
            width: 100%;
            margin-top: clamp(6px, 1.6vw, 12px);
        }

        .quest-option {
            width: 100%;
            margin: 0;
            letter-spacing: 0.14em;
            text-transform: uppercase;
            font-size: clamp(12px, 1.5vw, 15px);
        }

        @media (max-width: 640px) {
            .quest-options {
                grid-template-columns: 1fr;
            }
        }

        .quest-option.button-empty2 {
            --button-empty2-scale: 0.16;
            --button-empty2-inline: 1.26;
            --button-empty2-block: 0.9;
            margin: 0;
            box-shadow: 0 16px 28px rgba(0, 0, 0, 0.5);
            filter: none;
            transition: transform 0.25s ease, box-shadow 0.25s ease;
        }

        .quest-option.button-empty2:hover {
            transform: translateY(-2px);
            box-shadow: 0 22px 36px rgba(0, 0, 0, 0.58);
        }

        .quest-option.button-empty2:focus-visible {
            outline: none;
            transform: translateY(-2px);
            box-shadow: 0 22px 36px rgba(0, 0, 0, 0.6), 0 0 14px rgba(255, 222, 170, 0.45);
        }

        .quest-option.button-empty2:active {
            transform: translateY(0);
            box-shadow: 0 14px 22px rgba(0, 0, 0, 0.5);
        }

        .quest-title {
            font-family: 'Cinzel', 'Trajan Pro', 'Times New Roman', serif;
            font-size: clamp(22px, 3vw, 30px);
            letter-spacing: 0.16em;
            text-transform: uppercase;
            color: #f6e8c4;
            text-shadow: -1px -1px 0 rgba(60, 33, 12, 0.7), 0 3px 8px rgba(0, 0, 0, 0.55);
            padding-bottom: clamp(8px, 1.4vw, 12px);
            margin-top: clamp(-14px, -2.4vw, -6px);
        }

        .quest-title::after {
            content: '';
            position: absolute;
            left: 50%;
            bottom: clamp(-10px, -1.4vw, -6px);
            width: clamp(90px, 42%, 160px);
            height: 2px;
            background: linear-gradient(90deg, rgba(255, 222, 164, 0) 0%, rgba(255, 222, 164, 0.8) 50%, rgba(255, 222, 164, 0) 100%);
            transform: translateX(-50%);
            box-shadow: 0 0 12px rgba(255, 229, 170, 0.55);
        }

        .button-empty2 {
            --button-empty2-scale: 0.2;
            --button-empty2-inline: 1.1;
            --button-empty2-block: 0.85;
            --button-empty2-border-top: calc(37px * var(--button-empty2-scale));
            --button-empty2-border-right: calc(27px * var(--button-empty2-scale));
            --button-empty2-border-bottom: calc(31px * var(--button-empty2-scale));
            --button-empty2-border-left: calc(33px * var(--button-empty2-scale));
            --button-empty2-padding-block: calc(22px * var(--button-empty2-scale) * var(--button-empty2-block));
            --button-empty2-vertical-offset: calc((var(--button-empty2-border-top) - var(--button-empty2-border-bottom)) / 2);
            border-style: solid;
            border-width: var(--button-empty2-border-top) var(--button-empty2-border-right) var(--button-empty2-border-bottom) var(--button-empty2-border-left);
            border-image-source: url('/button_empty2.png');
            border-image-slice: 37 27 31 33 fill;
            border-image-repeat: stretch;
            background: none;
            color: #fff4d6;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding-left: calc(70px * var(--button-empty2-scale) * var(--button-empty2-inline));
            padding-right: calc(70px * var(--button-empty2-scale) * var(--button-empty2-inline));
            padding-top: calc(var(--button-empty2-padding-block) - var(--button-empty2-vertical-offset));
            padding-bottom: calc(var(--button-empty2-padding-block) + var(--button-empty2-vertical-offset));
            margin: 6px;
            font-weight: 600;
            font-size: clamp(11px, 1.1vw, 14px);
            line-height: 1.1;
            max-width: min(340px, 90vw);
            white-space: nowrap;
            text-align: center;
            text-shadow: 0 2px 4px rgba(0,0,0,0.7);
            letter-spacing: 0.03em;
            box-shadow: 0 3px 10px rgba(0,0,0,0.5);
            transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
        }

        @media (max-width: 520px) {
            .button-empty2 {
                --button-empty2-vertical-offset: calc((var(--button-empty2-border-top) - var(--button-empty2-border-bottom)) / 2 + 0.4px);
            }
        }

        .button-empty2:hover {
            transform: translateY(-1px);
            box-shadow: 0 5px 12px rgba(0,0,0,0.6);
            filter: brightness(1.05);
        }

        .button-empty2:active {
            transform: translateY(0);
            box-shadow: 0 2px 6px rgba(0,0,0,0.45);
            filter: brightness(0.95);
        }

        .button-empty2:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            filter: grayscale(0.2);
            box-shadow: none;
        }

        .user-btn {
            --button-empty2-scale: 0.18;
            --button-empty2-inline: 1.05;
            --button-empty2-block: 0.78;
            font-size: clamp(11px, 1vw, 13px);
            margin: 4px;
            letter-spacing: 0.04em;
        }

        .quest-button {
            --button-empty-scale: 0.26;
            --button-empty-inline: 1.4;
            --button-empty-block: 1.05;
            --button-empty2-scale: 0.22;
            --button-empty2-inline: 1.26;
            --button-empty2-block: 0.92;
            letter-spacing: 0.14em;
        }

        #connectBtn {
            font-size: clamp(12px, 1.6vw, 15px);
        }

        #faqBtn,
        #deckBtn {
            --button-empty-inline: 1.1;
            --button-empty-block: 0.85;
            --button-empty2-inline: 1.12;
            --button-empty2-block: 0.82;
            font-size: clamp(10px, 1.1vw, 13px);
        }

        .online-user {
            cursor: pointer;
        }

        .online-user.stale {
            color: yellow;
        }

        .online-user:hover {
            background: rgba(78,205,196,0.1);
        }

        .chat-tab-content {
            background: rgba(255,255,255,0.05);
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 12px;
            max-height: calc(min(180px, 25vh) + 60px);
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .chat-section {
            flex: 1;
            max-height: min(180px, 25vh);
            overflow-y: auto;
            padding: 15px 15px 10px;
        }

        .chat-message {
            margin-bottom: 8px;
        }

        .chat-user {
            font-weight: bold;
            cursor: pointer;
            color: #4ecdc4;
        }

        .chat-input {
            display: flex;
            border-top: 1px solid rgba(255,255,255,0.2);
        }

        .chat-input input {
            flex: 1;
            padding: 8px;
            border: 1px solid rgba(255,255,255,0.4);
            border-top: none;
            border-right: none;
            background: rgba(255,255,255,0.15);
            color: white;
        }

        .chat-input input::placeholder {
            color: rgba(255,255,255,0.6);
        }

        .chat-input button {
            margin: 0;
            border: none;
            padding: 0 16px;
            background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
            color: white;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .chat-input button:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 25px rgba(0,0,0,0.3);
        }

        #lobbySection {
            margin-top: -30px;
        }

        .deck-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.8);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 1000;
        }

        #botModal {
            z-index: 1100;
        }

        #dialogModal {
            z-index: 1200;
        }

        .deck-content {
            background: #16213e;
            padding: 20px;
            border-radius: 10px;
            max-width: 500px;
            width: 90%;
            max-height: 80vh;
        }

        .deck-content.small-menu-panel {
            position: relative;
            width: min(420px, 90vw);
            padding: clamp(28px, 5vw, 44px) clamp(34px, 6vw, 48px) clamp(46px, 7vw, 60px);
            display: flex;
            flex-direction: column;
            gap: clamp(14px, 3vw, 20px);
            align-items: center;
            color: #ffe9c6;
            text-align: center;
            text-shadow: 0 3px 12px rgba(0, 0, 0, 0.65);
            border-radius: clamp(18px, 4vw, 28px);
            border: none;
            background: transparent;
            overflow: visible;
        }

        .deck-content.small-menu-panel::before {
            content: '';
            position: absolute;
            inset: 0;
            background: url('/small_menu.png') center / 100% 100% no-repeat;
            pointer-events: none;
        }

        .deck-content.small-menu-panel > * {
            position: relative;
            z-index: 1;
        }

        .deck-content.tavern-panel {
            max-width: none;
            width: min(900px, 94vw);
        }

        .deck-content.tavern-panel.faq-panel {
            width: min(640px, 92vw);
            max-width: none;
            max-height: 84vh;
            overflow-y: auto;
        }

        #statsModal .deck-content.tavern-panel {
            width: min(640px, 94vw);
        }

        .deck-content.deck-forge {
            position: relative;
            width: min(1280px, 96vw);
            max-width: none;
            max-height: 88vh;
            padding: clamp(28px, 4vw, 36px);
            border-radius: clamp(24px, 3vw, 30px);
            display: flex;
            flex-direction: column;
            gap: clamp(24px, 3vw, 32px);
            color: #f8f1dc;
            background:
                radial-gradient(circle at 12% 18%, rgba(255, 226, 170, 0.18), rgba(255, 226, 170, 0) 58%),
                radial-gradient(circle at 88% 12%, rgba(78, 205, 196, 0.12), rgba(78, 205, 196, 0) 52%),
                linear-gradient(145deg, rgba(43, 24, 10, 0.95), rgba(18, 10, 6, 0.96)),
                url('/duel_parchment.webp');
            background-size: 120% 120%, 120% 120%, 100% 100%, cover;
            background-blend-mode: screen, screen, normal, overlay;
            box-shadow: 0 40px 60px rgba(0, 0, 0, 0.6), inset 0 0 45px rgba(0, 0, 0, 0.45);
            overflow-x: hidden;
            overflow-y: auto;
            scrollbar-width: thin;
            scrollbar-color: rgba(138, 84, 32, 0.8) rgba(34, 18, 8, 0.8);
            --forge-card-min: clamp(108px, 8.6vw, 140px);
            --forge-card-max: clamp(152px, 11.2vw, 192px);
            --forge-card-gap: clamp(12px, 1vw, 16px);
            --forge-card-aspect: 63 / 88;
            --forge-card-frame: clamp(4px, 0.5vw, 8px);
            --forge-card-status-offset: calc(var(--forge-card-frame, 6px) + clamp(4px, 0.55vw, 8px));
        }

        .deck-content.deck-forge::-webkit-scrollbar {
            width: 14px;
        }

        .deck-content.deck-forge::-webkit-scrollbar-track {
            background: linear-gradient(180deg, rgba(43, 25, 10, 0.9), rgba(26, 13, 6, 0.94));
            border-radius: 12px;
            border: 1px solid rgba(94, 57, 23, 0.55);
            box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.5);
        }

        .deck-content.deck-forge::-webkit-scrollbar-thumb {
            background: linear-gradient(180deg, rgba(163, 109, 50, 0.9), rgba(120, 72, 28, 0.9));
            border-radius: 10px;
            border: 2px solid rgba(36, 20, 8, 0.85);
            box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.45);
        }

        .deck-content.deck-forge::-webkit-scrollbar-thumb:hover {
            background: linear-gradient(180deg, rgba(189, 132, 64, 0.95), rgba(146, 88, 36, 0.95));
        }

        .deck-content.deck-forge::-webkit-scrollbar-corner {
            background: transparent;
        }

        .deck-content.deck-forge::before {
            content: '';
            position: absolute;
            inset: 0;
            background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0));
            pointer-events: none;
        }

        .deck-content.deck-forge::after {
            content: '';
            position: absolute;
            inset: clamp(10px, 1.8vw, 16px);
            border-radius: inherit;
            border: 1px solid rgba(255, 232, 192, 0.22);
            box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.45);
            pointer-events: none;
        }

        .great-hall-panel {
            position: relative;
            width: min(640px, 92vw);
            max-height: 82vh;
            padding: clamp(30px, 4vw, 40px) clamp(32px, 5vw, 48px);
            border-radius: clamp(24px, 3vw, 30px);
            display: flex;
            flex-direction: column;
            gap: clamp(18px, 2.4vw, 24px);
            color: #fdf4dd;
            background:
                radial-gradient(circle at 50% -8%, rgba(255, 236, 179, 0.22), rgba(255, 236, 179, 0) 60%),
                radial-gradient(circle at 20% 20%, rgba(76, 201, 240, 0.2), rgba(76, 201, 240, 0) 58%),
                radial-gradient(circle at 80% 30%, rgba(255, 107, 107, 0.16), rgba(255, 107, 107, 0) 54%),
                linear-gradient(165deg, rgba(32, 19, 9, 0.96), rgba(16, 8, 4, 0.94)),
                url('/duel_parchment.webp');
            background-size: 120% 120%, 120% 120%, 120% 120%, 100% 100%, cover;
            background-blend-mode: screen, screen, screen, multiply, normal;
            box-shadow: 0 32px 48px rgba(0, 0, 0, 0.65), inset 0 0 42px rgba(0, 0, 0, 0.45);
            overflow: hidden;
        }

        .great-hall-panel::before {
            content: '';
            position: absolute;
            inset: 0;
            border-radius: inherit;
            background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0));
            pointer-events: none;
        }

        .great-hall-panel::after {
            content: '';
            position: absolute;
            inset: clamp(12px, 2vw, 18px);
            border-radius: inherit;
            border: 1px solid rgba(255, 235, 204, 0.22);
            box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.4);
            pointer-events: none;
        }

        .great-hall-header {
            display: flex;
            flex-direction: column;
            gap: 6px;
            align-items: center;
            text-align: center;
            position: relative;
            z-index: 1;
        }

        .great-hall-title {
            margin: 0;
            font-family: 'Cinzel', 'Trajan Pro', 'Times New Roman', serif;
            font-size: clamp(28px, 4vw, 36px);
            letter-spacing: 0.2em;
            text-transform: uppercase;
            color: #ffe7b8;
            text-shadow: 0 4px 14px rgba(0, 0, 0, 0.65);
        }

        .great-hall-subtitle {
            margin: 0;
            font-size: clamp(13px, 1.6vw, 15px);
            letter-spacing: 0.16em;
            text-transform: uppercase;
            color: rgba(255, 244, 216, 0.78);
        }

        .great-hall-list {
            position: relative;
            z-index: 1;
            margin: 0;
            padding: clamp(12px, 2vw, 18px);
            list-style: none;
            display: flex;
            flex-direction: column;
            gap: clamp(10px, 1.6vw, 14px);
            max-height: clamp(280px, 48vh, 420px);
            overflow-y: auto;
            background: rgba(10, 5, 2, 0.42);
            border-radius: clamp(16px, 2.4vw, 20px);
            border: 1px solid rgba(255, 228, 180, 0.14);
            box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.45);
        }

        .great-hall-entry {
            display: grid;
            grid-template-columns: auto 1fr auto;
            align-items: center;
            gap: clamp(12px, 1.8vw, 18px);
            padding: clamp(12px, 1.8vw, 16px) clamp(14px, 2vw, 20px);
            border-radius: clamp(14px, 2vw, 18px);
            background: linear-gradient(145deg, rgba(42, 24, 12, 0.86), rgba(18, 10, 6, 0.92));
            border: 1px solid rgba(255, 220, 170, 0.18);
            box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.45), 0 12px 26px rgba(0, 0, 0, 0.4);
            letter-spacing: 0.12em;
            text-transform: uppercase;
        }

        .great-hall-entry.rank-1 {
            border-color: rgba(255, 215, 128, 0.55);
            box-shadow: inset 0 0 26px rgba(255, 215, 128, 0.18), 0 18px 34px rgba(255, 215, 128, 0.3);
        }

        .great-hall-entry.rank-2 {
            border-color: rgba(192, 220, 255, 0.4);
            box-shadow: inset 0 0 24px rgba(192, 220, 255, 0.18), 0 16px 28px rgba(192, 220, 255, 0.28);
        }

        .great-hall-entry.rank-3 {
            border-color: rgba(255, 196, 160, 0.4);
            box-shadow: inset 0 0 24px rgba(255, 196, 160, 0.18), 0 16px 28px rgba(255, 196, 160, 0.26);
        }

        .great-hall-rank {
            font-size: clamp(18px, 2.6vw, 22px);
            color: rgba(255, 236, 198, 0.85);
        }

        .great-hall-name {
            font-size: clamp(14px, 1.8vw, 16px);
            color: #fef7e5;
            letter-spacing: 0.14em;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .great-hall-mmr {
            font-size: clamp(13px, 1.6vw, 15px);
            color: rgba(158, 244, 234, 0.9);
        }

        .great-hall-footer {
            display: flex;
            justify-content: center;
            padding-top: clamp(6px, 1.2vw, 10px);
            position: relative;
            z-index: 1;
        }

        .great-hall-empty {
            text-align: center;
            font-size: clamp(13px, 1.6vw, 15px);
            letter-spacing: 0.12em;
            color: rgba(255, 236, 206, 0.72);
            padding: clamp(18px, 2.4vw, 24px);
        }

        .great-hall-list::-webkit-scrollbar {
            width: 10px;
        }

        .great-hall-list::-webkit-scrollbar-track {
            background: rgba(0, 0, 0, 0.2);
            border-radius: 8px;
        }

        .great-hall-list::-webkit-scrollbar-thumb {
            background: linear-gradient(180deg, rgba(255, 216, 160, 0.6), rgba(255, 180, 120, 0.4));
            border-radius: 8px;
        }

        @media (max-width: 520px) {
            .great-hall-panel {
                padding: clamp(26px, 6vw, 32px);
            }

            .great-hall-entry {
                grid-template-columns: auto 1fr;
                grid-template-areas: 'rank name' 'rank mmr';
                row-gap: 6px;
            }

            .great-hall-rank {
                grid-area: rank;
            }

            .great-hall-name {
                grid-area: name;
            }

            .great-hall-mmr {
                grid-area: mmr;
                justify-self: flex-start;
            }
        }

        .deck-forge__header {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            align-items: flex-start;
            gap: clamp(18px, 2.6vw, 28px);
            position: relative;
            z-index: 1;
        }

        .deck-forge__actions {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: clamp(12px, 1.6vw, 16px);
        }

        .deck-forge__dismiss {
            display: none;
            align-items: center;
            justify-content: center;
            width: clamp(34px, 3.4vw, 40px);
            height: clamp(34px, 3.4vw, 40px);
            border-radius: 999px;
            border: 1px solid rgba(255, 225, 180, 0.36);
            background: linear-gradient(180deg, rgba(36, 20, 8, 0.92), rgba(18, 10, 5, 0.96));
            color: #ffe6b6;
            font-size: clamp(18px, 2.8vw, 22px);
            line-height: 1;
            box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
            cursor: pointer;
            transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
            outline: none;
        }

        .deck-forge__dismiss:hover,
        .deck-forge__dismiss:focus-visible {
            transform: translateY(-1px);
            box-shadow: 0 16px 30px rgba(0, 0, 0, 0.5);
            border-color: rgba(255, 236, 210, 0.55);
        }

        .deck-forge__dismiss span {
            pointer-events: none;
        }

        .deck-forge__titles {
            display: flex;
            flex-direction: column;
            gap: clamp(6px, 1vw, 10px);
        }

        .deck-forge__eyebrow {
            margin: 0;
            font-size: clamp(12px, 1.5vw, 14px);
            letter-spacing: 0.24em;
            text-transform: uppercase;
            color: rgba(255, 235, 198, 0.75);
        }

        .deck-forge__title {
            margin: 0;
            font-family: 'Cinzel', 'Trajan Pro', 'Times New Roman', serif;
            font-size: clamp(30px, 4vw, 42px);
            letter-spacing: 0.2em;
            text-transform: uppercase;
            color: #ffe6b6;
            text-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
        }

        .deck-forge__count {
            margin: 0;
            font-size: clamp(12px, 1.6vw, 14px);
            letter-spacing: 0.18em;
            text-transform: uppercase;
            color: rgba(255, 244, 216, 0.78);
        }

        .deck-forge__count--capped {
            color: #4ecdc4;
            text-shadow: 0 0 12px rgba(78, 205, 196, 0.6);
        }

        .deck-forge__summary {
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;
            align-items: flex-start;
            gap: clamp(12px, 2vw, 18px);
            margin-top: clamp(4px, 0.8vw, 8px);
            max-width: min(100%, 880px);
            position: relative;
            padding-bottom: clamp(18px, 2.6vw, 22px);
        }

        .deck-forge__count-note {
            position: absolute;
            left: 0;
            bottom: 0;
            font-size: clamp(10px, 1.3vw, 12px);
            letter-spacing: 0.14em;
            text-transform: uppercase;
            color: rgba(255, 240, 210, 0.62);
            max-width: 100%;
            pointer-events: none;
            text-align: left;
        }

        .deck-forge__count-wrap {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: clamp(10px, 1.6vw, 14px);
        }

        .deck-forge__meter {
            position: relative;
            width: clamp(140px, 22vw, 260px);
            height: clamp(10px, 1.1vw, 14px);
            border-radius: 999px;
            border: 1px solid rgba(159, 244, 234, 0.28);
            background: linear-gradient(180deg, rgba(18, 9, 4, 0.85), rgba(10, 5, 2, 0.92));
            box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.55);
            overflow: hidden;
            transition: border-color 0.25s ease, box-shadow 0.25s ease;
        }

        .deck-forge__meter::after {
            content: '';
            position: absolute;
            inset: 0;
            border-radius: inherit;
            background: radial-gradient(circle at 15% 50%, rgba(255, 255, 255, 0.18), transparent 60%);
            pointer-events: none;
        }

        .deck-forge__meter-fill {
            position: absolute;
            inset: 0;
            width: 0%;
            border-radius: inherit;
            background: linear-gradient(90deg, rgba(78, 205, 196, 0.85), rgba(159, 244, 234, 0.95));
            box-shadow: 0 0 16px rgba(78, 205, 196, 0.45);
            transition: width 0.3s ease, box-shadow 0.3s ease;
        }

        .deck-forge__meter--active {
            border-color: rgba(159, 244, 234, 0.5);
            box-shadow: inset 0 0 16px rgba(78, 205, 196, 0.18);
        }

        .deck-forge__meter:not(.deck-forge__meter--active) .deck-forge__meter-fill {
            box-shadow: none;
        }

        .deck-preview {
            --deck-preview-card-width: clamp(44px, 5.4vw, 50px);
            --deck-preview-spacing: var(--deck-preview-card-width);
            --deck-preview-overlap: calc(var(--deck-preview-spacing) - var(--deck-preview-card-width));
            display: flex;
            flex-wrap: nowrap;
            align-items: center;
            justify-content: flex-start;
            gap: 0;
            padding: clamp(8px, 1.4vw, 12px);
            padding-right: clamp(12px, 1.8vw, 16px);
            background: rgba(10, 5, 2, 0.45);
            border-radius: clamp(12px, 1.8vw, 16px);
            border: 1px solid rgba(255, 235, 200, 0.18);
            min-height: clamp(48px, 6vw, 64px);
            box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.45);
            flex: 1 1 clamp(240px, 38vw, 460px);
            min-width: 0;
            max-width: 100%;
            overflow: visible;
            position: relative;
            isolation: isolate;
        }

        .deck-preview.deck-preview--empty {
            justify-content: center;
        }

        .deck-preview__empty {
            font-size: clamp(11px, 1.4vw, 13px);
            letter-spacing: 0.12em;
            text-transform: uppercase;
            color: rgba(255, 240, 210, 0.7);
            text-align: center;
        }

        .deck-preview-card {
            flex: 0 0 var(--deck-preview-card-width);
            width: var(--deck-preview-card-width);
            aspect-ratio: 3 / 4;
            border-radius: clamp(6px, 1vw, 8px);
            overflow: hidden;
            position: relative;
            background: linear-gradient(160deg, rgba(34, 18, 8, 0.9), rgba(10, 5, 2, 0.85));
            border: 1px solid rgba(255, 235, 200, 0.2);
            box-shadow: 0 8px 14px rgba(0, 0, 0, 0.45);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: transform 0.2s ease, filter 0.2s ease;
            z-index: calc(200 + var(--stack-index, 0));
        }

        .deck-preview-card:not(:first-child) {
            margin-left: var(--deck-preview-overlap);
        }

        .deck-preview-card:hover {
            transform: translateY(-4px);
        }

        .deck-preview-card img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .deck-preview-card__placeholder {
            font-size: clamp(10px, 1.3vw, 12px);
            letter-spacing: 0.2em;
            color: rgba(255, 240, 210, 0.75);
        }

        @media (max-width: 1100px) {
            .deck-preview {
                flex-basis: 100%;
            }
        }

        @media (max-width: 720px) {
            .deck-forge__summary {
                flex-direction: column;
                align-items: stretch;
            }

            .deck-forge__actions {
                gap: clamp(10px, 3vw, 18px);
            }

            .deck-forge__dismiss {
                display: inline-flex;
            }

            .deck-forge__close {
                display: none;
            }

            .deck-forge__footer {
                display: block;
            }

            .deck-preview {
                --deck-preview-card-width: clamp(38px, 14vw, 52px);
                flex: 1 1 100%;
                width: 100%;
                justify-content: center;
                overflow: hidden;
                box-sizing: border-box;
            }
        }

        @media (max-width: 480px) {
            .deck-preview {
                --deck-preview-card-width: clamp(34px, 18vw, 46px);
            }
        }

        .deck-forge__close {
            justify-self: end;
            align-self: flex-start;
            --button-empty2-inline: 1.1;
            --button-empty2-block: 0.85;
            letter-spacing: 0.18em;
            text-transform: uppercase;
        }

        .deck-forge__footer {
            display: none;
            margin-top: clamp(18px, 2.8vw, 26px);
        }

        .deck-forge__mobile-close {
            width: 100%;
            letter-spacing: 0.18em;
            text-transform: uppercase;
        }

        .deck-forge__body {
            display: grid;
            grid-template-columns: clamp(280px, 28vw, 360px) minmax(0, 1fr);
            gap: clamp(26px, 3vw, 34px);
            position: relative;
            z-index: 1;
            align-items: flex-start;
        }

        @media (max-width: 960px) {
            .deck-forge__body {
                grid-template-columns: 1fr;
            }
        }

        .deck-forge__sidebar {
            display: flex;
            flex-direction: column;
            gap: clamp(16px, 2.4vw, 22px);
        }

        .deck-forge__collection {
            display: grid;
            grid-template-rows: auto auto 1fr auto auto;
            gap: clamp(16px, 2.2vw, 20px);
            padding: clamp(20px, 2.6vw, 24px);
            border-radius: clamp(20px, 2.6vw, 24px);
            background: linear-gradient(180deg, rgba(36, 20, 8, 0.86), rgba(16, 9, 4, 0.92));
            border: 1px solid rgba(255, 225, 180, 0.22);
            box-shadow: inset 0 0 32px rgba(0, 0, 0, 0.46), 0 18px 40px rgba(0, 0, 0, 0.45);
            position: relative;
            z-index: 1;
            overflow: hidden;
        }

        .deck-forge__collection::after {
            content: '';
            position: absolute;
            inset: clamp(8px, 1.2vw, 12px);
            border-radius: inherit;
            border: 1px solid rgba(255, 236, 210, 0.16);
            pointer-events: none;
        }

        .deck-forge__collection-controls {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: clamp(10px, 1.6vw, 14px);
        }

        .deck-forge__collection-scroll {
            position: relative;
            min-height: 0;
            overflow-y: auto;
            padding-top: clamp(2px, 0.4vw, 6px);
            padding-bottom: clamp(6px, 0.8vw, 12px);
            padding-right: clamp(4px, 0.6vw, 8px);
            margin-right: calc(-1 * clamp(4px, 0.6vw, 8px));
        }

        .forge-panel {
            display: flex;
            flex-direction: column;
            gap: clamp(12px, 1.6vw, 16px);
            background: linear-gradient(180deg, rgba(34, 18, 8, 0.85), rgba(14, 8, 4, 0.9));
            border-radius: clamp(18px, 2.6vw, 22px);
            padding: clamp(16px, 2.6vw, 22px);
            border: 1px solid rgba(255, 225, 180, 0.18);
            box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.45);
        }

        .forge-panel__label {
            font-size: clamp(12px, 1.6vw, 14px);
            letter-spacing: 0.18em;
            text-transform: uppercase;
            color: rgba(255, 240, 208, 0.72);
        }

        .forge-select {
            width: 100%;
            padding: clamp(10px, 1.8vw, 14px);
            border-radius: clamp(12px, 1.8vw, 16px);
            border: 1px solid rgba(255, 216, 166, 0.35);
            background: rgba(12, 6, 2, 0.65);
            color: #ffefd6;
            letter-spacing: 0.12em;
            text-transform: uppercase;
            cursor: pointer;
        }

        .forge-select:focus {
            outline: 2px solid rgba(78, 205, 196, 0.7);
            outline-offset: 2px;
        }

        .forge-pagination {
            display: flex;
            align-items: center;
            gap: clamp(12px, 1.8vw, 16px);
            flex-wrap: wrap;
        }

        .forge-page {
            font-size: clamp(12px, 1.5vw, 14px);
            letter-spacing: 0.22em;
            text-transform: uppercase;
            color: rgba(255, 240, 210, 0.78);
            padding: clamp(6px, 1vw, 8px) clamp(12px, 1.8vw, 14px);
            border-radius: clamp(10px, 1.6vw, 12px);
            background: rgba(12, 6, 3, 0.55);
            border: 1px solid rgba(255, 236, 210, 0.18);
            box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.4);
        }

        .forge-nav {
            --button-empty2-inline: 0.9;
            --button-empty2-block: 0.7;
            font-size: clamp(11px, 1.4vw, 13px);
            letter-spacing: 0.18em;
            white-space: nowrap;
            flex: 0 0 auto;
        }

        @media (max-width: 560px) {
            .deck-forge__ledger {
                justify-content: space-between;
            }

            .forge-pagination {
                justify-content: flex-start;
            }
        }

        .forge-panel__title {
            margin: 0;
            font-size: clamp(14px, 1.8vw, 16px);
            letter-spacing: 0.18em;
            text-transform: uppercase;
            color: rgba(255, 238, 208, 0.85);
        }

        .forge-panel__text {
            margin: 0;
            font-size: clamp(12px, 1.6vw, 14px);
            color: rgba(255, 240, 210, 0.7);
            line-height: 1.5;
        }

        .forge-buy-links {
            display: flex;
            flex-direction: column;
            gap: clamp(10px, 1.6vw, 14px);
        }

        .forge-link {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            padding: clamp(10px, 1.8vw, 14px) clamp(12px, 2vw, 18px);
            border-radius: clamp(12px, 1.8vw, 16px);
            border: 1px solid rgba(78, 205, 196, 0.25);
            background: rgba(78, 205, 196, 0.08);
            color: #9ff4ea;
            text-decoration: none;
            font-weight: 600;
            letter-spacing: 0.08em;
            transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
        }

        .forge-link:hover,
        .forge-link:focus-visible {
            transform: translateX(6px);
            background: rgba(78, 205, 196, 0.18);
            box-shadow: 0 14px 28px rgba(78, 205, 196, 0.35);
        }

        .forge-slot-buttons {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
            gap: clamp(12px, 1.8vw, 16px);
        }

        .forge-slot-button {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 4px;
            padding: clamp(12px, 1.9vw, 16px) clamp(14px, 2vw, 18px);
            border-radius: clamp(14px, 2vw, 18px);
            border: 1px solid rgba(255, 224, 166, 0.3);
            background: linear-gradient(160deg, rgba(52, 28, 12, 0.9), rgba(22, 12, 6, 0.92));
            color: #ffeeda;
            text-transform: uppercase;
            letter-spacing: 0.16em;
            font-size: clamp(11px, 1.4vw, 13px);
            cursor: pointer;
            transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
        }

        .forge-slot-button:hover {
            transform: translateY(-4px);
            box-shadow: 0 18px 28px rgba(0, 0, 0, 0.45);
        }

        .forge-slot-button--empty {
            border-style: dashed;
            border-color: rgba(255, 224, 166, 0.4);
            background: linear-gradient(160deg, rgba(36, 20, 10, 0.78), rgba(16, 8, 4, 0.82));
            color: rgba(255, 236, 210, 0.65);
            box-shadow: none;
            opacity: 0.85;
        }

        .forge-slot-button--ready {
            border-color: rgba(255, 214, 141, 0.85);
            box-shadow: inset 0 0 26px rgba(255, 214, 141, 0.24), 0 16px 28px rgba(0, 0, 0, 0.4);
            background: linear-gradient(160deg, rgba(36, 24, 16, 0.96), rgba(18, 12, 8, 0.94));
        }

        .forge-slot-button--active {
            border-color: rgba(78, 205, 196, 0.75);
            box-shadow: inset 0 0 28px rgba(78, 205, 196, 0.28), 0 18px 32px rgba(0, 0, 0, 0.5);
            transform: translateY(-2px);
            border-style: solid;
        }

        .forge-slot-label {
            font-size: clamp(12px, 1.6vw, 14px);
            color: rgba(255, 240, 210, 0.92);
        }

        .forge-slot-state {
            font-size: clamp(11px, 1.4vw, 13px);
            color: rgba(255, 240, 210, 0.65);
        }

        .forge-slot-button--ready .forge-slot-state {
            color: rgba(255, 232, 186, 0.95);
        }

        .forge-slot-button--active .forge-slot-state {
            color: rgba(159, 244, 234, 0.88);
        }

        .forge-slot-button--empty .forge-slot-state {
            color: rgba(255, 240, 210, 0.4);
        }

        .forge-slot-button--active.forge-slot-button--empty {
            opacity: 1;
            color: rgba(159, 244, 234, 0.85);
        }

        .forge-slot-button--active.forge-slot-button--empty .forge-slot-label {
            color: rgba(159, 244, 234, 0.92);
        }

        .forge-slot-button--active.forge-slot-button--empty .forge-slot-state {
            color: rgba(159, 244, 234, 0.78);
        }

        .forge-section-header {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .forge-section-title {
            font-family: 'Cinzel', 'Trajan Pro', 'Times New Roman', serif;
            text-transform: uppercase;
            letter-spacing: 0.18em;
            font-size: clamp(18px, 2.4vw, 24px);
            color: #ffe8b5;
            margin: 0;
            text-shadow: 0 3px 10px rgba(0, 0, 0, 0.6);
        }

        .forge-section-hint {
            margin: 0;
            font-size: clamp(12px, 1.5vw, 14px);
            color: rgba(255, 240, 210, 0.7);
        }

        .deck-category-bar {
            display: flex;
            flex-wrap: wrap;
            gap: clamp(8px, 1.6vw, 12px);
            align-items: center;
            margin-top: clamp(6px, 1vw, 10px);
        }

        .deck-category {
            display: inline-flex;
            align-items: center;
            gap: clamp(6px, 1vw, 8px);
            padding: clamp(6px, 1.2vw, 9px) clamp(10px, 1.8vw, 14px);
            border-radius: clamp(12px, 1.6vw, 14px);
            border: 1px solid rgba(255, 236, 210, 0.2);
            background: rgba(12, 6, 3, 0.5);
            color: rgba(255, 240, 210, 0.78);
            font-size: clamp(11px, 1.5vw, 13px);
            letter-spacing: 0.14em;
            text-transform: uppercase;
            cursor: pointer;
            transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
        }

        .deck-category:hover:not(:disabled) {
            transform: translateY(-2px);
            box-shadow: 0 12px 22px rgba(0, 0, 0, 0.35);
        }

        .deck-category:disabled {
            opacity: 0.45;
            cursor: not-allowed;
        }

        .deck-category--active {
            border-color: rgba(78, 205, 196, 0.75);
            box-shadow: 0 0 18px rgba(78, 205, 196, 0.2), inset 0 0 12px rgba(78, 205, 196, 0.25);
            color: #9ff4ea;
        }

        .deck-category__count {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: clamp(20px, 2.2vw, 24px);
            height: clamp(20px, 2.2vw, 24px);
            border-radius: 999px;
            border: 1px solid rgba(159, 244, 234, 0.45);
            background: rgba(9, 4, 2, 0.75);
            color: #9ff4ea;
            font-size: clamp(10px, 1.2vw, 12px);
            padding-inline: 6px;
        }

        .forge-card-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(var(--forge-card-min, 132px), 1fr));
            gap: var(--forge-card-gap, clamp(12px, 1.2vw, 18px));
            align-content: flex-start;
        }

        .forge-card-grid .card-item {
            width: min(100%, var(--forge-card-max, 210px));
            min-width: 0;
            margin-inline: auto;
        }

        .card-item {
            display: flex;
            flex-direction: column;
            height: 100%;
        }

        .deck-forge__collection .forge-card {
            width: 100%;
            max-width: 100%;
            margin-inline: 0;
        }

        .forge-card {
            position: relative;
            display: grid;
            place-items: stretch;
            aspect-ratio: var(--card-aspect, var(--forge-card-aspect, 63 / 88));
            border-radius: clamp(14px, 2vw, 18px);
            overflow: hidden;
            border: 2px solid rgba(78, 205, 196, 0.42);
            background: rgba(18, 10, 6, 0.72);
            box-shadow: 0 16px 34px rgba(0, 0, 0, 0.45);
            cursor: pointer;
            transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, filter 0.25s ease;
            padding: var(--forge-card-frame, clamp(4px, 0.5vw, 8px));
            box-sizing: border-box;
        }

        .forge-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 22px 40px rgba(0, 0, 0, 0.55);
        }

        .forge-card.selected {
            border-color: #4ecdc4;
            box-shadow: 0 24px 42px rgba(78, 205, 196, 0.25), inset 0 0 22px rgba(78, 205, 196, 0.35);
        }

        .forge-card--freebie {
            border-color: rgba(255, 236, 210, 0.62);
            background: rgba(32, 18, 8, 0.74);
        }

        .forge-card:focus-visible {
            outline: 2px solid rgba(159, 244, 234, 0.65);
            outline-offset: 4px;
        }

        .forge-card__art {
            width: 100%;
            height: 100%;
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
            object-position: center;
            display: block;
            background: transparent;
            border-radius: 0;
            box-shadow: none;
        }

        .forge-card .card-overlay {
            bottom: 0;
            left: 0;
            right: 0;
            padding: clamp(4px, 0.6vw, 8px) clamp(8px, 1vw, 12px);
            border-radius: 0;
            background: none;
            box-shadow: none;
            backdrop-filter: none;
            pointer-events: none;
            text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
        }

        .forge-card-checkbox {
            position: absolute;
            width: 1px;
            height: 1px;
            margin: -1px;
            padding: 0;
            border: 0;
            clip: rect(0 0 0 0);
            clip-path: inset(50%);
            overflow: hidden;
            white-space: nowrap;
        }

        .forge-card-status {
            position: absolute;
            top: var(--forge-card-status-offset, clamp(10px, 1.4vw, 14px));
            right: var(--forge-card-status-offset, clamp(10px, 1.4vw, 14px));
            width: clamp(22px, 2.1vw, 28px);
            height: clamp(22px, 2.1vw, 28px);
            border-radius: 50%;
            background: rgba(15, 8, 4, 0.68);
            border: 1px solid rgba(78, 205, 196, 0.55);
            color: #4ecdc4;
            display: grid;
            place-items: center;
            font-size: clamp(10px, 1.3vw, 13px);
            opacity: 0;
            transform: scale(0.85);
            box-shadow: 0 0 0 rgba(78, 205, 196, 0);
            transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
        }

        .forge-card-status::before {
            content: '✓';
        }

        .forge-card.selected .forge-card-status {
            opacity: 1;
            transform: scale(1);
            box-shadow: 0 0 16px rgba(78, 205, 196, 0.55), inset 0 0 8px rgba(78, 205, 196, 0.35);
            border-color: #4ecdc4;
        }

        .forge-card-meta {
            display: flex;
            flex-direction: column;
            gap: clamp(6px, 1.2vw, 8px);
        }

        .forge-card-name {
            font-family: 'Cinzel', 'Trajan Pro', 'Times New Roman', serif;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            font-size: clamp(12px, 1.6vw, 16px);
            color: #ffe8c6;
            text-shadow: 0 3px 8px rgba(0, 0, 0, 0.6);
        }

        .forge-card-tags {
            font-size: clamp(9px, 1vw, 11px);
            letter-spacing: 0.12em;
            text-transform: uppercase;
            color: rgba(255, 240, 210, 0.7);
            line-height: 1.5;
            word-break: break-word;
        }

        .forge-card-toggle {
            display: flex;
            align-items: center;
            gap: clamp(10px, 1.4vw, 14px);
            font-size: clamp(10px, 1.1vw, 12px);
            letter-spacing: 0.18em;
            text-transform: uppercase;
            color: rgba(255, 245, 220, 0.82);
        }

        .forge-card-toggle input {
            appearance: none;
            width: clamp(18px, 2vw, 20px);
            height: clamp(18px, 2vw, 20px);
            border-radius: 6px;
            border: 1px solid rgba(255, 228, 186, 0.35);
            background: rgba(15, 8, 4, 0.78);
            box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.6);
            position: relative;
            transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
            cursor: pointer;
        }

        .forge-card-toggle input::after {
            content: '';
            position: absolute;
            inset: 4px;
            border-radius: 4px;
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.4));
            opacity: 0;
            transform: scale(0.6);
            transition: opacity 0.2s ease, transform 0.2s ease;
        }

        .forge-card-toggle input:checked {
            border-color: rgba(78, 205, 196, 0.8);
            background: linear-gradient(135deg, rgba(78, 205, 196, 0.15), rgba(78, 205, 196, 0.35));
            box-shadow: 0 0 14px rgba(78, 205, 196, 0.45);
        }

        .forge-card-toggle input:checked::after {
            opacity: 1;
            transform: scale(1);
        }

        .forge-card-toggle-text {
            flex: 1;
        }

        .deck-forge__collection-footer {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: space-between;
            gap: clamp(12px, 1.8vw, 16px);
            position: relative;
            z-index: 1;
            margin-top: clamp(18px, 2.6vw, 24px);
        }

        .deck-forge__footer-actions {
            display: flex;
            flex-wrap: wrap;
            justify-content: flex-end;
            align-items: center;
            gap: clamp(8px, 1.4vw, 16px);
        }

        @media (min-width: 721px) {
            .deck-forge__footer-actions {
                margin-left: auto;
            }
        }

        .deck-forge__ledger {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: clamp(10px, 1.6vw, 14px);
            flex: 1 1 auto;
            min-width: min(100%, 320px);
        }

        .deck-forge__ledger-label {
            white-space: nowrap;
        }

        .forge-save {
            --button-empty2-inline: 1.18;
            --button-empty2-block: 0.92;
            letter-spacing: 0.22em;
            text-transform: uppercase;
            font-size: clamp(12px, 1.6vw, 14px);
        }

        .forge-clear {
            --button-empty2-inline: 1.05;
            --button-empty2-block: 0.8;
            letter-spacing: 0.16em;
            text-transform: uppercase;
            font-size: clamp(11px, 1.4vw, 13px);
        }

        .faq-panel {
            position: relative;
            display: flex;
            flex-direction: column;
            gap: clamp(20px, 3vw, 28px);
            padding: clamp(32px, 4vw, 44px) clamp(30px, 5vw, 48px) clamp(40px, 5.5vw, 56px);
            box-sizing: border-box;
            border-radius: clamp(22px, 3vw, 28px);
            color: #f8edd6;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.65);
            background: linear-gradient(140deg, rgba(76, 42, 16, 0.96), rgba(35, 18, 8, 0.96));
            border: 2px solid rgba(165, 118, 58, 0.6);
            box-shadow: 0 30px 50px rgba(0, 0, 0, 0.55), inset 0 2px 10px rgba(255, 255, 255, 0.1);
            overflow-y: auto;
            scrollbar-width: thin;
            scrollbar-color: rgba(163, 117, 60, 0.7) rgba(28, 16, 9, 0.85);
            min-height: clamp(520px, 66vh, 760px);
        }

        .faq-panel::before {
            content: '';
            position: absolute;
            inset: 0;
            background-image: url('/table-1.jpg');
            background-size: cover;
            background-position: center;
            opacity: 0.18;
            mix-blend-mode: overlay;
            pointer-events: none;
        }

        .faq-panel::after {
            content: '';
            position: absolute;
            inset: clamp(10px, 2vw, 18px);
            border-radius: inherit;
            border: 1px solid rgba(255, 226, 170, 0.28);
            box-shadow: inset 0 0 32px rgba(0, 0, 0, 0.45);
            pointer-events: none;
        }

        .faq-panel > * {
            position: relative;
            z-index: 1;
        }

        .faq-panel::-webkit-scrollbar {
            width: 12px;
        }

        .faq-panel::-webkit-scrollbar-track {
            background: rgba(28, 16, 9, 0.8);
            border-radius: 999px;
        }

        .faq-panel::-webkit-scrollbar-thumb {
            background: rgba(163, 117, 60, 0.7);
            border-radius: 999px;
            border: 2px solid rgba(28, 16, 9, 0.9);
        }

        .faq-modal {
            opacity: 0;
            transition: opacity 0.35s ease;
        }

        .faq-modal .faq-panel {
            transform: translateY(24px) scale(0.96);
            opacity: 0;
            transition: transform 0.35s ease, opacity 0.35s ease;
        }

        .faq-modal.faq-modal--open {
            opacity: 1;
        }

        .faq-modal.faq-modal--open .faq-panel {
            transform: translateY(0) scale(1);
            opacity: 1;
        }

        .faq-modal.faq-modal--closing {
            opacity: 0;
        }

        .faq-modal.faq-modal--closing .faq-panel {
            transform: translateY(18px) scale(0.94);
            opacity: 0;
        }

        .lore-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: clamp(18px, 2.6vw, 26px);
            margin-bottom: clamp(18px, 2.8vw, 26px);
            position: relative;
            z-index: 1;
            flex-wrap: wrap;
        }

        .lore-title-wrap {
            display: flex;
            flex-direction: column;
            gap: 6px;
            align-items: flex-start;
        }

        .lore-title {
            margin: 0;
            font-family: 'Cinzel', 'Trajan Pro', 'Times New Roman', serif;
            font-size: clamp(26px, 4vw, 34px);
            letter-spacing: 0.16em;
            text-transform: uppercase;
            color: #ffe7b0;
            text-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
            max-width: 100%;
            white-space: nowrap;
            text-align: left;
        }

        .faq-close {
            margin-left: auto;
            --button-empty2-inline: 1.08;
            --button-empty2-block: 0.78;
            font-size: clamp(11px, 1.1vw, 13px);
            letter-spacing: 0.05em;
        }

        .lore-tabs {
            display: flex;
            gap: clamp(8px, 1.4vw, 14px);
            margin-bottom: clamp(14px, 2vw, 20px);
            position: relative;
            z-index: 1;
        }

        .lore-tab {
            flex: 1;
            padding: clamp(6px, 1.4vw, 10px);
            border-radius: clamp(8px, 1.4vw, 12px);
            border: 1px solid rgba(255, 224, 166, 0.25);
            background: linear-gradient(135deg, rgba(40, 20, 8, 0.8), rgba(20, 10, 4, 0.85));
            color: rgba(255, 240, 210, 0.75);
            letter-spacing: 0.12em;
            text-transform: uppercase;
            font-size: clamp(11px, 1.3vw, 13px);
            cursor: pointer;
            transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
        }

        .lore-tab.active {
            border-color: rgba(78, 205, 196, 0.6);
            color: #9ff4ea;
            box-shadow: inset 0 0 20px rgba(78, 205, 196, 0.18), 0 14px 24px rgba(0, 0, 0, 0.45);
        }

        .lore-tab:hover {
            transform: translateY(-3px);
        }

        .lore-section {
            position: relative;
            z-index: 1;
            overflow-wrap: anywhere;
            min-height: clamp(220px, 32vh, 320px);
        }

        .lore-intro {
            margin: 0 0 clamp(14px, 2vw, 18px);
            font-size: clamp(13px, 1.6vw, 15px);
            color: rgba(255, 240, 210, 0.78);
            line-height: 1.6;
        }

        .lore-list {
            list-style: none;
            margin: 0;
            padding: 0;
            display: flex;
            flex-direction: column;
            gap: clamp(12px, 1.8vw, 16px);
        }

        .lore-list li {
            position: relative;
            padding-left: clamp(26px, 3vw, 32px);
            font-size: clamp(13px, 1.6vw, 15px);
            line-height: 1.6;
            color: rgba(255, 240, 210, 0.84);
        }

        .lore-list li::before {
            content: '';
            position: absolute;
            left: 0;
            top: clamp(6px, 1vw, 8px);
            width: clamp(10px, 1.4vw, 12px);
            height: clamp(10px, 1.4vw, 12px);
            border-radius: 50%;
            background: radial-gradient(circle at 30% 30%, rgba(255, 224, 170, 0.9), rgba(161, 102, 40, 0.85));
            box-shadow: 0 0 12px rgba(255, 224, 170, 0.4);
        }

        .lore-callout {
            display: inline-block;
            font-weight: 700;
            letter-spacing: 0.12em;
            text-transform: uppercase;
            color: #ffe7b8;
        }

        .lore-link {
            color: #9ff4ea;
            text-decoration: none;
            font-weight: 600;
            letter-spacing: 0.06em;
            cursor: pointer;
            position: relative;
        }

        .lore-link::after {
            content: '';
            position: absolute;
            left: 0;
            bottom: -2px;
            width: 100%;
            height: 1px;
            background: linear-gradient(90deg, rgba(159, 244, 234, 0), rgba(159, 244, 234, 0.6), rgba(159, 244, 234, 0));
            transition: opacity 0.25s ease, transform 0.25s ease;
            opacity: 0.6;
        }

        .lore-link:hover::after,
        .lore-link:focus-visible::after {
            opacity: 1;
            transform: translateY(-1px);
        }

        .tavern-panel {
            position: relative;
            background: linear-gradient(135deg, rgba(76, 42, 16, 0.95), rgba(35, 18, 8, 0.96));
            border-radius: clamp(18px, 3vw, 26px);
            padding: clamp(28px, 4vw, 42px) clamp(26px, 5vw, 52px) clamp(34px, 6vw, 54px);
            color: #f8edd6;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.65);
            overflow: hidden;
            border: 2px solid rgba(165, 118, 58, 0.6);
            box-shadow: 0 30px 50px rgba(0, 0, 0, 0.55), inset 0 2px 10px rgba(255, 255, 255, 0.1);
        }

        .tavern-panel::before {
            content: '';
            position: absolute;
            inset: 0;
            background-image: url('/table-1.jpg');
            background-size: cover;
            background-position: center;
            opacity: 0.18;
            mix-blend-mode: overlay;
            pointer-events: none;
        }

        .tavern-panel::after {
            content: '';
            position: absolute;
            inset: 8px;
            border-radius: clamp(12px, 2.2vw, 18px);
            border: 1px solid rgba(255, 226, 170, 0.25);
            box-shadow: inset 0 0 45px rgba(0, 0, 0, 0.45);
            pointer-events: none;
        }

        .tavern-panel > * {
            position: relative;
            z-index: 1;
        }

        .tavern-heading {
            font-family: 'Cinzel', 'Trajan Pro', 'Times New Roman', serif;
            text-transform: uppercase;
            letter-spacing: 0.14em;
            text-align: center;
            margin-bottom: clamp(18px, 3vw, 26px);
            color: #ffe4a0;
            text-shadow: 0 3px 8px rgba(0, 0, 0, 0.6);
        }

        #statsContent {
            display: flex;
            flex-direction: column;
            gap: clamp(18px, 3vw, 24px);
            background: rgba(12, 6, 2, 0.45);
            border-radius: clamp(14px, 2.5vw, 20px);
            padding: clamp(18px, 3vw, 24px) clamp(20px, 4vw, 32px);
            border: 1px solid rgba(214, 170, 96, 0.25);
            box-shadow: inset 0 0 35px rgba(0, 0, 0, 0.45);
        }

        .deck-slot-row {
            display: flex;
            justify-content: center;
            gap: clamp(10px, 2vw, 16px);
            margin-top: clamp(12px, 2vw, 18px);
        }

        .stats-nameplate {
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            align-items: baseline;
            gap: 8px;
            letter-spacing: 0.12em;
            text-transform: uppercase;
        }

        .stats-name {
            font-size: clamp(18px, 2.4vw, 24px);
            font-weight: 700;
            color: #ffe8b5;
        }

        .stats-mmr {
            font-size: clamp(14px, 1.8vw, 18px);
            color: #d6c48a;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
        }

        .stats-board {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
            gap: clamp(12px, 2.6vw, 18px);
        }

        .stat-pill {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
            padding: clamp(12px, 2.4vw, 18px);
            border-radius: clamp(12px, 2.2vw, 18px);
            background: linear-gradient(180deg, rgba(48, 24, 8, 0.85), rgba(26, 12, 4, 0.9));
            border: 1px solid rgba(255, 224, 166, 0.2);
            box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6), 0 8px 18px rgba(0, 0, 0, 0.45);
            min-height: 92px;
        }

        .stat-pill .stat-label {
            font-size: clamp(11px, 1.4vw, 13px);
            letter-spacing: 0.12em;
            color: rgba(255, 227, 180, 0.8);
            text-transform: uppercase;
        }

        .stat-pill .stat-value {
            font-size: clamp(20px, 3vw, 28px);
            font-weight: 700;
            color: #fff5d8;
            text-shadow: 0 3px 6px rgba(0, 0, 0, 0.6);
        }

        .stat-pill.wins {
            background: linear-gradient(180deg, rgba(56, 84, 36, 0.85), rgba(33, 55, 22, 0.88));
            border-color: rgba(190, 231, 140, 0.4);
        }

        .stat-pill.losses {
            background: linear-gradient(180deg, rgba(94, 32, 32, 0.85), rgba(52, 16, 16, 0.9));
            border-color: rgba(255, 166, 166, 0.3);
        }

        .stat-pill.rate {
            background: linear-gradient(180deg, rgba(58, 64, 96, 0.85), rgba(28, 30, 52, 0.9));
            border-color: rgba(180, 198, 255, 0.3);
        }

        .stat-footnote {
            text-align: center;
            font-size: clamp(12px, 1.6vw, 14px);
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: rgba(255, 230, 184, 0.75);
        }

        .tavern-actions {
            margin-top: clamp(22px, 4vw, 32px);
            gap: clamp(12px, 3vw, 20px);
            flex-wrap: wrap;
            justify-content: center;
        }

        .tavern-actions .button-empty2 {
            --button-empty2-inline: 1.05;
            max-width: min(260px, 100%);
            min-width: min(180px, 100%);
            width: auto;
        }

        @media (max-width: 520px) {
            .tavern-actions .button-empty2 {
                --button-empty2-inline: 0.96;
            }
        }

        .tavern-grid {
            margin: clamp(18px, 4vw, 28px) auto;
            padding: clamp(18px, 4vw, 28px);
            background: rgba(12, 6, 2, 0.45);
            border-radius: clamp(16px, 3vw, 22px);
            border: 1px solid rgba(210, 168, 96, 0.25);
            box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.35);
            max-width: min(840px, 94vw);
        }

        .tavern-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: clamp(18px, 3vw, 26px);
            justify-items: stretch;
        }



        .sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }


        }

        #dialogModal {
            z-index: 2000;
        }

        #botDiffs {
            margin: 10px 0;
            display: flex;
            flex-direction: column;
            gap: 8px;
            width: 100%;
        }

        #botDiffs .user-btn {
            --button-empty2-inline: 1.35;
            --button-empty2-block: 0.92;
            width: 100%;
            max-width: 100%;
        }


        .battle-container {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100vh;
            display: none;
            flex-direction: column;
            justify-content: flex-end;
            z-index: 50;
            overflow: hidden;
            perspective: 1200px;
            background: #000;
            --table-tilt-angle: 25deg;
            --table-translate-y: -40px;
            --table-scale-x: 1;
            --arena-tilt-angle: 25deg;
            --arena-translate-y: 0px;
            --arena-padding-block: 0px;
            --hand-translate-y: 0px;
            --battle-view-transition: 0.3s;
        }

        .table-wrapper {
            position: absolute;
            inset: 0;
            transform-origin: center bottom;
            transform: rotateX(var(--table-tilt-angle)) translate3d(0, var(--table-translate-y), 0) scaleX(var(--table-scale-x));
            transition: transform var(--battle-view-transition) ease;
            will-change: transform;
            pointer-events: none;
            z-index: -1;
        }

        .table-wrapper .table-surface {
            position: absolute;
            inset: 0;
            background:
                radial-gradient(circle at center, rgba(0,0,0,0) 60%, rgba(0,0,0,0.8) 100%),
                url('/table-1.jpg') repeat;
            background-size: 100% 100%, 256px 256px;
            background-repeat: no-repeat, repeat;
        }

        .table-wrapper .table-edge {
            position: absolute;
            bottom: -80px;
            height: 80px;
            left: 50%;
            width: 86%;
            transform: translateX(-50%) rotateX(65deg);
            transform-origin: center top;
            background:
                linear-gradient(to bottom, rgba(0,0,0,0.8), rgba(0,0,0,0.2)),
                url('/table-1.jpg') repeat;
            background-size: 100% 100%, 256px 256px;
            background-repeat: no-repeat, repeat;
            border-top: 4px solid rgba(0,0,0,0.9);
            box-shadow: inset 0 10px 15px rgba(0,0,0,0.8);
        }

        .battle-container.bird-view {
            --table-tilt-angle: 0deg;
            --table-translate-y: 0px;
            --arena-tilt-angle: 0deg;
            --arena-translate-y: 20px;
            --hand-translate-y: 80px;
        }

        .battle-arena {
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            align-items: stretch;
            height: 60vh;
            margin: 0 0 2vh;
            gap: 0;
            position: relative;
            transform-style: preserve-3d;
            transform-origin: center bottom;
            transform: rotateX(var(--arena-tilt-angle)) translate3d(0, var(--arena-translate-y), 0);
            transition: transform var(--battle-view-transition) ease;
            will-change: transform;
            padding: var(--arena-padding-block) 0;
        }

        .battle-arena::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 94%;
            height: 100%;
            transform: translate(-50%, -50%);
            background: url('/duel_parchment.webp') no-repeat center/contain;
            pointer-events: none;
            z-index: -1;
            filter: drop-shadow(0 12px 16px rgba(0,0,0,0.9));
        }

        .card-display {
            border-radius: 15px;
            padding: 10px;
            text-align: center;
            flex: 1;
            min-height: 0;
            width: 100%;
            display: flex;
            flex-direction: column;
            justify-content: center;
            position: relative;
            z-index: 10;
        }

        .card-display.player2 {
            justify-content: flex-end;
        }

        .card-display.player1 {
            justify-content: flex-start;
        }

        @media (min-width: 769px) {
            .card-display.player2 {
                padding-top: 40px;
            }
            .card-display.player1 {
                padding-bottom: 40px;
            }
        }

        .card-row {
            display: flex;
            gap: 15px;
            justify-content: center;
        }

        .card-slot {
            flex: 0 0 auto;
            width: 25vw;
            height: 37.5vw;
            max-width: 100px;
            max-height: 150px;
            border: 2px dashed rgba(255,255,255,0.2);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            position: relative;
            overflow: visible;
            touch-action: none;
        }

        .card-slot.selected {
            z-index: 2;
        }

        @media (hover: hover) {
            .card-slot:hover {
                overflow: visible;
            }

            .card-slot.empty:hover {
                border-color: #4ecdc4;
            }
        }

        .card-slot:not(.empty) {
            border: none;
        }

        .card-slot.empty::after {
            content: '+';
            font-size: 2rem;
            color: rgba(255,255,255,0.3);
        }

        .card-slot.empty.highlight-slot {
            border-color: #4ecdc4;
            box-shadow: 0 0 10px rgba(78,205,196,0.7);
        }

        .card-slot.empty.flash-slot {
            border-color: #4ecdc4;
            box-shadow: 0 0 10px rgba(78,205,196,0.7);
            animation: slot-flash 1s ease-in-out 3;
        }

        @keyframes slot-flash {
            0%, 100% {
                border-color: #4ecdc4;
                box-shadow: 0 0 10px rgba(78,205,196,0.7);
            }
            50% {
                border-color: rgba(255,255,255,0.2);
                box-shadow: none;
            }
        }

        .card-slot img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            border-radius: 8px;
        }

        .block-shields {
            position: absolute;
            top: 4px;
            left: 4px;
            display: flex;
            gap: 2px;
        }

        .block-shields .shield-icon img {
            width: 16px;
            height: 16px;
        }

        .card-container {
            position: relative;
            width: 100%;
            height: 100%;
            cursor: pointer;
            transition: transform 0.15s ease, box-shadow 0.3s ease;
        }

        @media (hover: hover) {
            #card1 .card-container:hover {
                transform: translateY(-5px);
                box-shadow: 0 10px 15px rgba(0,0,0,0.3);
            }

            #card1 .card-slot:not(.empty):hover .card-container {
                transform: scale(1.1);
            }
        }

        .card-slot.selected .card-container,
        .card-slot.dragging .card-container {
            transform: scale(1.15);
        }

        .card-slot.selected .hp-top,
        .card-slot.selected .attack,
        .card-slot.dragging .hp-top,
        .card-slot.dragging .attack {
            transform: scale(1.25);
        }

        @media (hover: hover) {
            #card1 .card-slot:not(.empty):hover .hp-top,
            #card1 .card-slot:not(.empty):hover .attack {
                transform: scale(1.25);
            }
        }

        #attackArrow {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            pointer-events: none;
            z-index: 2002;
            display: none;
        }

        #attackArrowPath {
            stroke-width: 4;
            fill: none;
            stroke-dasharray: 8 8;
            animation: dash 1s linear infinite;
            stroke-linecap: round;
        }

        @keyframes dash {
            to {
                stroke-dashoffset: -16;
            }
        }

        .bot-placeholder {
            border: 2px dashed rgba(255,255,255,0.5);
            border-radius: 8px;
            background: rgba(0,0,0,0.3);
            box-sizing: border-box;
        }

        .bot-placeholder .placeholder-text {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            color: rgba(255,255,255,0.7);
            font-size: 0.8rem;
            text-align: center;
            pointer-events: none;
        }

        .hp-top,
        .card-overlay {
            z-index: 2;
        }

        .hp-top {
            position: relative;
            width: 28px;
            height: 28px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.6rem;
            font-weight: bold;
            opacity: 0.8;
            transition: transform 0.15s ease;
        }

        .hp-top::before {
            content: '❤️';
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            font-size: 16px;
            z-index: -1;
            opacity: 0.7;
        }

        .damage-number {
            position: fixed;
            transform: translate(-50%, -50%);
            display: flex;
            pointer-events: none;
            z-index: 3000;
            filter: drop-shadow(0 0 2px #000);
        }

        .damage-number img {
            width: 28px;
            height: 28px;
            image-rendering: pixelated;
        }

        .defeat-fade {
            animation: cardFadeOut 0.5s forwards;
        }

        @keyframes cardFadeOut {
            to { opacity: 0; }
        }

        @keyframes cardLanding {
            0% {
                transform: translateY(-40px) scale(1.1);
                opacity: 0;
                filter: drop-shadow(0 15px 10px rgba(0,0,0,0.5));
            }
            100% {
                transform: translateY(0) scale(1);
                opacity: 1;
                filter: drop-shadow(0 0 0 rgba(0,0,0,0));
            }
        }

        .card-container.landing {
            animation: cardLanding 0.6s ease-out;
            z-index: 5;
        }

        .card-overlay {
            position: absolute;
            bottom: -2px;
            left: 0;
            right: 0;
            color: white;
            font-size: 0.6rem;
            display: flex;
            flex-direction: column;
            padding: 2px 4px;
        }

        .overlay-row {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 24px;
            text-shadow: 0 1px 2px rgba(0,0,0,0.8);
        }

        .effect-icons {
            position: absolute;
            top: 2px;
            left: 2px;
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .effect-row {
            display: flex;
            gap: 2px;
        }

        .effect-icon {
            position: relative;
            width: 16px;
            height: 16px;
        }

        .effect-icon img {
            width: 100%;
            height: 100%;
        }

        .attack {
            position: relative;
            width: 28px;
            height: 28px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.6rem;
            font-weight: bold;
            opacity: 0.8;
            transition: transform 0.15s ease;
        }

        .attack::before {
            content: '⚔️';
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            font-size: 16px;
            z-index: -1;
            opacity: 0.7;
        }

        .hp-value,
        .attack-value {
            position: relative;
            z-index: 1;
        }

        .wear-below {
            text-align: center;
            font-size: 0.6rem;
            margin-top: 2px;
            opacity: 0.8;
        }

        .hand {
            display: flex;
            justify-content: center;
            align-items: flex-end;
            gap: 10px;
            margin-top: 20px;
            height: 160px;
            position: relative;
            margin-left: auto;
            margin-right: auto;
            transform: translate3d(0, var(--hand-translate-y), 0);
            transition: transform var(--battle-view-transition) ease;
            will-change: transform;
        }

        .battle-container.bird-view #endTurnBtn {
            visibility: hidden;
        }

        .hand-card {
            width: 100px;
            height: 150px;
            cursor: pointer;
            border-radius: 8px;
            touch-action: none;
            transition: transform 0.15s ease, box-shadow 0.3s ease;
            position: relative;
            transform-origin: center bottom;
            transform: var(--base-transform);
        }

        .hand-card .card-art {
            width: 100%;
            height: 100%;
            object-fit: contain;
            border-radius: 8px;
        }

        .hand-card.selected {
            outline: 2px solid #4ecdc4;
        }

        @media (hover: hover) {
            .hand-card:hover {
                transform: var(--base-transform) scale(1.1);
                box-shadow: 0 10px 15px rgba(0,0,0,0.3);
                z-index: 2;
            }
        }

        .card-container.selected {
            outline: 2px solid #4ecdc4;
            border-radius: 8px;
        }

        .card-display.player1::before,
        .card-display.player2::before {
            content: '';
            position: absolute;
            top: 0;
            left: 50%;
            width: 75%;
            height: 100%;
            transform: translateX(-50%);
            border-radius: 8px;
            pointer-events: none;
            background: rgba(255,255,255,0.05);
            z-index: -1;
        }

        .card-display.player1::before {
            border: 2px solid #4ecdc4;
            box-shadow: 0 0 10px rgba(78, 205, 196, 0.4);
        }

        .card-display.player2::before {
            border: 2px solid #ff6b6b;
            box-shadow: 0 0 10px rgba(255, 107, 107, 0.4);
        }

        .vs-section {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
            text-align: center;
            z-index: 50;
            pointer-events: none;
        }

        .vs-text {
            font-size: 3rem;
            font-weight: bold;
            background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            text-shadow: 0 0 30px rgba(255,255,255,0.5);
        }

        .card-info {
            text-align: center;
        }

        .card-info h3 {
            font-size: 1.5rem;
            margin-bottom: 15px;
            color: #4ecdc4;
        }

        #playerLabel,
        #opponentLabel {
            display: inline-block;
        }

        #playerLabel {
            margin-top: 25px;
        }

        #opponentLabel {
            margin-top: 35px;
            margin-bottom: 5px;
        }



        .health-bar {
            width: 100%;
            height: 20px;
            background: rgba(0,0,0,0.3);
            border-radius: 10px;
            overflow: hidden;
            margin: 10px 0;
        }

        .health-fill {
            height: 100%;
            transition: width 0.5s ease;
            border-radius: 10px;
        }

        .health-fill.player1 { background: linear-gradient(90deg, #4ecdc4, #45b7d1); }
        .health-fill.player2 { background: linear-gradient(90deg, #ff6b6b, #ff8e53); }

        .battle-log {
            background: rgba(0,0,0,0.5);
            border-radius: 15px;
            padding: 20px;
            margin: 0;
            flex: 0 0 40%;
            overflow-y: auto;
            max-height: 200px;
            border: 1px solid rgba(255,255,255,0.1);
        }

        .hand-log-container {
            display: flex;
            justify-content: center;
            align-items: flex-end;
            margin-top: 20px;
            position: relative;
            z-index: 10;
            width: 100%;
        }

        .hand-ready-container {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .hand-log-container .hand {
            width: 100%;
            margin-top: 0;
        }

        .hand-log-container .battle-log {
            position: absolute;
            right: 0;
            bottom: 0;
        }

        .battle-controls {
            position: absolute;
            right: clamp(24px, 7vw, 140px);
            bottom: clamp(28px, 6vh, 96px);
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            gap: 12px;
            z-index: 120;
            pointer-events: auto;
            width: max-content;
        }

        .ready-btn {
            margin-top: 0;
        }

        @keyframes card-error-blink {
            0%, 100% {
                box-shadow: 0 0 0 0 rgba(255, 72, 72, 0);
                transform: translateY(0);
            }
            25%, 75% {
                box-shadow: 0 0 18px 6px rgba(255, 72, 72, 0.7);
            }
            50% {
                box-shadow: 0 0 26px 10px rgba(255, 40, 40, 0.85);
            }
        }

        .hand-card.card-error-blink,
        .card-container.card-error-blink {
            animation: card-error-blink 0.9s ease-in-out;
        }

        .card-slot.card-error-blink {
            animation: card-error-blink 0.9s ease-in-out;
            border-color: rgba(255, 72, 72, 0.85);
            box-shadow: 0 0 0 2px rgba(255, 72, 72, 0.75), 0 0 24px rgba(255, 72, 72, 0.55);
        }

        .log-entry {
            margin: 8px 0;
            padding: 8px;
            border-left: 3px solid #4ecdc4;
            background: rgba(255,255,255,0.05);
            border-radius: 0 8px 8px 0;
        }

        .winner-announcement {
            background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
            padding: 30px;
            border-radius: 15px;
            text-align: center;
            margin: 30px 0;
            font-size: 1.5rem;
            font-weight: bold;
            animation: pulse 2s infinite;
        }

        .end-screen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.9);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: flex-start;
            padding-top: 50px;
            box-sizing: border-box;
            color: #fff;
            text-align: center;
            z-index: 100;
        }

        .vs-splash {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.85);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-size: 2rem;
            z-index: 100;
            text-align: center;
            perspective: 800px;
        }

        .loading-screen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.9);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: flex-start;
            color: #fff;
            text-align: center;
            z-index: 100;
            padding: 50px 20px 20px;
            box-sizing: border-box;
        }

        #bootScreen {
            justify-content: flex-end;
            padding: clamp(24px, 7vh, 72px) clamp(18px, 6vw, 90px) clamp(36px, 10vh, 120px);
            background-color: #110b14;
            background-image:
                radial-gradient(140% 140% at 50% 32%, rgba(82, 47, 23, 0.72) 0%, rgba(30, 22, 34, 0.95) 60%, rgba(10, 8, 14, 0.98) 100%),
                radial-gradient(110% 120% at 18% 46%, rgba(134, 84, 37, 0.32) 0%, rgba(30, 22, 36, 0.82) 55%, transparent 100%),
                radial-gradient(110% 120% at 82% 46%, rgba(134, 84, 37, 0.32) 0%, rgba(30, 22, 36, 0.82) 55%, transparent 100%);
            transition: opacity 0.6s ease;
            overflow: hidden;
            isolation: isolate;
        }

        #bootScreen::before {
            content: '';
            position: absolute;
            inset: -14%;
            background: url('/preload_screen.webp') center / cover no-repeat;
            filter: blur(46px) saturate(1.08);
            opacity: 0.45;
            transform: scale(1.04);
            pointer-events: none;
            z-index: 0;
        }

        #bootScreen.boot-screen--closing {
            opacity: 0;
            pointer-events: none;
        }

        #bootScreen.boot-screen--closing .boot-menu,
        #bootScreen.boot-screen--closing .boot-text,
        #bootScreen.boot-screen--closing .boot-actions {
            opacity: 0;
        }

        #bootScreen.boot-screen--menu .boot-scene::after {
            opacity: 0.55;
        }

        #bootScreen.boot-screen--entering .boot-scene {
            transform: scale(1.14);
        }

        #bootScreen.boot-screen--blackout .boot-blackout {
            opacity: 1;
        }

        .boot-scene {
            position: absolute;
            inset: 0;
            background: radial-gradient(circle at 50% 18%, rgba(10, 12, 16, 0.45), transparent 60%), url('/preload_screen.webp') center / cover no-repeat;
            transform-origin: 50% 68%;
            transition: transform 1s ease;
            pointer-events: none;
            z-index: 1;
            animation: bootSceneGlow 18s ease-in-out infinite alternate;
        }

        .boot-scene::before {
            content: '';
            position: absolute;
            inset: 0;
            background: radial-gradient(circle at 22% 34%, rgba(255, 166, 72, 0.18), transparent 62%), radial-gradient(circle at 78% 34%, rgba(255, 166, 72, 0.18), transparent 62%);
            mix-blend-mode: screen;
            opacity: 0.7;
            pointer-events: none;
            animation: bootFirelight 5.2s ease-in-out infinite alternate;
        }

        .boot-scene::after {
            content: '';
            position: absolute;
            inset: 0;
            background: radial-gradient(circle at 50% 70%, rgba(0, 0, 0, 0) 0%, rgba(4, 5, 7, 0.4) 68%), linear-gradient(180deg, rgba(8, 8, 12, 0.15) 0%, rgba(6, 7, 9, 0.7) 100%);
            opacity: 0.38;
            transition: opacity 0.5s ease;
            pointer-events: none;
        }

        .boot-blackout {
            position: absolute;
            inset: 0;
            background: #000;
            opacity: 0;
            transition: opacity 0.6s ease;
            pointer-events: none;
            z-index: 5;
        }

        .boot-ui {
            position: relative;
            z-index: 4;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 24px;
            width: 100%;
            max-width: 480px;
        }

        .boot-text {
            font-size: clamp(1.1rem, 2.8vw, 1.6rem);
            margin-top: 0;
            letter-spacing: 0.12em;
            text-transform: uppercase;
            text-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
            transition: opacity 0.4s ease;
        }

        .boot-actions {
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, calc(-50% + 16px));
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.5s ease, transform 0.5s ease;
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: clamp(8px, 1.4vh, 14px);
            width: clamp(156px, 30vw, 188px);
            z-index: 3;
            filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.55));
        }

        .boot-actions--visible {
            opacity: 1;
            transform: translate(-50%, -50%);
            pointer-events: auto;
        }

        .boot-actions--fading {
            opacity: 0;
            transform: translate(-50%, calc(-50% - 12px));
            pointer-events: none;
        }

        .boot-actions .button-empty2 {
            position: relative;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            margin: 0;
            font-size: clamp(0.54rem, 0.95vw, 0.7rem);
            letter-spacing: 0.025em;
            text-transform: uppercase;
            --button-empty2-scale: 0.142;
            --button-empty2-inline: 0.96;
            --button-empty2-block: 1.48;
            backdrop-filter: blur(1px);
            white-space: nowrap;
        }

        .boot-actions #bootConnectBtn.button-empty2 {
            --button-empty2-scale: 0.154;
            --button-empty2-inline: 1.02;
            --button-empty2-block: 1.58;
        }

        .boot-torch {
            position: absolute;
            top: clamp(20%, 26vh, 32%);
            width: clamp(120px, 20vw, 220px);
            height: clamp(180px, 28vw, 260px);
            pointer-events: none;
            z-index: 2;
        }

        .boot-torch--left {
            left: clamp(5%, 12vw, 18%);
        }

        .boot-torch--right {
            right: clamp(5%, 12vw, 18%);
        }

        .boot-torch__light {
            position: absolute;
            left: 50%;
            bottom: 24%;
            transform: translateX(-50%);
            border-radius: 50%;
            mix-blend-mode: screen;
        }

        .boot-torch__light--inner {
            width: 68%;
            height: 68%;
            background: radial-gradient(circle, rgba(255, 210, 150, 0.68) 0%, rgba(255, 140, 24, 0.4) 52%, rgba(255, 120, 0, 0) 100%);
            filter: blur(6px);
            animation: bootTorchPulse 1.7s ease-in-out infinite alternate;
        }

        .boot-torch__light--outer {
            width: 120%;
            height: 120%;
            background: radial-gradient(circle, rgba(255, 118, 8, 0.24) 0%, rgba(255, 118, 8, 0.08) 55%, rgba(255, 118, 8, 0) 100%);
            filter: blur(22px);
            opacity: 0.85;
            animation: bootTorchPulse 2.4s ease-in-out infinite alternate;
        }

        .boot-torch__embers {
            position: absolute;
            left: 50%;
            bottom: calc(var(--boot-torch-anchor-y, 58%) + var(--boot-torch-ember-lift, 10%));
            width: 100%;
            height: 100%;
            transform: translateX(-50%);
        }

        .boot-torch__embers span {
            position: absolute;
            left: 50%;
            bottom: 0;
            width: clamp(3px, 1vw, 6px);
            height: clamp(3px, 1vw, 6px);
            background: rgba(255, 220, 160, 0.9);
            border-radius: 50%;
            opacity: 0;
            transform: translate(-50%, 0) scale(0.4);
            animation: bootEmberRise 3.6s linear infinite;
            mix-blend-mode: screen;
            --drift: 0px;
            --rise: -170px;
        }

        .boot-torch__embers span:nth-child(odd) {
            background: rgba(255, 196, 120, 0.92);
        }

        .boot-torch__embers span:nth-child(1) {
            animation-delay: 0s;
            animation-duration: 3.4s;
            --drift: -12px;
        }

        .boot-torch__embers span:nth-child(2) {
            animation-delay: 0.8s;
            animation-duration: 3.2s;
            --drift: 10px;
        }

        .boot-torch__embers span:nth-child(3) {
            animation-delay: 1.6s;
            animation-duration: 3.8s;
            --drift: -6px;
        }

        .boot-torch__embers span:nth-child(4) {
            animation-delay: 2.4s;
            animation-duration: 3.3s;
            --drift: 6px;
        }

        .boot-torch__embers span:nth-child(5) {
            animation-delay: 1.1s;
            animation-duration: 3.5s;
            --drift: -3px;
        }

        .boot-torch__embers span:nth-child(6) {
            animation-delay: 2s;
            animation-duration: 3.9s;
            --drift: 14px;
        }

        .boot-torch__embers span:nth-child(7) {
            animation-delay: 2.8s;
            animation-duration: 3.7s;
            --drift: -15px;
        }

        .boot-torch__embers span:nth-child(8) {
            animation-delay: 3.4s;
            animation-duration: 3.4s;
            --drift: 4px;
        }

        @media (min-aspect-ratio: 16/9) and (min-width: 960px) {
            #bootScreen {
                background-image:
                    radial-gradient(160% 150% at 50% 28%, rgba(102, 58, 26, 0.7) 0%, rgba(30, 22, 35, 0.96) 62%, rgba(9, 8, 14, 0.99) 100%),
                    radial-gradient(120% 130% at 18% 48%, rgba(136, 86, 40, 0.34) 0%, rgba(30, 22, 35, 0.85) 60%, transparent 100%),
                    radial-gradient(120% 130% at 82% 48%, rgba(136, 86, 40, 0.34) 0%, rgba(30, 22, 35, 0.85) 60%, transparent 100%);
            }

            #bootScreen::before {
                opacity: 0.55;
                filter: blur(52px) saturate(1.12);
                transform: scale(1.06);
            }

            .boot-scene {
                background-size: auto 100%;
                background-position: center;
            }

            .boot-torch {
                width: clamp(110px, 18vh, 200px);
                height: clamp(170px, 26vh, 240px);
            }

            .boot-torch__light--inner {
                filter: blur(5px);
            }

            .boot-torch__light--outer {
                filter: blur(18px);
                opacity: 0.92;
            }

            .boot-torch__embers {
                --boot-torch-ember-lift: 14%;
            }

            .boot-actions {
                top: 50%;
                width: clamp(128px, 18vw, 148px);
            }
        }

        @keyframes bootSceneGlow {
            0% {
                filter: brightness(0.92) saturate(1.02);
            }

            50% {
                filter: brightness(1) saturate(1.06);
            }

            100% {
                filter: brightness(0.95) saturate(1);
            }
        }

        @keyframes bootFirelight {
            0% {
                opacity: 0.58;
                transform: scale(1);
            }

            50% {
                opacity: 0.82;
                transform: scale(1.015);
            }

            100% {
                opacity: 0.58;
                transform: scale(1);
            }
        }

        @keyframes bootTorchPulse {
            0% {
                opacity: 0.6;
                transform: translateX(-50%) scale(0.96);
            }

            100% {
                opacity: 0.9;
                transform: translateX(-50%) scale(1.05);
            }
        }

        @keyframes bootEmberRise {
            0% {
                transform: translate(-50%, 0) scale(0.4);
                opacity: 0;
            }

            15% {
                opacity: 1;
            }

            100% {
                transform: translate(calc(-50% + var(--drift)), var(--rise)) scale(0.05);
                opacity: 0;
            }
        }

        @media (max-width: 768px) {
            #bootScreen {
                padding: clamp(20px, 10vh, 48px) clamp(16px, 8vw, 52px) clamp(28px, 14vh, 72px);
            }

            .boot-actions {
                top: 53%;
            }

            .boot-torch {
                top: clamp(24%, 32vh, 38%);
            }

            .boot-torch__embers span {
                --rise: -120px;
            }
        }

        @media (prefers-reduced-motion: reduce) {
            #bootScreen {
                transition: none;
            }

            .boot-scene,
            .boot-scene::before,
            .boot-torch__light,
            .boot-torch__embers span,
            .boot-actions,
            .boot-menu,
            .boot-blackout {
                animation: none !important;
                transition: none !important;
            }
        }

        #loadingScreen {
            justify-content: center;
            padding: 20px;
            background: #000;
            opacity: 0;
            transition: opacity 0.5s ease;
        }

        #loadingText {
            font-size: 1.5rem;
            margin-top: 20px;
            transition: opacity 0.4s ease;
        }

        #bootMenu {
            margin-top: 0;
            padding: 28px 32px;
            background: linear-gradient(180deg, rgba(34, 20, 11, 0.94) 0%, rgba(12, 7, 3, 0.94) 100%);
            border: 2px solid rgba(243, 188, 93, 0.55);
            border-radius: 18px;
            box-shadow: 0 20px 45px rgba(0, 0, 0, 0.65);
            max-width: 420px;
            width: min(90%, 420px);
            display: none;
            flex-direction: column;
            align-items: center;
            gap: 18px;
            text-align: center;
            transform: translateY(24px) scale(0.94);
            opacity: 0;
            transition: transform 0.45s ease, opacity 0.45s ease;
        }

        #bootMenu.show {
            transform: translateY(0) scale(1);
            opacity: 1;
        }

        .boot-menu__message {
            margin: 0;
            font-size: 1.1rem;
            line-height: 1.5;
            color: #f3d7a0;
            text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
        }

        .boot-menu__message-secondary {
            display: block;
            margin-top: 14px;
        }

        .boot-menu__button {
            min-width: 140px;
        }

        #vsScreen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: none;
            overflow: hidden;
            z-index: 150;
            background: transparent;
        }

        #vsScreen.closed {
            background: radial-gradient(circle at center, rgba(0,0,0,0.8) 0%, #000 80%);
        }

        .vs-side {
            position: absolute;
            top: 0;
            width: 100%;
            height: 100%;
            display: flex;
            font-size: 3rem;
            font-weight: 900;
            text-transform: uppercase;
            letter-spacing: 2px;
            color: #fff;
            text-shadow: 0 0 15px rgba(255,255,255,0.8);
            transition: transform 0.8s ease-in-out;
            background-size: 300% 300%;
            animation: side-glow 4s ease infinite;
            overflow: hidden;
        }

        .vs-side > span {
            position: relative;
            z-index: 2;
        }

        .vs-side::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: radial-gradient(circle, rgba(255,255,255,0.2), transparent 70%);
            pointer-events: none;
        }

        .vs-left {
            left: 0;
            background: linear-gradient(135deg, #002244, #0055ff, #00e0ff, #002244);
            box-shadow: inset -10px 0 30px rgba(0,0,0,0.6), 0 0 30px rgba(0,224,255,0.4);
            transform: translateX(-100%);
            clip-path: polygon(0 0, 100% 0, 0 100%);
            justify-content: flex-start;
            align-items: flex-start;
            padding: 10% 0 0 10%;
        }

        .vs-right {
            right: 0;
            background: linear-gradient(-135deg, #440000, #ff0044, #ff7700, #440000);
            box-shadow: inset 10px 0 30px rgba(0,0,0,0.6), 0 0 30px rgba(255,0,0,0.4);
            transform: translateX(100%);
            clip-path: polygon(100% 0, 100% 100%, 0 100%);
            justify-content: flex-end;
            align-items: flex-end;
            padding: 0 10% 10% 0;
        }

        #vsScreen.closed #vsLeft {
            transform: translateX(0);
        }

        #vsScreen.closed #vsRight {
            transform: translateX(0);
        }

        .vs-divider {
            display: none;
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 5;
        }

        .vs-divider canvas {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
        }

        #vsScreen.closed .vs-divider {
            display: block;
        }


        #vsScreen .vs-text {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(0.5);
            font-size: 6rem;
            font-weight: 900;
            background: linear-gradient(45deg, #ffffff, #ffd700, #ff00ff);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            text-shadow: 0 0 30px #fff, 0 0 60px #ff0;
            z-index: 10;
            opacity: 0;
            pointer-events: none;
        }

        #vsScreen .vs-text.show {
            animation: vs-flash-in 0.4s forwards;
        }

        #vsScreen .vs-text.explode {
            animation: vs-flash-out 0.4s forwards;
        }

        #vsScreen.explode .vs-burst {
            display: block;
        }

        .vs-burst {
            position: absolute;
            top: 50%;
            left: 50%;
            width: 0;
            height: 0;
            pointer-events: none;
            display: none;
            z-index: 20;
            perspective: 600px;
        }

        .vs-burst span {
            position: absolute;
            top: 0;
            left: 0;
            width: var(--size, 10px);
            height: var(--size, 10px);
            background: radial-gradient(circle, #fff, #ffd700 40%, rgba(255,255,255,0) 70%);
            border-radius: 50%;
            box-shadow: 0 0 8px #fff, 0 0 16px #ffd700;
            opacity: 0;
            filter: blur(var(--blur, 0));
        }

        .vs-burst span::before,
        .vs-burst span::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 200%;
            height: 2px;
            background: linear-gradient(to right, transparent, #fff, transparent);
            transform: translate(-50%, -50%);
        }

        .vs-burst span::after {
            transform: translate(-50%, -50%) rotate(90deg);
        }

        #vsScreen.explode .vs-burst span {
            animation: burst 1s forwards, twinkle 1s ease-in-out forwards;
            animation-delay: calc(0.02s * var(--i)), calc(0.02s * var(--i));
            opacity: 1;
        }

        .vs-burst span:nth-child(1)  { --x: -80px; --y: -40px; --i: 1; }
        .vs-burst span:nth-child(2)  { --x: -60px; --y: 40px;  --i: 2; }
        .vs-burst span:nth-child(3)  { --x: 0px;   --y: -80px; --i: 3; }
        .vs-burst span:nth-child(4)  { --x: 80px;  --y: 30px;  --i: 4; }
        .vs-burst span:nth-child(5)  { --x: 50px;  --y: -50px; --i: 5; }
        .vs-burst span:nth-child(6)  { --x: -40px; --y: -70px; --i: 6; }
        .vs-burst span:nth-child(7)  { --x: 70px;  --y: 60px;  --i: 7; }
        .vs-burst span:nth-child(8)  { --x: -90px; --y: 50px;  --i: 8; }
        .vs-burst span:nth-child(9)  { --x: 20px;  --y: 80px;  --i: 9; }
        .vs-burst span:nth-child(10) { --x: -20px; --y: 90px;  --i: 10; }
        .vs-burst span:nth-child(11) { --x: 95px;  --y: -20px; --i: 11; }
        .vs-burst span:nth-child(12) { --x: -70px; --y: 80px;  --i: 12; }
        .vs-burst span:nth-child(13) { --x: 60px;  --y: -80px; --i: 13; }
        .vs-burst span:nth-child(14) { --x: -100px; --y: -10px; --i: 14; }
        .vs-burst span:nth-child(15) { --x: 100px; --y: 10px;  --i: 15; }
        .vs-burst span:nth-child(16) { --x: -50px; --y: 60px;  --i: 16; }
        .vs-burst span:nth-child(17) { --x: 40px;  --y: -60px; --i: 17; }
        .vs-burst span:nth-child(18) { --x: -30px; --y: -90px; --i: 18; }
        .vs-burst span:nth-child(19) { --x: 90px;  --y: -70px; --i: 19; }
        .vs-burst span:nth-child(20) { --x: -90px; --y: 30px;  --i: 20; }

        .vs-burst span:nth-child(odd) { --size: 12px; }
        .vs-burst span:nth-child(even) { --size: 8px; --blur: 1px; }
        .vs-burst span:nth-child(4n+1) { --rot: 0deg; }
        .vs-burst span:nth-child(4n+2) { --rot: 45deg; }
        .vs-burst span:nth-child(4n+3) { --rot: 90deg; }
        .vs-burst span:nth-child(4n)   { --rot: 135deg; }

        @keyframes vs-flash-in {
            0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
            60% { opacity: 1; transform: translate(-50%, -50%) scale(1.3); text-shadow: 0 0 60px #fff, 0 0 90px #ff0; }
            100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
        }

        @keyframes vs-flash-out {
            0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
            100% { opacity: 0; transform: translate(-50%, -50%) scale(1.3); }
        }

        @keyframes burst {
            0% {
                transform: translate(-50%, -50%) translate(0, 0) rotate(var(--rot)) scale(0);
                opacity: 0;
            }
            40% {
                transform: translate(-50%, -50%) translate(var(--x), var(--y)) rotate(var(--rot)) scale(1);
                opacity: 1;
            }
            100% {
                transform: translate(-50%, -50%) translate(calc(var(--x) * 1.3), calc(var(--y) * 1.3)) rotate(var(--rot)) scale(0);
                opacity: 0;
            }
        }

        @keyframes twinkle {
            0%, 100% { filter: blur(var(--blur, 0)) brightness(1); }
            50% { filter: blur(var(--blur, 0)) brightness(1.6); }
        }

        @keyframes side-glow {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }

        .vs-particles {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            overflow: hidden;
            pointer-events: none;
            z-index: 1;
        }

        .vs-particles span {
            position: absolute;
            width: 30px;
            height: 3px;
            box-shadow: 0 0 10px #fff, 0 0 20px #ff0;
            opacity: 0.9;
            animation-duration: 1s;
            animation-timing-function: linear;
            animation-iteration-count: infinite;
            animation-delay: calc(-0.05s * var(--i));
        }

        .vs-left .vs-particles span {
            background: linear-gradient(to left, rgba(255,255,255,0), #fff);
            animation-name: particle-left;
        }

        .vs-right .vs-particles span {
            background: linear-gradient(to right, rgba(255,255,255,0), #fff);
            animation-name: particle-right;
        }

        .vs-particles span:nth-child(1) { top: 10%; left: 20%; --i: 1; }
        .vs-particles span:nth-child(2) { top: 30%; left: 70%; --i: 2; }
        .vs-particles span:nth-child(3) { top: 60%; left: 40%; --i: 3; }
        .vs-particles span:nth-child(4) { top: 80%; left: 10%; --i: 4; }
        .vs-particles span:nth-child(5) { top: 20%; left: 80%; --i: 5; }
        .vs-particles span:nth-child(6) { top: 40%; left: 15%; --i: 6; }
        .vs-particles span:nth-child(7) { top: 75%; left: 55%; --i: 7; }
        .vs-particles span:nth-child(8) { top: 50%; left: 90%; --i: 8; }
        .vs-particles span:nth-child(9) { top: 15%; left: 50%; --i: 9; }
        .vs-particles span:nth-child(10) { top: 65%; left: 25%; --i: 10; }
        .vs-particles span:nth-child(11) { top: 35%; left: 60%; --i: 11; }
        .vs-particles span:nth-child(12) { top: 85%; left: 80%; --i: 12; }
        .vs-particles span:nth-child(13) { top: 5%; left: 30%; --i: 13; }
        .vs-particles span:nth-child(14) { top: 55%; left: 5%; --i: 14; }
        .vs-particles span:nth-child(15) { top: 25%; left: 95%; --i: 15; }
        .vs-particles span:nth-child(16) { top: 30%; left: 10%; --i: 16; }
        .vs-particles span:nth-child(17) { top: 70%; left: 45%; --i: 17; }
        .vs-particles span:nth-child(18) { top: 25%; left: 60%; --i: 18; }
        .vs-particles span:nth-child(19) { top: 85%; left: 20%; --i: 19; }
        .vs-particles span:nth-child(20) { top: 40%; left: 85%; --i: 20; }
        .vs-particles span:nth-child(21) { top: 5%; left: 65%; --i: 21; }
        .vs-particles span:nth-child(22) { top: 55%; left: 35%; --i: 22; }
        .vs-particles span:nth-child(23) { top: 15%; left: 5%; --i: 23; }
        .vs-particles span:nth-child(24) { top: 95%; left: 50%; --i: 24; }
        .vs-particles span:nth-child(25) { top: 45%; left: 75%; --i: 25; }
        .vs-particles span:nth-child(26) { top: 65%; left: 15%; --i: 26; }
        .vs-particles span:nth-child(27) { top: 10%; left: 90%; --i: 27; }
        .vs-particles span:nth-child(28) { top: 35%; left: 30%; --i: 28; }
        .vs-particles span:nth-child(29) { top: 80%; left: 60%; --i: 29; }
        .vs-particles span:nth-child(30) { top: 50%; left: 5%; --i: 30; }

        @keyframes particle-left {
            0% { transform: translateX(0); opacity: 1; }
            100% { transform: translateX(-200px); opacity: 0; }
        }

        @keyframes particle-right {
            0% { transform: translateX(0); opacity: 1; }
            100% { transform: translateX(200px); opacity: 0; }
        }

        .coin {
            width: 60px;
            height: 60px;
            margin-top: 20px;
            position: relative;
            border-radius: 50%;
            transform-style: preserve-3d;
            box-shadow: 0 4px 6px rgba(0,0,0,0.3);
        }

        .coin .side {
            position: absolute;
            width: 100%;
            height: 100%;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 30px;
            font-weight: bold;
            line-height: 60px;
            color: #6b4f1d;
            text-shadow: 0 1px 0 #ffd700, 0 -1px 0 #b8860b;
            background: radial-gradient(circle at 30% 30%, #fff8d6 0%, #ffd700 30%, #b8860b 70%);
            backface-visibility: hidden;
            transform: translateZ(3px);
        }

        .coin::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border-radius: 50%;
            background: #b8860b;
            transform: translateZ(-3px);
        }

        .coin .mark {
            display: inline-block;
            transform: translateY(-2px);
        }

        .coin .tails {
            transform: rotateY(180deg);
        }

        .coin.flip-heads {
            animation: flip-heads 1s ease-in-out forwards;
        }

        .coin.flip-tails {
            animation: flip-tails 1s ease-in-out forwards;
        }

        @keyframes pulse {
            0% { transform: scale(1); }
            50% { transform: scale(1.05); }
            100% { transform: scale(1); }
        }

        @keyframes flip-heads {
            from { transform: rotateY(0); }
            to { transform: rotateY(720deg); }
        }

        @keyframes flip-tails {
            from { transform: rotateY(0); }
            to { transform: rotateY(900deg); }
        }

        .instructions {
            background: rgba(255,255,255,0.05);
            padding: 20px;
            border-radius: 10px;
            margin: 20px 0;
            border-left: 4px solid #4ecdc4;
        }

        .grid-2 {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
        }



        .foil-effect {
            position: relative;
            overflow: hidden;
        }

        .foil-effect::before,
        .foil-effect::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
        }

        /* fine reflective texture */
        .foil-effect::before {
            background: repeating-linear-gradient(45deg,
                    rgba(255,255,255,0.4) 0px,
                    rgba(255,255,255,0) 4px);
            mix-blend-mode: overlay;
            opacity: 0.3;
        }

        /* moving rainbow sheen */
        .foil-effect::after {
            background: linear-gradient(115deg,
                    rgba(255,0,0,0.4),
                    rgba(255,255,0,0.4),
                    rgba(0,255,0,0.4),
                    rgba(0,255,255,0.4),
                    rgba(0,0,255,0.4),
                    rgba(255,0,255,0.4),
                    rgba(255,0,0,0.4));
            background-size: 400% 400%;
            mix-blend-mode: color-dodge;
            animation: foil-shine 6s linear infinite;
            opacity: 0.6;
        }

        @keyframes foil-shine {
            0% { background-position: 0% 0%; }
            50% { background-position: 100% 100%; }
            100% { background-position: 0% 0%; }
        }

        @keyframes power-glow-offense {
            0% { box-shadow: 0 0 0 0 rgba(255, 0, 0, 0); }
            50% { box-shadow: 0 0 20px 6px rgba(255, 0, 0, 0.8); }
            100% { box-shadow: 0 0 0 0 rgba(255, 0, 0, 0); }
        }

        @keyframes power-glow-defense {
            0% { box-shadow: 0 0 0 0 rgba(0, 0, 255, 0); }
            50% { box-shadow: 0 0 20px 6px rgba(0, 0, 255, 0.8); }
            100% { box-shadow: 0 0 0 0 rgba(0, 0, 255, 0); }
        }

        @keyframes power-particle {
            from { transform: translateY(0) scale(1); opacity: 1; }
            to { transform: translateY(-20px) scale(0); opacity: 0; }
        }

        .card-container.powerup-offense {
            animation: power-glow-offense 0.8s ease-out;
            position: relative;
        }

        .card-container.powerup-defense {
            animation: power-glow-defense 0.8s ease-out;
            position: relative;
        }

        .powerup-particles {
            position: absolute;
            inset: 0;
            pointer-events: none;
            overflow: visible;
        }

        .powerup-particles span {
            position: absolute;
            width: 6px;
            height: 6px;
            border-radius: 50%;
            animation: power-particle 0.8s ease-out forwards;
        }

        .powerup-particles.offense span {
            background: rgba(255, 0, 0, 0.9);
        }

        .powerup-particles.defense span {
            background: rgba(0, 0, 255, 0.9);
        }

        @media (max-width: 768px) {
            #endTurnBtn {
                bottom: auto;
            }
            .battle-container {
                --table-scale-x: 1.5;
                --arena-padding-block: clamp(20px, 5vh, 36px);
                --arena-translate-y: -25%;
            }

            .battle-container.bird-view {
                --arena-translate-y: calc(-25% + 40px);
                --hand-translate-y: 80px;
            }

            .battle-arena {
                height: 50vh;
                gap: 0;
            }

            .battle-arena::before {
                top: 50%;
                width: 100%;
                height: 100%;
                background-size: 100% 100%;
            }

            .hand-log-container {
                flex-direction: column;
                align-items: stretch;
            }

            .vs-section {
                order: -1;
            }

            #vsScreen .vs-side {
                font-size: 6vw;
            }

            #vsPlayer,
            #vsOpponent {
                position: absolute;
                max-width: 45%;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
            }

            #vsPlayer {
                top: 25%;
                left: 5%;
            }

            #vsOpponent {
                bottom: 25%;
                right: 5%;
                text-align: right;
            }

            #vsScreen .vs-left,
            #vsScreen .vs-right {
                padding: 0;
            }

            .grid-2 {
                grid-template-columns: 1fr;
            }

            .logo {
                font-size: 2rem;
            }

            .card-display {
                flex: 0 0 50%;
                width: 90%;
                margin: 0 auto;
                padding: 0;
            }

            .card-display.player1,
            .card-display.player2 {
                justify-content: center;
            }

            #playerLabel,
            #opponentLabel {
                display: none;
            }

        .card-row {
            gap: 5px;
        }

        .card-slot {
            width: 24vw;
            height: 36vw;
            max-width: 96px;
            max-height: 144px;
        }

        .card-display.player1::before,
        .card-display.player2::before {
            width: 100%;
            height: 100%;
            box-sizing: border-box;
        }

        .battle-controls {
            right: clamp(12px, 9vw, 48px);
            bottom: clamp(18px, 10vw, 64px);
            gap: 10px;
            align-items: flex-end;
        }
        }

        .tutorial-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 2000;
        }

        .tutorial-bubble {
            position: absolute;
            top: 20px;
            bottom: auto;
            left: 50%;
            transform: translate(-50%, 0);
            max-width: 420px;
            font-size: 1.25rem;
            line-height: 1.4;
            pointer-events: auto;
            display: flex;
            flex-direction: column;
        }

        .tutorial-bubble.small-menu-panel {
            align-items: flex-start;
            text-align: left;
        }

        .tutorial-bubble p {
            white-space: pre-line;
            margin: 0;
        }

        @media (max-width: 768px) {
            .tutorial-bubble {
                max-width: 95%;
            }
        }

        @media (min-width: 769px) {
            .tutorial-bubble {
                top: 50%;
                bottom: auto;
                left: 5%;
                transform: translateY(-50%);
            }
        }

        .tutorial-next-btn {
            margin-top: 10px;
            background: #4ecdc4;
            border: none;
            border-radius: 5px;
            padding: 5px 12px;
            color: #000;
            font-weight: bold;
            cursor: pointer;
            align-self: flex-end;
        }

        .tutorial-glow {
            animation: tutorial-glow 1s ease-in-out infinite;
            transform-origin: center;
        }

        @keyframes tutorial-glow {
            0%, 100% {
                transform: scale(1);
                filter: drop-shadow(0 0 0 #ff0);
            }
            50% {
                transform: scale(1.05);
                filter: drop-shadow(0 0 8px #ff0);
            }
        }

        .tutorial-flash {
            animation: tutorial-flash 0.3s ease-in-out 2;
            transform-origin: center;
        }

        @keyframes tutorial-flash {
            0%, 100% {
                transform: scale(1);
                filter: drop-shadow(0 0 0 rgba(255,255,0,0));
            }
            50% {
                transform: scale(1.1);
                filter: drop-shadow(0 0 6px rgba(255,255,0,0.8));
            }
        }

        .tutorial-glow-field {
            animation: tutorial-glow-field 0.8s ease-in-out infinite;
        }

        @keyframes tutorial-glow-field {
            0%, 100% {
                transform: scale(1);
                filter: drop-shadow(0 0 0 #ff0);
            }
            50% {
                transform: scale(1.1);
                filter: drop-shadow(0 0 16px #ff0);
            }
        }

        .tutorial-glow-field-static {
            animation: tutorial-glow-field-static 0.8s ease-in-out infinite;
        }

        @keyframes tutorial-glow-field-static {
            0%, 100% {
                filter: drop-shadow(0 0 0 #ff0);
            }
            50% {
                filter: drop-shadow(0 0 16px #ff0);
            }
        }

        .tutorial-flash-field {
            animation: tutorial-flash-field 0.3s ease-in-out 2;
        }

        @keyframes tutorial-flash-field {
            0%, 100% {
                filter: drop-shadow(0 0 0 rgba(255,255,0,0));
            }
            50% {
                filter: drop-shadow(0 0 6px rgba(255,255,0,0.8));
            }
        }

