        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
            -webkit-touch-callout: none;
            -webkit-user-select: none;
            user-select: none;
        }

        body {
            background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            font-family: 'MS Gothic', 'Courier New', monospace;
            color: #fff;
            overflow: hidden;
            touch-action: none;
        }

        #gameContainer {
            position: relative;
            text-align: center;
            width: 100%;
            max-width: 480px;
            height: 100vh;
            max-height: 640px;
        }

        canvas {
            border: 3px solid #d4af37;
            background: linear-gradient(180deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
            box-shadow: 0 0 30px rgba(212, 175, 55, 0.5);
            display: block;
            margin: 0 auto;
            width: 100%;
            height: auto;
            max-width: 480px;
        }

        .mobile-mode #gameContainer {
            max-width: 100vw;
            max-height: 100vh;
        }

        .mobile-mode canvas {
            border-width: 2px;
        }

        #info {
            margin-top: 5px;
            font-size: 16px;
            color: #d4af37;
            text-shadow: 0 0 10px rgba(212, 175, 55, 0.8);
            margin-bottom: 10px;
        }

        .screen {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            align-items: center;
            background: rgba(0, 0, 0, 0.95);
            z-index: 10;
            overflow-y: auto;
            padding: 30px 20px;
        }

        #levelScreen {
            overflow-x: hidden;
        }

        .mobile-mode .screen {
            padding: 20px 10px;
        }

        .hidden {
            display: none !important;
        }

        h1 {
            color: #d4af37;
            font-size: 40px;
            margin-top: 0;
            margin-bottom: 5px;
            text-shadow: 0 0 20px rgba(212, 175, 55, 1);
            animation: glow 2s ease-in-out infinite;
        }

        #levelScreen h1 {
            font-size: clamp(32px, 8vw, 40px);
        }

        .mobile-mode h1 {
            font-size: 24px;
        }

        @keyframes glow {

            0%,
            100% {
                text-shadow: 0 0 20px rgba(212, 175, 55, 1);
            }

            50% {
                text-shadow: 0 0 40px rgba(212, 175, 55, 1), 0 0 60px rgba(212, 175, 55, 0.8);
            }
        }

        h2 {
            color: #ff9800;
            font-size: 20px;
            margin-top: 0;
            margin-bottom: 20px;
            text-shadow: 0 0 10px rgba(255, 152, 0, 0.8);
        }

        .mobile-mode h2 {
            font-size: 14px;
            margin-bottom: 15px;
        }

        button {
            background: linear-gradient(135deg, #d4af37 0%, #aa8c2e 100%);
            border: none;
            color: #1a1a2e;
            padding: 12px 40px;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            border-radius: 5px;
            margin: 8px;
            transition: all 0.3s;
            box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4);
            min-height: 45px;
            min-width: 200px;
        }

        button:hover {
            transform: translateY(-2px);
            box-shadow: 0 7px 20px rgba(212, 175, 55, 0.6);
        }

        button:active {
            transform: translateY(0);
            box-shadow: 0 3px 10px rgba(212, 175, 55, 0.4);
        }

        .title-buttons {
            display: flex;
            flex-direction: column;
            gap: 15px;
            align-items: center;
            max-width: 420px;
            margin: 0 auto;
        }

        .title-buttons button {
            margin: 0;
        }

        .mobile-mode button {
            font-size: 14px;
            padding: 10px 30px;
            min-width: 160px;
        }

        p {
            margin: 8px 0;
            line-height: 1.5;
            font-size: 13px;
        }

        .instruction {
            background: rgba(212, 175, 55, 0.1);
            border: 2px solid #d4af37;
            border-radius: 10px;
            padding: 15px;
            margin: 15px 0;
            max-width: 400px;
        }

        .instruction p {
            color: #ffd700;
        }

        #rankingList {
            background: rgba(0, 0, 0, 0.5);
            border: 2px solid #d4af37;
            border-radius: 10px;
            padding: 20px;
            margin: 20px 0;
            max-width: 500px;
            width: 100%;
        }

        .rank-item {
            display: flex;
            justify-content: space-between;
            padding: 12px 20px;
            margin: 8px 0;
            background: linear-gradient(90deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.05));
            border-radius: 5px;
            border-left: 4px solid #d4af37;
        }

        .rank-item.top3 {
            background: linear-gradient(90deg, rgba(255, 215, 0, 0.3), rgba(212, 175, 55, 0.1));
            border-left: 4px solid #ffd700;
        }

        .rank-number {
            color: #d4af37;
            font-weight: bold;
            font-size: 18px;
            min-width: 40px;
        }

        .rank-score {
            color: #fff;
            font-size: 16px;
        }

        .rank-date {
            color: #888;
            font-size: 14px;
        }

        .title-logo {
            margin: 0 0 20px 0;
            font-size: inherit;
            font-weight: normal;
            animation: float 3s ease-in-out infinite;
        }

        .title-logo-img {
            width: 90%;
            max-width: 400px;
            height: auto;
            display: block;
            margin: 0 auto;
        }

        @keyframes float {

            0%,
            100% {
                transform: translateY(0px);
            }

            50% {
                transform: translateY(-10px);
            }
        }

        .subtitle {
            font-size: 18px;
            color: #ff6f00;
            margin-top: -15px;
            margin-bottom: 30px;
        }

        /* Title Intro */
        #titleScreen {
            overflow: hidden;
            padding: 0;
        }

        #titleMainContent {
            position: relative;
            z-index: 30;
            display: flex;
            flex-direction: column;
            align-items: center;
            width: 100%;
            height: 100%;
            padding: 30px 20px;
            box-sizing: border-box;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.5s ease;
        }

        #titleMainContent.intro-visible {
            opacity: 1;
            pointer-events: auto;
        }

        #titleIntroOverlay {
            position: absolute;
            inset: 0;
            z-index: 40;
            pointer-events: auto;
        }

        #titleIntroOverlay.intro-fadeout {
            opacity: 0;
            transition: opacity 0.22s ease;
        }

        .intro-black {
            position: absolute;
            inset: 0;
            background: #000;
        }

        .intro-skip-hint {
            position: absolute;
            right: 14px;
            bottom: 12px;
            color: #ffffff;
            font-size: 12px;
            letter-spacing: 0.08em;
            text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
            animation: introHintBlink 1.4s ease-in-out infinite;
            pointer-events: none;
        }

        @keyframes introHintBlink {

            0%,
            100% {
                opacity: 0.75;
            }

            50% {
                opacity: 1;
            }
        }

        .intro-message {
            position: absolute;
            opacity: 0;
            margin: 0;
            text-align: center;
        }

        .intro-message p {
            white-space: pre-line;
            text-shadow: none;
        }

        .intro-message.intro-active {
            animation: introMessageIn 0.45s ease-out forwards;
        }

        .intro-monk {
            position: absolute;
            bottom: 0;
            width: 112px;
            opacity: 0;
            filter: drop-shadow(0 0 10px rgba(255, 215, 120, 0.35));
            transform: translateY(30px) scale(0.92);
        }

        .intro-happy {
            left: 14px;
        }

        .intro-sad {
            right: 14px;
        }

        .intro-pray {
            left: 50%;
            transform: translateX(-50%) translateY(34px) scale(0.9);
        }

        .intro-happy.intro-active {
            animation: introHappyIn 0.45s ease-out forwards;
        }

        .intro-sad.intro-active {
            animation: introSadIn 0.45s ease-out forwards;
        }

        .intro-pray.intro-active {
            animation: introPrayIn 0.5s ease-out forwards;
        }

        @keyframes introHappyIn {
            from {
                opacity: 0;
                transform: translate(-18px, 34px) scale(0.88);
            }

            to {
                opacity: 1;
                transform: translate(0, 0) scale(1);
            }
        }

        @keyframes introSadIn {
            from {
                opacity: 0;
                transform: translate(18px, 34px) scale(0.88);
            }

            to {
                opacity: 1;
                transform: translate(0, 0) scale(1);
            }
        }

        @keyframes introPrayIn {
            from {
                opacity: 0;
                transform: translateX(-50%) translateY(36px) scale(0.86);
            }

            to {
                opacity: 1;
                transform: translateX(-50%) translateY(0) scale(1);
            }
        }

        @keyframes introMessageIn {
            from {
                opacity: 0;
                transform: translateY(8px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        #titlePersistentPray {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            z-index: 20;
            opacity: 0;
            transition: opacity 0.25s ease;
            pointer-events: none;
        }

        #titlePersistentPray img {
            width: 112px;
            display: block;
            filter: drop-shadow(0 0 10px rgba(255, 215, 120, 0.35));
            position: absolute;
            bottom: 0;
        }

        #titlePersistentPray .persistent-happy {
            left: 14px;
        }

        #titlePersistentPray .persistent-sad {
            right: 14px;
        }

        #titlePersistentPray .persistent-pray {
            left: 50%;
            transform: translateX(-50%);
        }

        #titlePersistentPray.visible {
            opacity: 1;
        }

        .mobile-mode .intro-monk,
        .mobile-mode #titlePersistentPray img {
            width: 90px;
            bottom: 80px;
        }

        .mobile-mode #titleMainContent {
            padding: 20px 10px;
        }

        .mobile-mode .intro-happy {
            left: 8px;
        }

        .mobile-mode .intro-sad {
            right: 8px;
        }

        .mobile-mode .intro-skip-hint {
            right: 10px;
            bottom: 10px;
            font-size: 11px;
        }

        .mobile-mode #titlePersistentPray .persistent-happy {
            left: 8px;
        }

        .mobile-mode #titlePersistentPray .persistent-sad {
            right: 8px;
        }

        #currentScore {
            font-size: 28px;
            color: #ffd700;
            margin: 20px 0;
            text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
        }

        .level-buttons {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 15px;
            margin: 20px 0;
            width: 100%;
            max-width: 420px;
            justify-items: stretch;
        }

        .level-btn {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 18px 12px;
            min-height: 100px;
            justify-content: center;
            background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
            border: 2px solid #d4af37;
            border-radius: 10px;
            color: #fff;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
            transition: all 0.3s ease;
            margin: 0;
            min-width: 0;
            width: 100%;
        }

        .level-btn:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
            border-color: #ffd700;
        }

        .level-name {
            font-size: 20px;
            margin-bottom: 5px;
            color: #d4af37;
            font-weight: bold;
        }

        .level-desc {
            font-size: 13px;
            opacity: 0.8;
            color: #ccc;
        }

        .level-lock {
            font-size: 12px;
            opacity: 0.6;
            margin-top: 5px;
            color: #888;
        }

        .level-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            filter: grayscale(100%);
            border-color: #555;
        }

        .level-btn:disabled:hover {
            transform: none;
            box-shadow: none;
        }

        #levelDemon {
            grid-column: 2;
            grid-row: 2;
            background: linear-gradient(135deg, #2c0e37 0%, #1a0520 100%);
            border-color: #9c27b0;
            animation: demonPulse 2s ease-in-out infinite;
        }

        #levelDemon .level-name {
            color: #e040fb;
        }

        #levelDemon:hover {
            box-shadow: 0 0 20px rgba(156, 39, 176, 0.6);
            border-color: #e040fb;
        }



        #levelDemon.hidden {
            display: none !important;
        }

        @keyframes demonPulse {

            0%,
            100% {
                box-shadow: 0 5px 15px rgba(156, 39, 176, 0.4);
            }

            50% {
                box-shadow: 0 5px 25px rgba(156, 39, 176, 0.8), 0 0 30px rgba(156, 39, 176, 0.5);
            }
        }

        /* パスワード入力モーダル */
        #passwordModal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.9);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 100;
        }

        .password-container {
            background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
            border: 3px solid #d4af37;
            border-radius: 15px;
            padding: 30px;
            max-width: 400px;
            width: 90%;
            box-shadow: 0 0 40px rgba(212, 175, 55, 0.6);
        }

        .password-container h2 {
            color: #d4af37;
            margin-bottom: 20px;
            text-align: center;
        }

        .password-container p {
            color: #ffd700;
            margin-bottom: 15px;
            text-align: center;
            font-size: 14px;
            line-height: 1.6;
        }

        .password-hint {
            color: #888;
            font-size: 12px;
            margin-top: 5px;
        }

        #passwordInput {
            width: 100%;
            padding: 12px;
            font-size: 18px;
            border: 2px solid #d4af37;
            border-radius: 5px;
            background: rgba(0, 0, 0, 0.5);
            color: #fff;
            text-align: center;
            font-family: 'MS Gothic', 'Courier New', monospace;
            margin-bottom: 20px;
        }

        #passwordInput:focus {
            outline: none;
            border-color: #ffd700;
            box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
        }

        .password-buttons {
            display: flex;
            gap: 10px;
            justify-content: center;
        }

        .password-buttons button {
            min-width: 120px;
        }

        #passwordMessage {
            text-align: center;
            margin-top: 15px;
            font-size: 14px;
            min-height: 20px;
        }

        #passwordMessage.success {
            color: #00ff88;
        }

        #passwordMessage.error {
            color: #ff6f00;
        }

        .unlock-btn {
            background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
            border: 2px solid #4caf50;
            color: #4caf50;
            box-shadow: 0 5px 15px rgba(76, 175, 80, 0.2);
            font-size: 16px;
            padding: 10px 30px;
            min-width: 180px;
            margin-top: 20px;
            border-radius: 25px;
            transition: all 0.3s ease;
        }

        .unlock-btn:hover {
            background: #4caf50;
            color: #fff;
            box-shadow: 0 0 20px rgba(76, 175, 80, 0.6);
        }

        /* Settings Modal */
        #settingsModal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.95);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 200;
        }

        .settings-container {
            background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
            border: 3px solid #d4af37;
            border-radius: 15px;
            padding: 30px;
            max-width: 450px;
            width: 90%;
            box-shadow: 0 0 50px rgba(212, 175, 55, 0.6);
            text-align: center;
        }

        .settings-container h2 {
            font-size: 28px;
            margin-bottom: 30px;
            border-bottom: 1px solid rgba(212, 175, 55, 0.3);
            padding-bottom: 15px;
        }

        .setting-group {
            margin-bottom: 25px;
            text-align: left;
        }

        .setting-label {
            color: #d4af37;
            font-size: 18px;
            margin-bottom: 10px;
            display: block;
        }

        .toggle-options {
            display: flex;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 30px;
            padding: 5px;
            position: relative;
        }

        .toggle-btn {
            flex: 1;
            border: none;
            background: transparent;
            color: #aaa;
            padding: 10px;
            font-size: 16px;
            cursor: pointer;
            border-radius: 25px;
            transition: all 0.3s;
            margin: 0;
            box-shadow: none;
            min-height: auto;
            min-width: auto;
        }

        .toggle-btn.active {
            background: #d4af37;
            color: #1a1a2e;
            font-weight: bold;
            box-shadow: 0 2px 10px rgba(212, 175, 55, 0.4);
        }

        .toggle-btn:hover:not(.active) {
            color: #fff;
            transform: none;
        }

        .settings-desc {
            font-size: 12px;
            color: #888;
            margin-top: 8px;
        }

        #settingsSubmitBtn {
            background: linear-gradient(135deg, #d4af37 0%, #aa8c2e 100%);
            width: 100%;
            margin-top: 20px;
            font-size: 20px;
            padding: 15px;
        }

        /* モバイル版での環境設定調整 */
        .mobile-mode .settings-container {
            padding: 20px 15px;
            max-width: 90%;
        }

        .mobile-mode .settings-container h2 {
            font-size: 22px;
            margin-bottom: 20px;
            padding-bottom: 10px;
        }

        .mobile-mode .setting-group {
            margin-bottom: 20px;
        }

        .mobile-mode .setting-label {
            font-size: 15px;
            margin-bottom: 8px;
        }

        .mobile-mode .toggle-btn {
            font-size: 13px;
            padding: 8px 6px;
        }

        .mobile-mode .settings-desc {
            font-size: 11px;
            margin-top: 6px;
        }

        .mobile-mode #settingsSubmitBtn {
            font-size: 18px;
            padding: 12px;
            margin-top: 15px;
        }

        /* 仮想コントローラー */
        #virtualControls {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 200px;
            z-index: 5;
            pointer-events: none;
            transition: opacity 0.5s ease;
        }

        #virtualControls.inactive {
            opacity: 0.2;
        }

        .control-btn {
            position: absolute;
            width: 80px;
            height: 80px;
            background: radial-gradient(circle, rgba(212, 175, 55, 0.6), rgba(212, 175, 55, 0.3));
            border: 3px solid rgba(212, 175, 55, 0.8);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 30px;
            color: #fff;
            text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
            pointer-events: auto;
            transition: all 0.1s;
            user-select: none;
        }

        .control-btn:active {
            background: radial-gradient(circle, rgba(212, 175, 55, 0.9), rgba(212, 175, 55, 0.5));
            transform: scale(0.95);
        }

        #leftBtn {
            bottom: 40px;
            left: 30px;
        }

        #rightBtn {
            bottom: 40px;
            left: 130px;
        }

        #shootBtn {
            bottom: 40px;
            right: 30px;
            width: 100px;
            height: 100px;
            font-size: 20px;
            background: radial-gradient(circle, rgba(255, 107, 0, 0.7), rgba(255, 107, 0, 0.4));
            border-color: rgba(255, 107, 0, 0.9);
        }

        #shootBtn:active {
            background: radial-gradient(circle, rgba(255, 107, 0, 0.95), rgba(255, 107, 0, 0.6));
        }

        /* Special Attack Button */
        #specialBtn {
            bottom: 150px;
            right: 30px;
            width: 100px;
            height: 100px;
            font-size: 16px;
            background: radial-gradient(circle, rgba(128, 128, 128, 0.5), rgba(128, 128, 128, 0.3));
            border-color: rgba(128, 128, 128, 0.8);
        }

        #specialBtn.ready {
            background: radial-gradient(circle, rgba(255, 0, 0, 0.8), rgba(255, 0, 0, 0.5));
            border-color: rgba(255, 0, 0, 1);
            animation: specialPulse 1s ease-in-out infinite;
        }

        #specialBtn.disabled {
            opacity: 0.3;
            pointer-events: none;
        }

        #specialBtn:active {
            background: radial-gradient(circle, rgba(255, 0, 0, 0.95), rgba(255, 0, 0, 0.7));
        }

        @keyframes specialPulse {

            0%,
            100% {
                box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
            }

            50% {
                box-shadow: 0 0 30px rgba(255, 0, 0, 1);
            }
        }

        /* Hide virtual controls on PC unless mobile mode is active */
        body:not(.mobile-mode) #virtualControls {
            display: none !important;
        }

        .mobile-mode .control-btn {
            width: 70px;
            height: 70px;
            font-size: 24px;
        }

        .mobile-mode #leftBtn {
            left: 20px;
            bottom: 30px;
        }

        .mobile-mode #rightBtn {
            left: 110px;
            bottom: 30px;
        }

        .mobile-mode #shootBtn {
            right: 20px;
            bottom: 30px;
            width: 85px;
            height: 85px;
            font-size: 16px;
            white-space: nowrap;
        }

        .mobile-mode #specialBtn {
            right: 20px;
            bottom: 130px;
            width: 85px;
            height: 85px;
            font-size: 14px;
        }

        /* Version Display */
        #version-display {
            position: absolute;
            bottom: 10px;
            right: 10px;
            font-size: 10px;
            color: rgba(212, 175, 55, 0.6);
            font-family: 'Courier New', monospace;
        }

        .mobile-mode #version-display {
            font-size: 8px;
            bottom: 5px;
            right: 5px;
        }

        .mode-toggle {
            margin-top: 15px;
            font-size: 12px;
            padding: 8px 16px;
            min-width: auto;
            background: rgba(212, 175, 55, 0.2);
            border: 1px solid #d4af37;
            box-shadow: none;
        }

        .mode-toggle {
            margin-top: 15px;
            font-size: 12px;
            padding: 8px 16px;
            min-width: auto;
            background: rgba(212, 175, 55, 0.2);
            border: 1px solid #d4af37;
            box-shadow: none;
        }

        #openSettingsBtn {
            position: absolute;
            top: 20px;
            right: 20px;
            background: transparent;
            border: none;
            color: #d4af37;
            font-size: 32px;
            padding: 0;
            margin: 0;
            width: auto;
            min-width: auto;
            min-height: auto;
            box-shadow: none;
            cursor: pointer;
            z-index: 20;
            text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
            transition: transform 0.5s ease;
        }

        #openSettingsBtn:hover {
            transform: rotate(90deg);
            text-shadow: 0 0 15px rgba(212, 175, 55, 0.8);
        }

        /* Share Buttons Container */
        .share-buttons {
            display: flex;
            justify-content: center;
            gap: 5px;
            margin-top: 10px;
            width: 100%;
        }

        #gameOverScreen button {
            width: 32%;
            max-width: none;
            margin: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            padding: 8px 0;
            min-width: 0;
            line-height: 1.2;
            white-space: nowrap;
        }

        /* X (Twitter) Share Button */
        .share-btn {
            background: linear-gradient(135deg, #1DA1F2 0%, #0d8bd9 100%);
            box-shadow: 0 5px 15px rgba(29, 161, 242, 0.4);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 4px;
            min-width: 0;
        }

        .share-btn:hover {
            box-shadow: 0 7px 20px rgba(29, 161, 242, 0.6);
        }

        .share-btn::before {
            content: '𝕏';
            font-size: 14px;
            font-weight: bold;
        }


        /* Result Image */
        /* Result Image */
        .result-image {
            max-width: 200px;
            margin: -20px auto;
            display: block;
            position: relative;
            position: relative;
            z-index: 1;
        }

        /* Result Stats Grid */
        .result-stats-container {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 10px;
            margin: 14px 0;
            width: 100%;
        }

        .stat-item {
            background: rgba(0, 0, 0, 0.3);
            padding: 10px 8px;
            border-radius: 10px;
            text-align: center;
            border: 2px solid rgba(212, 175, 55, 0.3);
            min-height: 80px;
        }

        .stat-label {
            font-size: 14px;
            color: #ccc;
            margin-bottom: 4px;
            white-space: nowrap;
        }

        .stat-value {
            font-size: 18px;
            color: #ffd700;
            font-weight: bold;
            line-height: 1.2;
        }

        /* 煩悩メッセージ表示 */
        #bonnouMessageContainer {
            position: fixed;
            top: calc((100vh - 640px) / 2);
            right: 20px;
            width: 260px;
            max-height: 640px;
            overflow-y: auto;
            z-index: 20;
            pointer-events: none;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .bonnou-message-item {
            background: rgba(0, 0, 0, 0.9);
            border: 2px solid #ff6f00;
            border-radius: 10px;
            padding: 12px 15px;
            text-align: left;
            animation: slideInRight 0.3s ease-out;
        }

        @keyframes slideInRight {
            from {
                transform: translateX(100%);
                opacity: 0;
            }

            to {
                transform: translateX(0);
                opacity: 1;
            }
        }

        .bonnou-title {
            font-size: 19px;
            color: #ff6f00;
            text-shadow: 0 0 10px rgba(255, 111, 0, 0.8);
            font-weight: bold;
            margin-bottom: 5px;
        }

        .bonnou-desc {
            font-size: 12px;
            color: #ffd700;
            line-height: 1.4;
        }

        /* Mobile: keep original centered display at top */
        .mobile-mode #bonnouMessageContainer {
            top: 10px;
            left: 50%;
            transform: translateX(-50%);
            right: auto;
            width: 90%;
            max-width: 350px;
        }

        .mobile-mode .bonnou-message-item {
            text-align: center;
        }

        .mobile-mode .bonnou-title {
            font-size: 18px;
        }

        .mobile-mode .bonnou-desc {
            font-size: 12px;
        }

        @keyframes shake {
            0% {
                transform: translate(0, 0);
            }

            10% {
                transform: translate(-5px, 0);
            }

            20% {
                transform: translate(5px, 0);
            }

            30% {
                transform: translate(-5px, 0);
            }

            40% {
                transform: translate(5px, 0);
            }

            50% {
                transform: translate(-3px, 0);
            }

            60% {
                transform: translate(3px, 0);
            }

            70% {
                transform: translate(-3px, 0);
            }

            80% {
                transform: translate(0, 0);
            }
        }

        .shake {
            animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
        }

        /* ToS & Tutorial Modals */
        .modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.95);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 300;
        }

        .modal-container {
            background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
            border: 3px solid #d4af37;
            border-radius: 15px;
            padding: 30px;
            max-width: 600px;
            width: 90%;
            max-height: 90vh;
            overflow-y: auto;
            text-align: center;
            color: #fff;
            box-shadow: 0 0 50px rgba(212, 175, 55, 0.6);
        }

        .modal-title {
            color: #d4af37;
            font-size: 28px;
            margin-bottom: 20px;
            border-bottom: 1px solid rgba(212, 175, 55, 0.3);
            padding-bottom: 10px;
        }

        .tos-content {
            text-align: left;
            margin-bottom: 20px;
            padding: 15px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 5px;
            border: 1px solid rgba(212, 175, 55, 0.3);
            height: 200px;
            overflow-y: scroll;
            font-size: 14px;
            line-height: 1.6;
        }

        /* Carousel Styles */
        .carousel-container {
            position: relative;
            width: 100%;
            padding-top: 100%;
            /* Enables square aspect ratio regardless of width */
            margin-bottom: 20px;
            background: #000;
            overflow: hidden;
            border: 1px solid rgba(212, 175, 55, 0.3);
            border-radius: 8px;
        }

        .carousel-slide {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: none;
        }

        .carousel-slide.active {
            display: block;
            animation: fadeIn 0.5s;
        }

        .carousel-controls {
            display: flex;
            justify-content: space-between;
            margin-top: 20px;
        }

        .carousel-dots {
            display: flex;
            justify-content: center;
            gap: 10px;
            margin-bottom: 20px;
        }

        .dot {
            width: 10px;
            height: 10px;
            background: rgba(255, 255, 255, 0.3);
            border-radius: 50%;
            cursor: pointer;
        }

        .dot.active {
            background: #d4af37;
        }

        .menu-btn {
            background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
            border: 2px solid #d4af37;
            color: #fff;
            padding: 12px;
            font-size: 16px;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s;
            width: 100%;
            text-align: center;
        }

        .menu-btn:hover {
            background: #d4af37;
            color: #1a1a2e;
            font-weight: bold;
        }

        .intro-message-main,
        .title-main-copy {
            font-size: 16px;
            font-weight: bold;
            margin-bottom: 10px;
        }

        .intro-message-sub,
        .title-sub-copy {
            color: #d4af37;
            font-weight: bold;
            font-size: 18px;
        }

        .text-bonnou-red {
            color: #ff4444;
        }

        .title-button {
            width: 200px;
        }

        .title-button-menu {
            margin-top: 0;
            font-size: 16px;
        }

        .carousel-nav-btn {
            min-width: 100px;
        }

        .mobile-mode .carousel-nav-btn {
            min-width: 70px;
            padding: 8px 16px;
            font-size: 13px;
            margin: 5px;
        }

        .info-kudoku {
            color: #fff;
        }

        .menu-modal-compact {
            max-width: 300px;
        }

        .menu-modal-title {
            color: #d4af37;
            margin-bottom: 20px;
        }

        .menu-modal-actions {
            display: flex;
            flex-direction: column;
            gap: 15px;
        }

        .menu-close-btn {
            margin-top: 10px;
            background: #555;
            border-color: #777;
        }

        .menu-close-btn:hover {
            background: #666;
            color: #fff;
        }

        .ranking-empty {
            color: #888;
            padding: 20px;
        }