        :root {
            --primary-color: #5c6bc0;
            --success-color: #4caf50;
            --warning-color: #ffb300;
            --danger-color: #e53935;
            --disabled-bg-color: rgba(0, 0, 0, 0.05);
            --font-family: 'Noto Sans KR', sans-serif;
            --border-radius: 12px;
            --spacing-sm: 8px;
            --spacing-md: 16px;
            --spacing-lg: 24px;
            --bg-light: #f4f6f8;
            --bg-primary: #ffffff;
            --shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
            --border-color: #e2e8f0;
            --text-color: #1e293b;
            --text-light-color: #64748b;
            --glass-bg: rgba(255, 255, 255, 0.7);
        }

        @media (prefers-color-scheme: dark) {
            :root:not([data-theme="light"]) {
                --primary-color: #7986cb;
                --success-color: #81c784;
                --warning-color: #ffd54f;
                --danger-color: #ef5350;
                --disabled-bg-color: rgba(255, 255, 255, 0.05);
                --bg-light: #1e293b;
                --bg-primary: #0f172a;
                --shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
                --border-color: #334155;
                --text-color: #f8fafc;
                --text-light-color: #94a3b8;
                --glass-bg: rgba(15, 23, 42, 0.85);
            }
        }

        :root[data-theme="dark"] {
            --primary-color: #7986cb;
            --success-color: #81c784;
            --warning-color: #ffd54f;
            --danger-color: #ef5350;
            --disabled-bg-color: rgba(255, 255, 255, 0.05);
            --bg-light: #1e293b;
            --bg-primary: #0f172a;
            --shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
            --border-color: #334155;
            --text-color: #f8fafc;
            --text-light-color: #94a3b8;
            --glass-bg: rgba(15, 23, 42, 0.85);
        }

        *,
        *::before,
        *::after {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        html {
            scroll-behavior: smooth;
        }

        body {
            font-family: var(--font-family);
            background: #eef2f7;
            color: var(--text-color);
            line-height: 1.6;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }

        #app {
            max-width: 520px;
            margin: var(--spacing-lg) auto;
            background: var(--bg-primary);
            border-radius: var(--border-radius);
            overflow: hidden;
            box-shadow: var(--shadow);
            transform: translateZ(0);
        }

        header {
            background: linear-gradient(135deg, var(--primary-color), #8e99f3);
            color: #fff;
            height: 70px;
            padding: 0 var(--spacing-md);
            display: flex;
            align-items: center;
            position: relative;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

        .header-container {
            width: 100%;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .header-container h1 {
            font-size: 1.3rem;
            margin: 0;
            text-align: left;
            padding-left: 0;
            cursor: pointer;
        }

        .header-buttons {
            display: flex;
            gap: var(--spacing-sm);
            position: absolute;
            right: var(--spacing-md);
        }

        #langToggleBtn,
        #modeToggleBtn,
        #openSettingsBtn {
            padding: 8px 16px;
            background-color: rgba(255, 255, 255, 0.2);
            border-radius: 20px;
            transition: background-color 0.2s ease, transform 0.1s ease;
            color: #fff;
            font-weight: bold;
            border: none;
            cursor: pointer;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        }

        #langToggleBtn:hover,
        #modeToggleBtn:hover,
        #openSettingsBtn:hover {
            background-color: rgba(255, 255, 255, 0.4);
            transform: translateY(-1px);
        }

        .hidden {
            display: none !important;
        }


        main {
            padding: var(--spacing-md);
            padding-bottom: 8px;
        }

        h2 {
            margin-bottom: var(--spacing-md);
            color: var(--primary-color);
            border-bottom: 2px solid var(--primary-color);
            padding-bottom: var(--spacing-sm);
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 10px;
            font-size: 1.15rem;
        }

        hr {
            border: none;
            border-top: 1px dashed var(--border-color);
            margin: var(--spacing-lg) 0;
        }

        input,
        select,
        button {
            font-family: inherit;
        }

        input[type=text],
        input[type=number] {
            padding: 8px;
            border: 1px solid var(--border-color);
            border-radius: var(--border-radius);
            height: 36px;
            width: 100%;
            font-size: 0.85rem;
            transition: border-color 0.2s ease, box-shadow 0.2s ease;
            background-color: var(--bg-light);
            text-align: left;
        }

        select {
            padding: 8px;
            border: 1px solid var(--border-color);
            border-radius: var(--border-radius);
            width: 100%;
            font-size: 0.85rem;
            transition: border-color 0.2s ease, box-shadow 0.2s ease;
            background-color: var(--bg-light);
            text-align: left;
        }

        input[type=text]:focus,
        input[type=number]:focus,
        select:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
            outline: none;
        }

        #currentTotal {
            text-align: center;
            font-weight: bold;
            margin-bottom: var(--spacing-md);
            color: var(--text-color);
            padding: var(--spacing-sm);
            border-radius: var(--border-radius);
            background-color: var(--bg-light);
        }

        #currentTotal.warning {
            color: var(--warning-color);
            background-color: color-mix(in srgb, var(--warning-color) 18%, var(--bg-light));
            border: 1px solid var(--warning-color);
        }

        #currentTotal.danger {
            color: var(--danger-color);
            background-color: color-mix(in srgb, var(--danger-color) 16%, var(--bg-light));
            border: 1px solid var(--danger-color);
        }

        #currentTotal.success {
            color: var(--success-color);
            background-color: color-mix(in srgb, var(--success-color) 16%, var(--bg-light));
            border: 1px solid var(--success-color);
        }

        #entries {
            margin-bottom: var(--spacing-md);
        }

        .entry {
            display: flex;
            align-items: center;
            gap: var(--spacing-sm);
            margin-bottom: var(--spacing-sm);
            background: var(--bg-light);
            padding: var(--spacing-sm);
            border-radius: var(--border-radius);
            cursor: grab;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
            transition: transform 0.2s ease, box-shadow 0.2s ease;
            min-height: 50px;
        }

        .entry:active {
            cursor: grabbing;
        }

        .entry.fade-out {
            animation: fadeOut 0.3s ease forwards;
        }

        .entry.fade-in {
            animation: fadeIn 0.3s ease forwards;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(-10px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes fadeOut {
            from {
                opacity: 1;
                transform: scale(1);
            }

            to {
                opacity: 0;
                transform: scale(0.9);
            }
        }

        @keyframes highlightEntryTier1 {
            0% {
                background-color: var(--primary-color);
            }

            50% {
                background-color: var(--bg-light);
            }

            100% {
                background-color: var(--primary-color);
            }
        }

        @keyframes highlightEntryTier2 {
            0% {
                background-color: #6a7ffb;
            }

            50% {
                background-color: var(--bg-light);
            }

            100% {
                background-color: #6a7ffb;
            }
        }

        @keyframes highlightEntryTier3 {
            0% {
                background-color: var(--warning-color);
                transform: scale(1);
            }

            50% {
                background-color: var(--bg-light);
                transform: scale(1.01);
            }

            100% {
                background-color: var(--warning-color);
                transform: scale(1);
            }
        }

        @keyframes highlightEntryTier4 {
            0% {
                background-color: var(--danger-color);
                transform: scale(1);
                box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
            }

            50% {
                background-color: var(--bg-light);
                transform: scale(1.02);
                box-shadow: 0 0 20px rgba(231, 76, 60, 0.8);
            }

            100% {
                background-color: var(--danger-color);
                transform: scale(1);
                box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
            }
        }

        @keyframes highlightEntryTier5 {
            0% {
                background-color: #ff00ff;
                transform: scale(1);
                box-shadow: 0 0 20px rgba(255, 0, 255, 0.7);
                border: 2px solid #ff00ff;
            }

            50% {
                background-color: var(--bg-light);
                transform: scale(1.03);
                box-shadow: 0 0 30px rgba(255, 0, 255, 1);
                border: 2px solid #ff00ff;
            }

            100% {
                background-color: #ff00ff;
                transform: scale(1);
                box-shadow: 0 0 20px rgba(255, 0, 255, 0.7);
                border: 2px solid #ff00ff;
            }
        }

        .entry.highlight-tier-1 {
            animation: highlightEntryTier1 0.9s ease-out forwards;
        }

        .entry.highlight-tier-2 {
            animation: highlightEntryTier2 0.9s ease-out forwards;
        }

        .entry.highlight-tier-3 {
            animation: highlightEntryTier3 0.9s ease-out forwards;
        }

        .entry.highlight-tier-4 {
            animation: highlightEntryTier4 0.9s ease-out forwards;
        }

        .entry.highlight-tier-5 {
            animation: highlightEntryTier5 0.9s ease-out forwards;
        }

        @keyframes tierLegendary {
            0% {
                box-shadow: 0 0 0 rgba(255, 215, 0, 0);
                border-color: transparent;
            }

            50% {
                box-shadow: 0 0 40px rgba(255, 215, 0, 1), inset 0 0 20px rgba(255, 215, 0, 0.5);
                border-color: #ffd700;
                transform: scale(1.02);
            }

            100% {
                box-shadow: 0 0 0 rgba(255, 215, 0, 0);
                border-color: transparent;
                transform: scale(1);
            }
        }

        @keyframes tierEpic {
            0% {
                box-shadow: 0 0 0 rgba(156, 39, 176, 0);
            }

            50% {
                box-shadow: 0 0 30px rgba(156, 39, 176, 0.8), inset 0 0 15px rgba(156, 39, 176, 0.4);
                border-color: #9c27b0;
                transform: scale(1.01);
            }

            100% {
                box-shadow: 0 0 0 rgba(156, 39, 176, 0);
                border-color: transparent;
                transform: scale(1);
            }
        }

        @keyframes tierRare {
            0% {
                box-shadow: 0 0 0 rgba(33, 150, 243, 0);
            }

            50% {
                box-shadow: 0 0 20px rgba(33, 150, 243, 0.6);
                border-color: #2196f3;
            }

            100% {
                box-shadow: 0 0 0 rgba(33, 150, 243, 0);
                border-color: transparent;
            }
        }

        .tier-legendary {
            animation: tierLegendary 2.5s ease-out !important;
            position: relative;
            z-index: 100;
            border: 2px solid transparent;
            border-radius: var(--border-radius);
        }

        .tier-epic {
            animation: tierEpic 2s ease-out !important;
            position: relative;
            z-index: 100;
            border: 2px solid transparent;
            border-radius: var(--border-radius);
        }

        .tier-rare {
            animation: tierRare 1.5s ease-out !important;
            position: relative;
            z-index: 100;
            border: 2px solid transparent;
            border-radius: var(--border-radius);
        }

        .entry.dragging {
            opacity: 0.5;
            border: 2px dashed var(--primary-color);
            transform: scale(0.98);
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        }

        .entry .color-indicator {
            width: 12px;
            height: 36px;
            border-radius: 6px;
            margin-left: 4px;
            flex-shrink: 0;
        }

        .entry input[type=text] {
            flex: 1.2;
            min-width: 0;
            text-overflow: ellipsis;
            white-space: nowrap;
            overflow: hidden;
        }

        .entry input[type=number] {
            flex: 1;
            min-width: 120px;
            box-sizing: border-box;
        }

        .entry input[type=number][readonly] {
            background-color: var(--disabled-bg-color);
            color: var(--text-light-color);
            pointer-events: none;
            cursor: default;
        }

        .percent-sign {
            margin-left: 4px;
            color: var(--text-light-color);
            flex-shrink: 0;
        }

        .btn-group,
        .main-actions {
            display: flex;
            gap: var(--spacing-sm);
            margin-bottom: var(--spacing-md);
            flex-wrap: wrap;
        }

        .btn-group button,
        .main-actions button {
            flex: 1 1 auto;
            min-width: 120px;
            padding: 14px 20px;
            font-size: 0.95rem;
            border-radius: var(--border-radius);
            font-weight: bold;
            transition: all 0.2s ease, transform 0.1s ease-out;
            position: relative;
            background-color: var(--primary-color);
            color: #fff;
            border: none;
            cursor: pointer;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        }

        .btn-group button:hover,
        .main-actions button:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
        }

        .btn-group button:active,
        .main-actions button:active {
            transform: translateY(0);
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        }

        #addBtn {
            background: var(--primary-color);
        }

        #deleteBtn {
            background: #f5a623;
        }

        #clearBtn {
            background: var(--danger-color);
        }

        #drawBtn,
        #spinBtn {
            background: linear-gradient(135deg, var(--primary-color), #8e99f3);
            color: #fff;
            border: none;
            box-shadow: 0 4px 14px color-mix(in srgb, var(--primary-color) 35%, transparent);
        }

        #autoBtn,
        #bulkBtn {
            background: var(--bg-light);
            color: var(--primary-color);
            border: 1.5px solid color-mix(in srgb, var(--primary-color) 55%, var(--border-color));
            box-shadow: none;
            font-weight: 700;
        }

        #autoBtn:hover,
        #bulkBtn:hover {
            background: color-mix(in srgb, var(--primary-color) 12%, var(--bg-light));
            border-color: var(--primary-color);
            transform: translateY(-1px);
        }

        #autoBtn:active,
        #bulkBtn:active {
            transform: translateY(0);
        }

        #saveToDeviceBtn {
            background: #3498db;
        }

        #drawHistory {
            list-style: none;
            padding: var(--spacing-sm) var(--spacing-md);
            background: var(--bg-light);
            border-radius: var(--border-radius);
            min-height: 60px;
            margin-bottom: var(--spacing-md);
            border: 1px solid var(--border-color);
        }

        #drawHistory h3 {
            font-size: 0.9em;
            text-align: center;
            margin-bottom: 5px;
            color: var(--text-light-color);
        }

        #drawHistory li {
            padding: 4px 0;
            border-bottom: 1px dashed #eee;
            font-size: 0.9rem;
            color: #555;
        }

        #drawHistory li:last-child {
            border-bottom: none;
        }

        .draw-history-pagination {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 10px;
            margin-top: 10px;
            margin-bottom: var(--spacing-md);
        }

        .draw-history-pagination button {
            background-color: var(--primary-color);
            color: #fff;
            padding: 6px 12px;
            border-radius: var(--border-radius);
            font-weight: bold;
            font-size: 0.85rem;
            transition: background-color 0.2s ease, transform 0.1s ease;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
            min-width: unset;
            flex: none;
            width: auto;
        }

        .draw-history-pagination button:disabled {
            background-color: #ccc;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }

        #mySavedSettingsList {
            list-style: none;
            padding: 0;
            margin-bottom: var(--spacing-md);
            min-height: 100px;
            display: block;
        }

        #mySavedSettingsList li {
            display: flex;
            align-items: center;
            padding: var(--spacing-sm) var(--spacing-md);
            border: 1px solid var(--border-color);
            border-radius: var(--border-radius);
            margin-bottom: var(--spacing-sm);
            background: var(--bg-primary);
            gap: var(--spacing-sm);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }

        .post-content {
            flex: 1;
            min-width: 0;
            word-break: break-word;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }

        .post-content strong {
            font-size: 1rem;
            margin-bottom: 4px;
            color: var(--primary-color);
            display: block;
            line-height: 1.3;
        }

        .post-content small {
            font-size: 0.8rem;
            color: var(--text-light-color);
        }

        .post-actions {
            display: flex;
            flex-direction: row;
            gap: var(--spacing-sm);
            align-items: center;
            flex-shrink: 0;
        }

        .post-actions .action-btn {
            background: var(--primary-color);
            color: #fff;
            border: none;
            border-radius: var(--border-radius);
            font-size: 0.85rem;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 40px;
            height: 40px;
            transition: all 0.2s ease, transform 0.1s ease-out;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
            cursor: pointer;
        }

        .delete-local-setting-btn {
            background: var(--danger-color) !important;
        }

        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            justify-content: center;
            align-items: center;
            z-index: 1000;
            animation: fadeIn 0.2s ease;
        }

        .modal.show {
            display: flex;
        }

        .modal-content {
            background: var(--glass-bg);
            padding: var(--spacing-lg);
            border-radius: var(--border-radius);
            width: 90%;
            max-width: 450px;
            box-shadow: var(--shadow);
            text-align: center;
            position: relative;
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .modal-content h3 {
            color: var(--primary-color);
            margin-bottom: var(--spacing-md);
            font-size: 1.2rem;
        }

        .modal-content label {
            display: block;
            text-align: left;
            margin-bottom: 5px;
            font-weight: bold;
            color: var(--text-color);
            font-size: 0.9rem;
        }

        .modal-content input,
        .modal-content select {
            margin-bottom: var(--spacing-sm);
        }

        .modal-content button {
            margin-top: var(--spacing-sm);
            width: 100%;
            padding: 14px 20px;
            font-size: 0.95rem;
            border-radius: var(--border-radius);
            font-weight: bold;
            transition: all 0.2s ease, transform 0.1s ease-out;
            position: relative;
            overflow: hidden;
            border: none;
            cursor: pointer;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        }

        .modal-content .cancel-btn {
            background-color: var(--danger-color);
            margin-top: var(--spacing-sm);
        }

        .modal-content .modal-buttons {
            display: flex;
            gap: var(--spacing-sm);
            margin-top: var(--spacing-md);
        }

        .modal-buttons button {
            flex: 1;
        }

        /* Full Screen Modal Settings */
        .full-screen-modal {
            background-color: var(--bg-primary);
            display: none;
            flex-direction: column;
        }

        .full-screen-modal.open {
            display: flex;
        }

        .settings-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: var(--spacing-md);
            border-bottom: 1px solid var(--border-color);
            background-color: var(--bg-light);
            position: sticky;
            top: 0;
            z-index: 10;
        }

        .settings-header h2 {
            margin: 0;
            font-size: 1.2rem;
            font-weight: bold;
        }

        .settings-header .back-btn {
            background: none;
            border: none;
            font-size: 1.5rem;
            cursor: pointer;
            color: var(--primary-color);
            padding: 0 10px;
        }

        .settings-content {
            padding: var(--spacing-md);
            display: flex;
            flex-direction: column;
            gap: 0;
        }

        .setting-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            height: 64px;
            min-height: 64px;
            max-height: 64px;
            padding: 0 2px;
            box-sizing: border-box;
            border-bottom: 1px solid var(--border-color);
        }

        .setting-label {
            display: flex;
            align-items: center;
            gap: 12px;
            font-weight: bold;
            font-size: 1.05rem;
            line-height: 1.2;
            min-width: 0;
        }

        .settings-copyright,
        .settings-disclaimer {
            text-align: center;
            color: var(--text-light-color);
            opacity: 0.75;
            line-height: 1.45;
            word-break: keep-all;
        }

        .settings-copyright {
            margin-top: 28px;
            font-size: 0.75rem;
        }

        .settings-disclaimer {
            margin-top: 8px;
            font-size: 0.78rem;
            padding-bottom: 12px;
        }

        .setting-label i {
            color: var(--primary-color);
            font-size: 1.2rem;
            width: 24px;
            text-align: center;
        }

        .setting-select {
            padding: 0 12px;
            font-size: 0.9rem;
            border: 1px solid var(--border-color);
            border-radius: var(--border-radius);
            background-color: var(--bg-light);
            color: var(--text-color);
            cursor: pointer;
            outline: none;
            width: auto;
            max-width: 150px;
            height: 36px;
            box-sizing: border-box;
        }

        .setting-item .switch {
            flex-shrink: 0;
        }

        /* Switch Slider */
        .switch {
            position: relative;
            display: inline-block;
            width: 40px;
            height: 24px;
        }

        .switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #ccc;
            transition: .4s;
        }

        .slider:before {
            position: absolute;
            content: "";
            height: 18px;
            width: 18px;
            left: 3px;
            bottom: 3px;
            background-color: white;
            transition: .4s;
        }

        input:checked+.slider {
            background-color: var(--primary-color);
        }

        input:checked+.slider:before {
            transform: translateX(16px);
        }

        .slider.round {
            border-radius: 24px;
        }

        .slider.round:before {
            border-radius: 50%;
        }

        .my-settings-pagination {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 10px;
            margin-top: 10px;
            margin-bottom: var(--spacing-md);
        }

        .my-settings-pagination button {
            background-color: var(--primary-color);
            color: #fff;
            padding: 6px 12px;
            border-radius: var(--border-radius);
            font-weight: bold;
            font-size: 0.85rem;
            transition: background-color 0.2s ease, transform 0.1s ease;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
            min-width: unset;
            flex: none;
            width: auto;
        }

        .my-settings-pagination button:disabled {
            background-color: #ccc;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }

        .chart-wrapper {
            position: relative;
            margin-top: var(--spacing-md);
            height: 280px;
        }

        #chartLegend {
            margin-top: var(--spacing-md);
            padding: var(--spacing-sm);
            background: var(--bg-light);
            border-radius: var(--border-radius);
            font-size: 0.9rem;
            max-height: 200px;
            overflow-y: auto;
            border: 1px solid var(--border-color);
        }

        #chartLegend div {
            display: flex;
            align-items: center;
            margin-bottom: 5px;
            padding: 2px 0;
        }

        .color-box {
            width: 18px;
            height: 18px;
            min-width: 18px;
            margin-right: var(--spacing-sm);
            border-radius: 4px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        }

        .item-name {
            flex: 1;
            word-break: break-all;
            margin-right: var(--spacing-sm);
            text-align: left;
        }

        .item-result {
            font-weight: bold;
            color: var(--primary-color);
            flex-shrink: 0;
            min-width: 80px;
            text-align: right;
        }

        #example-list {
            display: flex;
            flex-wrap: wrap;
            gap: var(--spacing-sm);
            padding: 0 var(--spacing-sm);
            margin-bottom: var(--spacing-md);
            text-align: left;
            justify-content: flex-start;
        }

        #example-list button {
            background-color: var(--bg-light);
            border: 1px solid var(--primary-color);
            color: var(--primary-color);
            padding: 6px 12px;
            font-size: 0.85rem;
            border-radius: 20px;
            width: auto;
            min-width: 80px;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
            transition: all 0.2s ease;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        #example-list button:hover {
            background-color: var(--primary-color);
            color: #fff;
            transform: translateY(-1px);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
        }

        #example-list button.active-example {
            background-color: var(--primary-color);
            color: #fff;
            border-color: var(--primary-color);
            font-weight: bold;
            box-shadow: 0 2px 8px rgba(74, 144, 226, 0.4);
            transform: translateY(-1px);
        }

        #toast {
            visibility: hidden;
            min-width: 280px;
            background-color: #333;
            color: #fff;
            text-align: center;
            border-radius: var(--border-radius);
            padding: 18px;
            position: fixed;
            z-index: 1001;
            left: 50%;
            bottom: 40px;
            transform: translateX(-50%);
            font-size: 1.1rem;
            opacity: 0;
            transition: visibility 0s, opacity 0.3s ease-out;
            box-shadow: var(--shadow);
            line-height: 1.4;
        }

        #toast.show {
            visibility: visible;
            opacity: 1;
        }

        .hidden {
            display: none !important;
        }

        #rouletteContainer {
            text-align: center;
            position: relative;
            padding: var(--spacing-md);
            overflow: hidden;
            background-color: var(--bg-light);
            border-radius: var(--border-radius);
            margin-bottom: var(--spacing-md);
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .roulette-wrapper {
            position: relative;
            display: block;
            width: 80%;
            height: 0;
            padding-bottom: 80%;
            overflow: hidden;
            border-radius: 50%;
            background-color: transparent;
            max-width: 380px;
            max-height: 380px;
        }

        #rouletteCanvas {
            position: absolute;
            top: 0;
            left: 0;
            display: block;
            transform-origin: center center;
        }

        #rouletteErrorMessage {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 1rem;
            font-weight: bold;
            color: var(--danger-color);
            text-align: center;
            line-height: 1.5;
            z-index: 5;
            pointer-events: none;
            width: 80%;
        }

        .pointer {
            width: 0;
            height: 0;
            border-left: 20px solid transparent;
            border-right: 20px solid transparent;
            border-top: 40px solid var(--danger-color);
            position: absolute;
            top: calc(16px - 20px);
            left: 50%;
            transform: translateX(-50%);
            z-index: 10;
            transition: transform 0.1s ease-out;
            will-change: transform;
        }

        #spinBtn {
            font-size: 1rem;
            padding: 14px 20px;
            border-radius: var(--border-radius);
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s ease, transform 0.1s ease-out;
            width: 100%;
            margin-top: var(--spacing-md);
        }

        .controls-wrapper {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: var(--spacing-md);
            margin-top: var(--spacing-md);
            flex-wrap: wrap;
            position: relative;
            width: 100%;
        }

        .sort-btn {
            font-size: 0.85em;
            padding: 8px 15px;
            background-color: var(--bg-light);
            color: var(--text-light-color);
            border: 1px solid var(--border-color);
            border-radius: var(--border-radius);
            cursor: pointer;
            transition: all 0.2s ease;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
        }

        .sort-btn.on {
            background-color: var(--primary-color);
            color: #fff;
            border-color: var(--primary-color);
            font-weight: bold;
            box-shadow: 0 2px 8px rgba(74, 144, 226, 0.4);
        }

        .roulette-stage {
            position: relative;
            width: 300px;
            height: 300px;
            margin: 0 auto 20px;
            overflow: hidden;
            border-radius: 50%;
            box-shadow: var(--shadow);
        }

        #rouletteWheelWrapper {
            width: 100%;
            height: 100%;
            position: absolute;
            top: 0;
            left: 0;
            will-change: transform;
        }

        #rouletteCanvas {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 1;
        }

        #rouletteLabelsContainer {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 2;
        }

        .roulette-pointer {
            position: absolute;
            top: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 0;
            height: 0;
            border-left: 15px solid transparent;
            border-right: 15px solid transparent;
            border-top: 25px solid var(--danger-color);
            z-index: 10;
            filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3));
        }

        .roulette-label {
            position: absolute;
            color: white;
            font-weight: bold;
            font-size: 12px;
            text-shadow: 0 0 3px black, 0 1px 2px rgba(0, 0, 0, 0.8);
            text-align: center;
            transform-origin: center center;
            white-space: nowrap;
            line-height: 1.2;
            will-change: transform;
            max-width: 90px;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        #posts {
            margin-top: var(--spacing-md);
        }

        #posts > h2 {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
        }

        .community-status {
            font-size: 0.85rem;
            padding: 8px 12px;
            border-radius: 8px;
            margin: 8px 0;
            display: none;
        }

        .community-status.show { display: block; }
        .community-status.info {
            background: rgba(74, 144, 226, 0.12);
            color: var(--primary-color);
        }
        .community-status.error {
            background: rgba(231, 76, 60, 0.12);
            color: var(--danger-color);
        }
        .community-status.success {
            background: rgba(46, 204, 113, 0.12);
            color: var(--success-color);
        }

        #postsList {
            list-style: none;
            padding: 0;
            margin: 0 0 var(--spacing-md);
            min-height: 80px;
        }

        #postsList li {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 10px;
            padding: 12px;
            margin-bottom: 8px;
            background: var(--bg-light);
            border-radius: var(--border-radius);
            border: 1px solid var(--border-color);
            transition: transform 0.15s ease, box-shadow 0.15s ease;
        }

        #postsList li:active {
            transform: scale(0.99);
        }

        #postsList .post-content {
            flex: 1;
            min-width: 0;
        }

        #postsList .post-content strong {
            display: block;
            margin-bottom: 4px;
            word-break: break-word;
        }

        #postsList .post-content small {
            color: var(--text-light-color);
            font-size: 0.8rem;
        }

        #postsList .post-actions {
            display: flex;
            align-items: center;
            gap: 4px;
            flex-shrink: 0;
        }

        #postsList .like-btn {
            background: transparent;
            border: 1px solid var(--border-color);
            border-radius: 20px;
            padding: 6px 10px;
            cursor: pointer;
            color: var(--text-color);
            font-size: 0.85rem;
        }

        #postsList .like-btn.liked {
            color: var(--danger-color);
            border-color: var(--danger-color);
        }

        #postsList .like-btn:disabled {
            opacity: 0.7;
            cursor: default;
        }

        #postsList .action-btn {
            background: transparent;
            border: none;
            color: var(--primary-color);
            cursor: pointer;
            padding: 8px;
            font-size: 1rem;
        }

        #postsList .delete-post-btn {
            color: var(--danger-color);
        }

        .posts-skeleton .skeleton {
            height: 72px;
            margin-bottom: 8px;
            border-radius: var(--border-radius);
            background: linear-gradient(90deg, rgba(0,0,0,0.06), rgba(0,0,0,0.02), rgba(0,0,0,0.06));
            background-size: 200% 100%;
            animation: shimmer 1.2s infinite;
        }

        @keyframes shimmer {
            0% { background-position: 200% 0; }
            100% { background-position: -200% 0; }
        }

        .community-empty {
            text-align: center;
            padding: 28px 16px;
            color: var(--text-light-color);
            background: var(--bg-light);
            border: 1px dashed var(--border-color);
            border-radius: var(--border-radius);
            margin-bottom: var(--spacing-md);
        }

        .community-empty-icon {
            font-size: 2rem;
            margin-bottom: 8px;
        }

        .community-empty #retryCommunityBtn {
            margin-top: 12px;
        }

        #openShareToServerBtn {
            background: #3498db;
        }

        #searchInput {
            width: 100%;
            margin: 8px 0 12px;
            padding: 10px 12px;
            border-radius: var(--border-radius);
            border: 1px solid var(--border-color);
            box-sizing: border-box;
            background: var(--bg-color, #fff);
            color: inherit;
        }

        #posts .pagination {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            margin-bottom: var(--spacing-md);
        }

        #posts .pagination button {
            min-width: 40px;
            padding: 8px 12px;
            border-radius: 8px;
            border: 1px solid var(--border-color);
            background: var(--bg-light);
            cursor: pointer;
        }

        #posts .pagination button:disabled {
            opacity: 0.4;
            cursor: default;
        }

        @media (max-width: 480px) {
            #app {
                margin: var(--spacing-sm) auto;
                border-radius: 0;
                box-shadow: none;
            }

            header {
                height: 60px;
            }

            .header-container h1 {
                font-size: 1.1rem;
            }

            .roulette-wrapper {
                width: 95vw;
                max-width: 380px;
                padding-bottom: 95vw;
                max-height: 380px;
            }
        }

        footer {
            text-align: center;
            padding: var(--spacing-md);
            margin-top: var(--spacing-lg);
            border-top: 1px dashed var(--border-color);
            color: var(--text-light-color);
            font-size: 0.85rem;
            line-height: 1.5;
            background-color: var(--bg-light);
            border-radius: 0 0 var(--border-radius) var(--border-radius);
        }

        .web-install-banner {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: var(--spacing-md);
            padding: 12px 14px;
            border-radius: var(--border-radius);
            background: linear-gradient(135deg, color-mix(in srgb, var(--primary-color) 18%, var(--bg-light)), var(--bg-light));
            border: 1px solid var(--border-color);
        }

        .web-install-banner[hidden] { display: none !important; }

        .web-install-text {
            display: flex;
            flex-direction: column;
            gap: 2px;
            min-width: 0;
        }

        .web-install-text strong { font-size: 0.95rem; }
        .web-install-text span { font-size: 0.8rem; color: var(--text-light-color); }

        .web-install-btn {
            flex-shrink: 0;
            text-decoration: none;
            background: var(--primary-color);
            color: #fff;
            font-weight: 700;
            padding: 10px 14px;
            border-radius: 10px;
            font-size: 0.9rem;
        }

        .onboarding-hint {
            margin: 0 0 var(--spacing-sm);
            padding: 10px 12px;
            border-radius: 10px;
            background: color-mix(in srgb, var(--primary-color) 12%, var(--bg-light));
            color: var(--text-color);
            font-size: 0.9rem;
            line-height: 1.4;
        }

        .quick-example-chips {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: var(--spacing-md);
        }

        .example-chip {
            border: 1px solid var(--border-color);
            background: var(--bg-light);
            color: var(--text-color);
            border-radius: 999px;
            padding: 6px 12px;
            font-size: 0.82rem;
            cursor: pointer;
        }

        .example-chip:active { transform: scale(0.98); }

        .result-card {
            margin-bottom: var(--spacing-md);
            padding: 16px 14px;
            border-radius: 14px;
            text-align: center;
            background: linear-gradient(160deg, color-mix(in srgb, var(--success-color) 22%, var(--bg-primary)), var(--bg-light));
            border: 1px solid color-mix(in srgb, var(--success-color) 45%, var(--border-color));
        }

        .result-card[hidden] { display: none !important; }

        .result-card-label {
            font-size: 0.8rem;
            color: var(--text-light-color);
            margin-bottom: 4px;
        }

        .result-card-value {
            font-size: 1.55rem;
            font-weight: 800;
            word-break: keep-all;
        }

        .result-card-pop {
            animation: resultPop 0.45s ease;
        }

        @keyframes resultPop {
            0% { transform: scale(0.92); opacity: 0.4; }
            60% { transform: scale(1.03); opacity: 1; }
            100% { transform: scale(1); }
        }

        .roulette-recent {
            margin: 10px 0 14px;
            padding: 10px 12px;
            border-radius: 12px;
            background: var(--bg-light);
            border: 1px solid var(--border-color);
        }

        .roulette-recent-title {
            font-size: 0.82rem;
            color: var(--text-light-color);
            margin-bottom: 6px;
        }

        #rouletteRecentList {
            list-style: none;
            display: flex;
            flex-direction: column;
            gap: 4px;
            margin: 0;
            padding: 0;
        }

        #rouletteRecentList li {
            font-weight: 700;
            font-size: 0.95rem;
        }

        .sticky-actions {
            position: sticky;
            bottom: 0;
            z-index: 15;
            padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px));
            background: linear-gradient(to top, var(--bg-primary) 70%, transparent);
        }

        .sticky-actions button {
            width: 100%;
            padding: 14px 18px;
            font-size: 0.95rem;
            border-radius: var(--border-radius);
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s ease, transform 0.1s ease-out;
            font-family: inherit;
        }

        .sticky-actions #drawBtn,
        .sticky-actions #spinBtn {
            margin-bottom: 8px;
            font-size: 1.05rem;
            letter-spacing: 0.01em;
        }

        .sticky-actions #drawBtn:hover,
        .sticky-actions #spinBtn:hover {
            transform: translateY(-2px);
            filter: brightness(1.05);
        }

        .sticky-actions #drawBtn:active,
        .sticky-actions #spinBtn:active {
            transform: translateY(0);
        }

        .sticky-actions-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
        }

        .sticky-actions-row button { width: 100%; }

        .field-hint {
            font-size: 0.8rem;
            color: var(--text-light-color);
            margin: -4px 0 10px;
            line-height: 1.4;
        }

        .footer-play-badge { margin-bottom: 15px; }
        .footer-play-badge[hidden] { display: none !important; }

        body.in-app .web-install-banner,
        body.in-app .footer-play-badge { display: none !important; }