:root {
    --primary: #60A5FA;
    --primary-dark: #1E3A8A;
    --primary-gradient: linear-gradient(135deg, #60A5FA, #A78BFA);
    --background: #F9FAFB;
    --card-bg: #FFFFFF;
    --text: #1F2937;
    --text-secondary: #6B7280;
    --border: #E5E7EB;
    --shadow: rgba(0, 0, 0, 0.05);
    --success: #34D399;
    --error: #F87171;
    --warning: #FBBF24;
    --info: #60A5FA;
    --safe-area-inset-top: env(safe-area-inset-top, 0px);
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-inset-left: env(safe-area-inset-left, 0px);
    --safe-area-inset-right: env(safe-area-inset-right, 0px);
    --surfaceContainer: #E5E7EB;
    --surfaceContainerHigh: #D1D5DB;
    --dark-bg: #111827;
    --dark-card: linear-gradient(145deg, #1F2937, #374151);
    --dark-text: #F3F4F6;
    --dark-text-secondary: #9CA3AF;
    --dark-border: #4B5563;
    --dark-shadow: rgba(0, 0, 0, 0.3);
    --dark-surfaceContainer: #4B5563;
    --dark-surfaceContainerHigh: #6B7280;
}

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

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--background);
    color: var(--text);
    padding: calc(var(--safe-area-inset-top) + 16px) calc(var(--safe-area-inset-left) + 16px) calc(var(--safe-area-inset-bottom) + 16px) calc(var(--safe-area-inset-right) + 16px);
    line-height: 1.5;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.1) 0%, transparent 70%);
    animation: bgPulse 8s infinite ease-in-out;
    z-index: -1;
    pointer-events: none;
}

@keyframes bgPulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

body.dark-theme {
    background: var(--dark-bg);
    color: var(--dark-text);
}

body.dark-theme::before {
    background: radial-gradient(circle, rgba(167, 139, 250, 0.15) 0%, transparent 70%);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: calc(100% - var(--safe-area-inset-top) - var(--safe-area-inset-bottom));
}

.header {
    background: var(--primary-gradient);
    color: #fff;
    padding: 14px 20px;
    border-radius: 16px;
    box-shadow: 0 4px 12px var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.header::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shine 3s infinite ease-in-out;
}

@keyframes shine {
    0% { left: -100%; }
    20% { left: 100%; }
    100% { left: 100%; }
}

.dark-theme .header {
    background: linear-gradient(135deg, #1E3A8A, #6B7280);
}

.header-title {
    font-size: 22px;
    font-weight: 600;
    margin: 0;
    display: inline-flex;
    align-items: center;
    letter-spacing: 0.5px;
    z-index: 1;
    gap: 8px;
}

.version {
    font-size: 12px;
    background: rgba(255, 255, 255, 0.25);
    padding: 3px 7px;
    border-radius: 10px;
    line-height: 1.2;
    white-space: nowrap;
    min-width: 32px;
    text-align: center;
    backdrop-filter: blur(4px);
    display: inline-block;
}

.tab-nav {
    display: flex;
    gap: 8px;
    padding: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 4px 12px var(--shadow);
    position: relative;
}

.dark-theme .tab-nav {
    background: var(--dark-card);
}

.tab-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    opacity: 0.05;
    border-radius: 16px;
    pointer-events: none;
}

.tab-nav::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    flex: 1;
    padding: 12px 18px;
    background: none;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tab-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: tabShine 4s infinite ease-in-out;
}

@keyframes tabShine {
    0% { left: -100%; }
    10% { left: 100%; }
    100% { left: 100%; }
}

.tab-btn.active {
    color: #fff;
    background: var(--primary-gradient);
    box-shadow: 0 2px 8px var(--shadow);
}

.tab-btn:hover {
    color: var(--primary);
    background: rgba(96, 165, 250, 0.1);
}

.dark-theme .tab-btn {
    color: var(--dark-text-secondary);
}

.dark-theme .tab-btn.active {
    color: #fff;
    background: var(--primary-gradient);
}

.dark-theme .tab-btn:hover {
    color: var(--primary);
    background: rgba(96, 165, 250, 0.15);
}

.tab-container {
    position: relative;
    overflow: hidden;
    flex: 1;
    z-index: 1;
}

.tab-content {
    display: none;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transform: translateX(0);
    transition: none;
    height: 100%;
}

.tab-content.active {
    display: block;
    position: relative;
    opacity: 1;
}

.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 12px var(--shadow);
    border: none;
    transition: transform 0.2s ease;
}

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

.dark-theme .card {
    background: var(--dark-card);
    border-color: var(--dark-border);
}

.scroll-container {
    max-height: calc(90vh - var(--safe-area-inset-top) - var(--safe-area-inset-bottom) - 180px);
    overflow-y: auto;
    overflow-x: hidden;
    margin-top: 0;
    padding: 8px;
    border-radius: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    position: relative;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
}

.scroll-container .loader {
    width: 100%;
    height: 40px;
    background: linear-gradient(90deg, var(--surfaceContainer), var(--surfaceContainerHigh), var(--surfaceContainer));
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite linear;
    border-radius: 8px;
    margin: 16px 0;
}

#device-picker-popup .scroll-container {
    min-height: 350px;
    height: 350px;
    flex: 1 0 auto;
    overflow-y: auto;
}

#device-modal .scroll-container {
    min-height: 350px;
    max-height: 350px;
    flex: 1 0 auto;
    overflow-y: auto;
    padding: 12px;
    border: none;
}

#device-picker-popup .scroll-container.no-scrollbar {
    overflow-y: hidden;
}

.dark-theme .scroll-container {
    background: var(--dark-card);
    border-color: var(--dark-border);
}

.scroll-container::-webkit-scrollbar {
    width: 6px;
}

.scroll-container::-webkit-scrollbar-thumb {
    background: var(--text-secondary);
    border-radius: 10px;
    margin: 8px 0;
}

.scroll-container::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 16px;
    margin: 8px 0;
}

.dark-theme .scroll-container::-webkit-scrollbar-thumb {
    background: var(--dark-text-secondary);
}

.dark-theme .scroll-container::-webkit-scrollbar-track {
    background: transparent;
}

.search-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 4px 12px var(--shadow);
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.search-container input {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    background: var(--background);
    color: var(--text);
}

.search-container input::placeholder {
    color: var(--text-secondary);
}

.dark-theme .search-container {
    background: var(--dark-card);
    border-color: var(--dark-border);
}

.dark-theme .search-container input {
    background: var(--dark-bg);
    border-color: var(--dark-border);
    color: var(--dark-text);
}

.dark-theme .search-container input::placeholder {
    color: var(--dark-text-secondary);
}

.toggle-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    position: relative;
}

.toggle-group:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--border);
    opacity: 0.5;
}

.dark-theme .toggle-group:not(:last-child)::after {
    background: var(--dark-border);
}

.toggle-label {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    transition: color 0.3s ease;
}

.dark-theme .toggle-label {
    color: var(--dark-text);
}

.switch {
    position: relative;
    width: 48px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--text-secondary);
    border-radius: 24px;
    transition: all 0.2s ease;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

input:checked + .slider {
    background: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.toggle-group:hover .slider {
    transform: scale(1.05);
}

.button-group {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-top: 16px;
}

.action-btn, .shortcut-btn {
    background: var(--primary-gradient);
    color: #fff;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: clamp(14px, 3.5vw, 15px);
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    flex: 1;
    min-width: 120px;
    transform: scale(1);
}

.shortcut-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.shortcut-icon {
    width: 20px;
    height: 20px;
    fill: #fff;
    margin-right: 4px;
    transition: transform 0.3s ease;
}

.action-btn:hover, .shortcut-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px var(--shadow);
}

.shortcut-btn:hover .shortcut-icon {
    transform: scale(1.1);
}

.action-btn:active, .shortcut-btn:active {
    transform: scale(0.95);
}

.action-btn::after, .shortcut-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.action-btn:active::after, .shortcut-btn:active::after {
    width: 120px;
    height: 120px;
}

.action-btn.loading::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.action-btn.loading {
    padding-left: 32px;
    pointer-events: none;
    opacity: 0.8;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.dark-theme .action-btn, .dark-theme .shortcut-btn {
    background: linear-gradient(135deg, #1E3A8A, #6B7280);
}

.dark-theme .action-btn:hover, .dark-theme .shortcut-btn:hover {
    background: var(--primary-gradient);
}

.add-btn {
    background: var(--primary);
    color: #fff;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 2px 6px var(--shadow);
}

.add-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05) translateX(2px);
}

.add-btn svg {
    width: 16px;
    height: 16px;
    stroke: #fff;
}

.package-picker-btn {
    padding: 4px 8px;
    font-size: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 50px;
    justify-content: center;
    box-shadow: 0 3px 8px var(--shadow);
}

.package-picker-btn:hover {
    transform: scale(1.05);
    background: var(--primary-dark);
}

.package-picker-btn svg {
    width: 26px;
    height: 26px;
    stroke: #fff;
    transition: transform 0.3s ease;
}

.package-picker-btn:hover svg {
    transform: scale(1.1);
}

.dark-theme .package-picker-btn {
    background: linear-gradient(135deg, #1E3A8A, #6B7280);
}

.dark-theme .package-picker-btn:hover {
    background: var(--primary-gradient);
}

.section-header {
    margin-bottom: 12px;
}

.section-header h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--primary);
}

.list-wrapper {
    padding: 8px;
    width: 100%;
}

.device-list, .game-list, .device-picker {
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.3s ease;
    margin: 0;
}

.device-card, .game-card, .picker-device-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    animation: cardEnter 0.3s ease forwards;
    margin: 0 4px;
    will-change: opacity, transform, max-height;
}

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

.device-card.fade-out, .game-card.fade-out, .picker-device-card.fade-out {
    animation: fadeOut 0.4s ease forwards;
    max-height: 200px;
    overflow: hidden;
}

@keyframes fadeOut {
    0% { 
        opacity: 1; 
        transform: translateY(0); 
        max-height: 200px; 
        margin: 0 4px; 
        padding: 16px; 
    }
    100% { 
        opacity: 0; 
        transform: translateY(10px); 
        max-height: 0; 
        margin: 0 4px; 
        padding: 0 16px; 
    }
}

.device-card:hover, .game-card:hover, .picker-device-card:hover {
    box-shadow: 0 4px 12px var(--shadow);
    transform: translateY(-4px);
}

.picker-device-card.selected {
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid var(--primary);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.3);
}

.dark-theme .picker-device-card.selected {
    background: rgba(96, 165, 250, 0.15);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.3);
}

.dark-theme .device-card, .dark-theme .game-card, .dark-theme .picker-device-card {
    background: var(--dark-card);
}

.device-header, .game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.device-name, .game-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 80px);
}

.dark-theme .device-name, .dark-theme .game-name {
    color: var(--dark-text);
}

.game-name {
    font-family: monospace;
}

.device-actions, .game-actions {
    display: flex;
    gap: 4px;
}

.edit-btn, .delete-btn {
    background: none;
    border: none;
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.edit-btn {
    color: var(--primary);
}

.edit-btn:hover {
    background: rgba(96, 165, 250, 0.1);
}

.delete-btn {
    color: var(--error);
}

.delete-btn:hover {
    background: rgba(248, 113, 113, 0.1);
}

.device-details, .game-details {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.dark-theme .device-details, .dark-theme .game-details {
    color: var(--dark-text-secondary);
}

.picker-device-card h4 {
    font-size: 15px;
    font-weight: 500;
    margin: 0;
    color: var(--text);
}

.dark-theme .picker-device-card h4 {
    color: var(--dark-text);
}

.picker-device-card p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 4px 0 0;
}

.dark-theme .picker-device-card p {
    color: var(--dark-text-secondary);
}

.log-section {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 4px 12px var(--shadow);
    margin-top: 16px;
    max-height: calc(50% - var(--safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
}

.dark-theme .log-section {
    background: var(--dark-card);
}

.log-header {
    background: var(--primary-gradient);
    color: #fff;
    padding: 10px 12px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.dark-theme .log-header {
    background: linear-gradient(135deg, #1E3A8A, #6B7280);
}

.log-title {
    display: flex;
    align-items: center;
    gap: 6px;
}

h2 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}

.toggle-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.toggle-icon.expanded {
    transform: rotate(180deg);
}

.clear-text {
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.2s ease;
}

.clear-text:hover {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.log-content {
    padding: 12px;
    max-height: 200px;
    overflow-y: auto;
    transition: max-height 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    background: var(--background);
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--text-secondary) var(--background);
}

.log-content::-webkit-scrollbar {
    width: 4px;
}

.log-content::-webkit-scrollbar-thumb {
    background: var(--text-secondary);
    border-radius: 2px;
}

.log-content::-webkit-scrollbar-track {
    background: var(--background);
}

.dark-theme .log-content {
    background: var(--dark-bg);
    scrollbar-color: var(--dark-text-secondary) var(--dark-bg);
}

.dark-theme .log-content::-webkit-scrollbar-thumb {
    background: var(--dark-text-secondary);
}

.dark-theme .log-content::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

.log-content.collapsed {
    max-height: 0;
    padding: 0 12px;
    overflow: hidden;
}

#output {
    font-family: 'Roboto Mono', monospace;
    font-size: 13px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.log-info { color: var(--info); }
.log-success { color: var(--success); }
.log-error { color: var(--error); }
.log-warning { color: var(--warning); }
.log-green { color: var(--success); }
.log-red { color: var(--error); }

.log-icon {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 6px;
    vertical-align: middle;
}

.icon-success {
    background: var(--success);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") no-repeat center;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") no-repeat center;
}

.icon-error {
    background: var(--error);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M18 6L6 18M6 6l12 12'/%3E%3C/svg%3E") no-repeat center;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M18 6L6 18M6 6l12 12'/%3E%3C/svg%3E") no-repeat center;
}

.icon-warning {
    background: var(--warning);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M12 2L2 19h20L12 2zm0 5v6m0 4h.01'/%3E%3C/svg%3E") no-repeat center;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M12 2L2 19h20L12 2zm0 5v6m0 4h.01'/%3E%3C/svg%3E") no-repeat center;
}

.icon-info {
    background: var(--info);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4m0-4h.01'/%3E%3C/svg%3E") no-repeat center;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4m0-4h.01'/%3E%3C/svg%3E") no-repeat center;
}

.modal, .popup {
    display: none;
    position: fixed;
    top: 0;
    left: var(--safe-area-inset-left);
    width: calc(100% - var(--safe-area-inset-left) - var(--safe-area-inset-right));
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: calc(var(--safe-area-inset-top) + 16px) 16px calc(var(--safe-area-inset-bottom) + 16px);
}

.modal-content, .popup-content {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 4px 12px var(--shadow);
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.modal-content {
    width: 100%;
    max-width: 400px;
}

.popup-content {
    max-width: 400px;
    width: 100%;
    text-align: center;
}

#game-modal .modal-content {
    max-height: 600px;
}

#device-modal .modal-content {
    max-height: 600px;
    min-height: 400px;
}

.device-form-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 12px;
}

.modal-content.modal-enter, .popup-content:not(.popup-exit) {
    animation: modalEnter 0.3s ease forwards;
}

.modal-content.modal-exit, .popup-exit {
    animation: modalExit 0.3s ease forwards;
}

@keyframes modalEnter {
    0% { transform: scale(0.9); opacity: 0; }
    70% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes modalExit {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0; }
}

.dark-theme .modal-content, .dark-theme .popup-content {
    background: var(--dark-card);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--primary);
}

.dark-theme .modal-header h3 {
    color: var(--primary);
}

.close-btn {
    font-size: 22px;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
}

.close-btn:hover {
    color: var(--error);
}

.form-group {
    margin-bottom: 12px;
    position: relative;
}

.form-group label {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
    display: block;
}

.dark-theme .form-group label {
    color: var(--dark-text);
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    background: var(--background);
    color: var(--text);
    transition: all 0.3s ease;
}

.form-group input.error, .form-group textarea.error, .form-group select.error {
    border-color: var(--error);
    box-shadow: 0 0 8px rgba(248, 113, 113, 0.3);
}

.error-message {
    color: var(--error);
    font-size: 12px;
    margin-top: 6px;
    display: block;
    padding: 4px 8px;
    background: rgba(248, 113, 113, 0.1);
    border-radius: 6px;
    transition: opacity 0.3s ease;
}

.dark-theme .error-message {
    background: rgba(248, 113, 113, 0.15);
}

.dark-theme .form-group input, .dark-theme .form-group textarea, .dark-theme .form-group select {
    background: var(--dark-bg);
    border-color: var(--dark-border);
    color: var(--dark-text);
}

.dark-theme .form-group input.error, .dark-theme .form-group textarea.error, .dark-theme .form-group select.error {
    border-color: var(--error);
    box-shadow: 0 0 8px rgba(248, 113, 113, 0.3);
}

.dark-theme .form-group input::placeholder,
.dark-theme .form-group textarea::placeholder,
.dark-theme .form-group select::placeholder {
    color: var(--dark-text-secondary);
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 8px rgba(96, 165, 250, 0.3);
}

#game-device {
    width: 100%;
    min-width: 250px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    background: var(--background);
    color: var(--text);
    cursor: pointer;
}

#game-device.error {
    border-color: var(--error);
    box-shadow: 0 0 8px rgba(248, 113, 113, 0.3);
}

#game-device.highlighted {
    border: 1px solid var(--primary);
    box-shadow: 0 0 8px rgba(96, 165, 250, 0.3);
    background: rgba(96, 165, 250, 0.05);
}

.dark-theme #game-device {
    background: var(--dark-bg);
    border-color: var(--dark-border);
    color: var(--dark-text);
}

.dark-theme #game-device.error {
    border-color: var(--error);
    box-shadow: 0 0 8px rgba(248, 113, 113, 0.3);
}

.dark-theme #game-device.highlighted {
    border: 1px solid var(--primary);
    box-shadow: 0 0 8px rgba(96, 165, 250, 0.3);
    background: rgba(96, 165, 250, 0.1);
}

.form-buttons, .popup-buttons {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-shrink: 0;
}

.cancel-btn {
    background: var(--border);
    color: var(--text);
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    flex: 1;
    transition: all 0.2s ease;
}

.dark-theme .cancel-btn {
    background: var(--dark-border);
    color: var(--dark-text);
}

.cancel-btn:hover {
    background: var(--text-secondary);
}

#device-picker-popup .popup-content {
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.device-picker-content {
    max-width: 400px;
    max-height: calc(80vh - var(--safe-area-inset-top) - var(--safe-area-inset-bottom));
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 350px;
    flex: 1;
}

.device-picker {
    flex: 1 0 auto;
    width: 100%;
    overflow-y: visible;
    padding: 0 4px;
    min-height: 350px;
}

.device-picker::-webkit-scrollbar {
    display: none;
}

.popup-content h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 12px;
}

.popup-content p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.dark-theme .popup-content p {
    color: var(--dark-text-secondary);
}

.theme-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 6px;
    transition: transform 0.3s ease;
    z-index: 1;
}

.theme-btn:hover {
    transform: scale(1.2);
}

.snackbar {
    position: fixed;
    bottom: calc(var(--safe-area-inset-bottom) + 16px);
    left: calc(var(--safe-area-inset-left) + 16px);
    right: calc(var(--safe-area-inset-right) + 16px);
    background: var(--card-bg);
    color: var(--text);
    padding: 12px 16px 16px 16px;
    border-radius: 12px;
    box-shadow: 0 4px 12px var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1100;
    opacity: 0;
    transform: translateY(100px);
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-width: 400px;
    margin: 0 auto;
    overflow: visible;
    will-change: transform, opacity;
    font-family: 'Roboto', sans-serif;
}

.snackbar.show {
    opacity: 1;
    transform: translateY(0);
}

.snackbar-message {
    flex: 1;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 12px;
}

.snackbar::before {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 16px;
    right: 16px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    z-index: 1;
}

.snackbar.show-timer::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 16px;
    width: calc(100% - 32px);
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
    transform-origin: left;
    animation: timer 5s linear forwards;
    z-index: 2;
}

@keyframes timer {
    0% { transform: scaleX(1); }
    100% { transform: scaleX(0); }
}

.dark-theme .snackbar {
    background: var(--dark-card);
    color: var(--dark-text);
    font-family: 'Roboto', sans-serif;
}

.dark-theme .snackbar::before {
    background: var(--dark-border);
}

.dark-theme .snackbar.show-timer::after {
    background: var(--primary);
}

.snackbar-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    font-family: 'Roboto', sans-serif;
}

.snackbar-btn:hover {
    background: rgba(96, 165, 250, 0.1);
    border-radius: 6px;
}

.dark-theme .snackbar-btn {
    color: var(--primary);
    font-family: 'Roboto', sans-serif;
}

.dark-theme .snackbar-btn:hover {
    background: rgba(96, 165, 250, 0.15);
}

.app-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    width: 100%;
}

.app-card {
    display: flex;
    align-items: center;
    padding: 12px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 6px var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}

.dark-theme .app-card {
    background: var(--dark-card);
}

.app-card:hover {
    box-shadow: 0 4px 12px var(--shadow);
    transform: translateY(-2px);
}

.app-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    margin-right: 12px;
    object-fit: contain;
    background: var(--background);
    transition: opacity 0.3s ease;
}

.dark-theme .app-icon {
    background: var(--dark-bg);
}

.app-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.app-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.dark-theme .app-name {
    color: var(--dark-text);
}

.app-package {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: 'Roboto Mono', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dark-theme .app-package {
    color: var(--dark-text-secondary);
}

.loader {
    background: linear-gradient(90deg, var(--surfaceContainer), var(--surfaceContainerHigh), var(--surfaceContainer));
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite linear;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.game-card {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    padding: 12px;
}

.game-actions button {
    pointer-events: auto;
    flex-shrink: 0;
}

.game-header, .game-details {
    user-select: none;
    -webkit-user-select: none;
    gap: 8px;
}

.game-name-container {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.game-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    font-family: 'Poppins', sans-serif;
}

.game-package {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: 'Roboto Mono', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.dark-theme .game-name {
    color: var(--dark-text);
}

.dark-theme .game-package {
    color: var(--dark-text-secondary);
}

.installed-badge {
    display: inline-block;
    background: var(--success);
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
    font-weight: 500;
}

.dark-theme .installed-badge {
    background: var(--success);
}

.game-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.game-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge-group {
    display: flex;
    gap: 6px;
    margin-left: 8px;
}

.dark-theme .game-details {
    color: var(--dark-text-secondary);
}

.game-name-popup {
    display: block;
    font-size: 16px;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    color: var(--text);
    margin-bottom: 4px;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.package-name-popup {
    display: block;
    font-size: 13px;
    font-family: 'Roboto Mono', monospace;
    color: var(--text-secondary);
    word-break: break-all;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.dark-theme .game-name-popup {
    color: var(--dark-text);
}

.dark-theme .package-name-popup {
    color: var(--dark-text-secondary);
}

.popup-icon-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.popup-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.update-icon {
    background: var(--primary);
}

.update-icon::before {
    content: '';
    width: 20px;
    height: 20px;
    background: white;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M4 12a8 8 0 0 1 8-8V2.5M20 12a8 8 0 0 1-8 8v1.5M14 12h6m-6 0H4m0 0l3-3m-3 3l3 3'/%3E%3C/svg%3E") no-repeat center;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M4 12a8 8 0 0 1 8-8V2.5M20 12a8 8 0 0 1-8 8v1.5M14 12h6m-6 0H4m0 0l3-3m-3 3l3 3'/%3E%3C/svg%3E") no-repeat center;
}

.popup-content h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
}

.dark-theme .popup-content h3 {
    color: var(--dark-text);
}

.app-icon-container {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    margin-right: 12px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.app-icon-placeholder {
    width: 100%;
    height: 100%;
    background: var(--surfaceContainer);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.app-icon-placeholder::after {
    content: '';
    width: 24px;
    height: 24px;
    background: var(--text-secondary);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M12 2a10 10 0 1 0 10 10 4 4 0 0 1-5-5 4 4 0 0 1-5-5'%3E%3C/path%3E%3Cpath d='M12 2v4'%3E%3C/path%3E%3Cpath d='M12 18v4'%3E%3C/path%3E%3Cpath d='M4.9 4.9l2.8 2.8'%3E%3C/path%3E%3Cpath d='M16.2 16.2l2.8 2.8'%3E%3C/path%3E%3Cpath d='M2 12h4'%3E%3C/path%3E%3Cpath d='M18 12h4'%3E%3C/path%3E%3Cpath d='M4.9 19.1l2.8-2.8'%3E%3C/path%3E%3Cpath d='M16.2 7.8l2.8-2.8'%3E%3C/path%3E%3C/svg%3E") no-repeat center;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M12 2a10 10 0 1 0 10 10 4 4 0 0 1-5-5 4 4 0 0 1-5-5'%3E%3C/path%3E%3Cpath d='M12 2v4'%3E%3C/path%3E%3Cpath d='M12 18v4'%3E%3C/path%3E%3Cpath d='M4.9 4.9l2.8 2.8'%3E%3C/path%3E%3Cpath d='M16.2 16.2l2.8 2.8'%3E%3C/path%3E%3Cpath d='M2 12h4'%3E%3C/path%3E%3Cpath d='M18 12h4'%3E%3C/path%3E%3Cpath d='M4.9 19.1l2.8-2.8'%3E%3C/path%3E%3Cpath d='M16.2 7.8l2.8-2.8'%3E%3C/path%3E%3C/svg%3E") no-repeat center;
}

.app-icon-loaded {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
    background: var(--background);
}

.dark-theme .app-icon-loaded {
    background: var(--dark-bg);
}

.app-icon-container.load-failed .app-icon-placeholder::after {
    background: var(--error);
}

.app-card.added-game {
    background: rgba(52, 211, 153, 0.1);
}

.device-select-wrapper, .type-select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.device-select-wrapper input, .type-select-wrapper input {
    padding-right: 32px;
    width: 100%;
}

.dropdown-icon {
    position: absolute;
    right: 12px;
    pointer-events: none;
    transition: transform 0.2s ease;
    color: var(--text-secondary);
}

#game-device.highlighted ~ .dropdown-icon,
.type-select-wrapper input.highlighted ~ .dropdown-icon {
    color: var(--primary);
}

.dark-theme .dropdown-icon {
    color: var(--dark-text-secondary);
}

.dark-theme #game-device.highlighted ~ .dropdown-icon,
.dark-theme .type-select-wrapper input.highlighted ~ .dropdown-icon {
    color: var(--primary);
}

.log-actions {
    display: flex;
    gap: 8px;
}

.copy-text, .logcat-text {
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.2s ease;
}

.copy-text:hover, .logcat-text:hover {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.logcat-text {
    border-radius: 4px;
}

.logcat-text:hover {
    background: rgba(96, 165, 250, 0.1);
    border-radius: 4px;
}

.dark-theme .logcat-text {
    color: var(--primary);
}

.dark-theme .logcat-text:hover {
    background: rgba(96, 165, 250, 0.15);
}

#start-logcat {
    color: var(--success);
    background: rgba(52, 211, 153, 0.1);
}

#start-logcat:hover {
    background: rgba(52, 211, 153, 0.2);
}

#stop-logcat {
    color: var(--error);
    background: rgba(248, 113, 113, 0.1);
}

#stop-logcat:hover {
    background: rgba(248, 113, 113, 0.2);
}

.dark-theme #start-logcat {
    background: rgba(52, 211, 153, 0.15);
}

.dark-theme #start-logcat:hover {
    background: rgba(52, 211, 153, 0.25);
}

.dark-theme #stop-logcat {
    background: rgba(248, 113, 113, 0.15);
}

.dark-theme #stop-logcat:hover {
    background: rgba(248, 113, 113, 0.25);
}

.backup-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.backup-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(96, 165, 250, 0.05);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.backup-row:hover {
    background: rgba(96, 165, 250, 0.1);
    transform: translateY(-1px);
}

.dark-theme .backup-row {
    background: rgba(96, 165, 250, 0.08);
}

.dark-theme .backup-row:hover {
    background: rgba(96, 165, 250, 0.12);
}

.backup-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.backup-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.dark-theme .backup-title {
    color: var(--dark-text);
}

.backup-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.dark-theme .backup-desc {
    color: var(--dark-text-secondary);
}

.small-btn {
    padding: 6px 8px;
    min-width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.small-btn svg {
    margin: 0;
}

.popup-body {
    padding: 16px;
    max-height: 60vh;
    overflow-y: auto;
}

.popup-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 16px;
    border-top: 1px solid var(--border);
}

.dark-theme .popup-footer {
    border-color: var(--dark-border);
}

.backup-btn.loading::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.backup-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.backup-btn.loading svg {
    opacity: 0;
}

#file-picker-popup .popup-content {
    max-width: 400px;
    width: 90%;
}

#file-picker-popup .scroll-container {
    min-height: 200px;
    max-height: 300px;
    padding: 8px;
}

#file-picker-popup .app-card {
    padding: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#file-picker-popup .app-card:hover {
    background: rgba(96, 165, 250, 0.1);
    transform: translateY(-1px);
}

.dark-theme #file-picker-popup .app-card:hover {
    background: rgba(96, 165, 250, 0.12);
}

#file-picker-popup .app-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.dark-theme #file-picker-popup .app-name {
    color: var(--dark-text);
}

.breadcrumb-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--card-bg);
    border-radius: 10px;
    margin-bottom: 12px;
    box-shadow: 0 2px 6px var(--shadow);
}

.dark-theme .breadcrumb-container {
    background: var(--dark-card);
}

.breadcrumb-path {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.dark-theme .breadcrumb-path {
    color: var(--dark-text);
}

.back-btn {
    padding: 6px;
    min-width: auto;
    background: var(--primary-gradient);
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark-theme .back-btn {
    background: linear-gradient(135deg, #1E3A8A, #6B7280);
}

.back-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px var(--shadow);
}

.folder-icon::after {
    content: '';
    width: 24px;
    height: 24px;
    background: var(--text-secondary);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z'%3E%3C/path%3E%3C/svg%3E") no-repeat center;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z'/%3E%3C/svg%3E") no-repeat center;
}

.file-icon::after {
    content: '';
    width: 24px;
    height: 24px;
    background: var(--text-secondary);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z'/%3E%3Cpath%3E%3Cpolyline points='13 2 13 9 20 9'/%3E%3C/svg%3E") no-repeat center;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z'/%3E%3Cpath%3E%3Cpolyline points='13 2 13 9 20 9'/%3E%3C/svg%3E") no-repeat center;
}

.dark-theme .folder-icon::after,
.dark-theme .file-icon::after {
    background: var(--dark-text-secondary);
}

#save-log-popup .popup-content {
    max-width: 350px;
    padding: 20px;
    text-align: center;
}

#save-log-popup .popup-content h3 {
    margin-bottom: 12px;
    color: var(--primary);
}

#save-log-popup .popup-content p {
    margin-bottom: 12px;
    color: var(--text);
    line-height: 1.5;
}

#save-log-filename {
    display: block;
    margin-top: 8px;
    padding: 6px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    font-family: 'Roboto Mono', monospace;
    font-size: 13px;
}

.dark-theme #save-log-filename {
    background: rgba(255, 255, 255, 0.05);
}

#save-log-popup .popup-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
}

.dark-theme #save-log-popup .popup-content p {
    color: var(--dark-text);
}

.dark-theme #save-log-filename {
    color: var(--dark-text);
    background: rgba(255, 255, 255, 0.05);
}

.header-actions {
    display: flex;
    gap: 8px;
    z-index: 1;
}

.donate-icon {
    font-size: 18px;
    transition: transform 0.3s ease;
}

#donate-toggle:hover .donate-icon {
    transform: scale(1.2);
}

#donate-popup .popup-content {
    max-width: 500px;
    max-height: 70vh;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#donate-popup .modal-header {
    background: transparent !important;
    color: var(--text) !important;
    padding: 0 0 16px 0 !important;
    margin-bottom: 0 !important;
    border-radius: 0 !important;
    justify-content: center !important;
}

#donate-popup .modal-header h3 {
    color: var(--primary) !important;
    font-size: 17px !important;
    font-weight: 600 !important;
    margin: 0 !important;
}

#donate-popup .popup-content {
    padding: 20px !important;
}

#donate-popup .popup-body {
    padding: 0 !important;
    max-height: none !important;
}

#donate-popup .popup-footer {
    padding: 16px 0 0 0 !important;
    border-top: 1px solid var(--border) !important;
    margin-top: 16px !important;
    justify-content: flex-end !important;
}

.dark-theme #donate-popup .popup-footer {
    border-color: var(--dark-border) !important;
}

#donate-popup .popup-footer .close-donate-btn {
    background: var(--border) !important;
    color: var(--text) !important;
    padding: 10px 20px !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: none !important;
    background-image: none !important;
}

#donate-popup .popup-footer .close-donate-btn:hover {
    background: var(--text-secondary) !important;
    transform: none !important;
    box-shadow: none !important;
}

.dark-theme #donate-popup .popup-footer .close-donate-btn {
    background: var(--dark-border) !important;
    color: var(--dark-text) !important;
}

.dark-theme #donate-popup .popup-footer .close-donate-btn:hover {
    background: var(--dark-text-secondary) !important;
}

#donate-popup .modal-header {
    background: transparent !important;
}

.close-donate-btn {
    background: var(--border) !important;
    color: var(--text) !important;
    box-shadow: none !important;
}

.close-donate-btn:hover {
    background: var(--text-secondary) !important;
    transform: none !important;
    box-shadow: none !important;
}

.dark-theme .close-donate-btn {
    background: var(--dark-border) !important;
    color: var(--dark-text) !important;
}

.dark-theme .close-donate-btn:hover {
    background: var(--dark-text-secondary) !important;
}

#donate-popup .popup-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    max-height: calc(70vh - 120px);
}

.donate-message {
    text-align: center;
    margin-bottom: 20px;
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

.dark-theme .donate-message {
    color: var(--dark-text);
}

.donate-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.donate-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(96, 165, 250, 0.05);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.donate-option:hover {
    background: rgba(96, 165, 250, 0.1);
    transform: translateY(-1px);
}

.dark-theme .donate-option {
    background: rgba(96, 165, 250, 0.08);
}

.dark-theme .donate-option:hover {
    background: rgba(96, 165, 250, 0.12);
}

.crypto-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--surfaceContainer);
}

.dark-theme .crypto-icon {
    background: var(--dark-surfaceContainer);
}

.crypto-icon svg {
    width: 20px;
    height: 20px;
}

.usdt-icon {
    background: #26A17B;
}

.ton-icon {
    background: #0098EA;
}

.trx-icon {
    background: #ff060a;
}

.telegram-icon {
    background: #40B3E0;
}

.donate-info {
    flex: 1;
    min-width: 0;
}

.donate-info h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.dark-theme .donate-info h4 {
    color: var(--dark-text);
}

.donate-address {
    margin: 0;
    font-size: 12px;
    font-family: 'Roboto Mono', monospace;
    color: var(--text-secondary);
    word-break: break-all;
    padding: 4px 0;
    line-height: 1.4;
}

.dark-theme .donate-address {
    color: var(--dark-text-secondary);
}

.copy-btn {
    background: none;
    border: none;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.copy-btn:hover {
    background: rgba(96, 165, 250, 0.1);
    color: var(--primary);
}

.dark-theme .copy-btn {
    color: var(--dark-text-secondary);
}

.dark-theme .copy-btn:hover {
    background: rgba(96, 165, 250, 0.15);
    color: var(--primary);
}

#donate-popup .popup-footer {
    display: flex;
    justify-content: flex-end;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.dark-theme #donate-popup .popup-footer {
    border-color: var(--dark-border);
}

.close-donate-btn {
    background: var(--primary-gradient);
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-donate-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px var(--shadow);
}

.dark-theme .crypto-icon {
    border-radius: 8px !important;
    background: var(--surfaceContainer) !important;
}

.dark-theme .usdt-icon {
    background: #26A17B !important;
}

.dark-theme .ton-icon {
    background: #0098EA !important;
}

.dark-theme .telegram-icon {
    background: #40B3E0 !important;
}

.dark-theme .crypto-icon svg {
    width: 20px !important;
    height: 20px !important;
    transform: none !important;
}

.info-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.info-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.info-btn svg { stroke: #fff; }

#info-popup .popup-content {
    max-width: 800px;
    width: 90vw;
    min-width: 340px;
    max-height: 90vh;
    height: auto;
    min-height: 460px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px var(--shadow);
    background: var(--card-bg) !important;
}

.info-popup-content {
    padding: 20px 20px 0 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: transparent;
}

.popup-footer {
    padding: 16px 20px;
    background: transparent !important;
    border: none !important;
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.popup-footer .close-btn,
.popup-footer .btn-primary {
    background: rgba(59, 130, 246, 0.12) !important;
    color: var(--primary) !important;
    border: 1px solid rgba(59, 130, 246, 0.25) !important;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.popup-footer .close-btn:hover,
.popup-footer .btn-primary:hover {
    background: rgba(59, 130, 246, 0.2) !important;
}

.dark-theme #info-popup .popup-content {
    background: var(--dark-card) !important;
}

.dark-theme .popup-footer .close-btn,
.dark-theme .popup-footer .btn-primary {
    background: rgba(96, 165, 250, 0.15) !important;
    color: #60A5FA !important;
    border-color: rgba(96, 165, 250, 0.3) !important;
}

.dark-theme .popup-footer .close-btn:hover,
.dark-theme .popup-footer .btn-primary:hover {
    background: rgba(96, 165, 250, 0.25) !important;
}

.info-tab-nav {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 4px;
    margin: 16px 0;
    box-shadow: 0 2px 8px var(--shadow);
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    flex-wrap: nowrap;
    min-height: 44px;
}

.info-tab-nav::-webkit-scrollbar { display: none; }

.info-tab-nav .tab-btn {
    flex: 1;
    padding: 10px 8px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
}

.info-tab-container {
    flex: 1;
    overflow: hidden;
    padding: 0 4px;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.info-tab-content {
    display: none;
    height: 100%;
    flex-direction: column;
    overflow: hidden;
}

.info-tab-content.active {
    display: flex;
}

.markdown-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    padding: 16px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 10px;
    border: 1px solid var(--border);
    font-family: 'Roboto Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text);
    word-wrap: break-word;
    white-space: normal;
    box-sizing: border-box;
    margin: 0;
    word-break: break-word;
    overflow-wrap: break-word;
    scrollbar-width: thin;
    scrollbar-color: var(--text-secondary) var(--background);
}

.markdown-container::-webkit-scrollbar {
    width: 8px;
}

.markdown-container::-webkit-scrollbar-thumb {
    background: var(--text-secondary);
    border-radius: 4px;
}

.markdown-container::-webkit-scrollbar-track {
    background: var(--background);
    border-radius: 4px;
}

.markdown-container::-webkit-scrollbar-corner {
    background: var(--background);
}

.markdown-container * { 
    margin: 0 0 8px 0; 
    line-height: 1.6; 
    max-width: 100%;
    overflow-wrap: break-word;
}

.markdown-container h1 { 
    font-size: 18px; 
    margin: 16px 0 8px 0;
}

.markdown-container h2 { 
    font-size: 16px; 
    margin: 16px 0 8px 0;
}

.markdown-container h3 { 
    font-size: 15px; 
    margin: 16px 0 8px 0;
}

.markdown-container h4 { 
    font-size: 14px; 
    margin: 16px 0 8px 0;
}

.markdown-container h1,
.markdown-container h2,
.markdown-container h3,
.markdown-container h4 {
    color: var(--primary);
    font-weight: 600;
    line-height: 1.4;
}

.markdown-container p { 
    margin: 8px 0; 
    max-width: 100%;
    overflow-wrap: break-word;
}

.markdown-container ul,
.markdown-container ol { 
    margin: 10px 0; 
    padding-left: 20px; 
    max-width: 100%;
}

.markdown-container li { 
    margin: 4px 0; 
    line-height: 1.5; 
    max-width: 100%;
    overflow-wrap: break-word;
}

.markdown-container ol { 
    list-style-type: decimal; 
}

.markdown-container ul { 
    list-style-type: disc; 
}

.markdown-container code {
    background: rgba(0, 0, 0, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'Roboto Mono', monospace;
    white-space: pre-wrap;
    max-width: 100%;
    word-break: break-all;
}

.markdown-container pre {
    background: rgba(0, 0, 0, 0.05);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid var(--border);
    margin: 12px 0;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-all;
    max-width: 100%;
}

.markdown-container pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    white-space: pre-wrap;
    word-break: break-all;
}

.markdown-container a {
    color: var(--primary);
    text-decoration: underline;
    cursor: pointer;
    max-width: 100%;
    overflow-wrap: break-word;
}

.markdown-container a:hover {
    color: #3B82F6;
}

.markdown-container blockquote {
    border-left: 4px solid var(--primary);
    margin: 16px 0;
    padding: 8px 16px;
    background: rgba(96, 165, 250, 0.05);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    max-width: 100%;
    overflow-wrap: break-word;
}

.markdown-container blockquote p {
    margin: 0;
    color: var(--text-secondary);
    max-width: 100%;
}

.markdown-container table {
    width: 100% !important;
    max-width: 100% !important;
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    border-collapse: collapse;
}

.markdown-container center,
.markdown-container .center,
.markdown-container .centered,
.markdown-container [align="center"],
.markdown-container [style*="text-align: center"],
.markdown-container [style*="text-align:center"] {
    display: block !important;
    text-align: center !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    margin: 16px 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    text-indent: 0 !important;
}

.centered-text {
    text-align: center !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    margin: 16px 0 !important;
    width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    text-indent: 0 !important;
}

.callout {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 16px 0;
    border-left: 4px solid;
    font-size: 13px;
    line-height: 1.5;
    max-width: 100%;
    overflow-wrap: break-word;
}

.callout-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text);
    max-width: 100%;
}

.callout-header svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.callout-body {
    color: var(--text);
    margin: 0;
    max-width: 100%;
    overflow-wrap: break-word;
}

.callout-body p {
    margin: 0;
    max-width: 100%;
}

.callout-tip { border-left-color: #10B981; }
.callout-note { border-left-color: #3B82F6; }
.callout-warning { border-left-color: #F59E0B; }
.callout-important { border-left-color: #EF4444; }

.about-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    overflow-y: auto;
    padding-right: 4px;
}

.about-grid::-webkit-scrollbar {
    width: 6px;
}

.about-grid::-webkit-scrollbar-thumb {
    background: var(--text-secondary);
    border-radius: 3px;
}

.about-grid::-webkit-scrollbar-track {
    background: transparent;
}

.about-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow);
    flex-shrink: 0;
    animation: cardSlideIn 0.4s ease forwards;
}

.about-card:nth-child(1) { animation-delay: 0.1s; }
.about-card:nth-child(2) { animation-delay: 0.2s; }
.about-card:nth-child(3) { animation-delay: 0.3s; }

.about-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--shadow);
    border-color: var(--primary);
}

.about-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--primary-gradient);
    color: #fff;
}

.about-card-icon.developer-icon {
    background: linear-gradient(135deg, #60A5FA, #3B82F6);
}

.about-card-icon.project-icon {
    background: linear-gradient(135deg, #34D399, #10B981);
}

.about-card-icon.community-icon {
    background: linear-gradient(135deg, #A78BFA, #8B5CF6);
}

.about-card-content h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.about-card .info-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    margin: 2px 0;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
}

.about-card .info-link:hover {
    background: rgba(96, 165, 250, 0.1);
    color: var(--primary);
    transform: translateX(4px);
}

.community-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.link-icon, .btn-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon {
    width: 20px;
    height: 20px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dark-theme .markdown-container {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--dark-border);
    color: var(--dark-text);
    scrollbar-color: var(--dark-text-secondary) var(--dark-bg);
}

.dark-theme .markdown-container::-webkit-scrollbar-thumb {
    background: var(--dark-text-secondary);
}

.dark-theme .markdown-container::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

.dark-theme .markdown-container::-webkit-scrollbar-corner {
    background: var(--dark-bg);
}

.dark-theme .markdown-container pre,
.dark-theme .markdown-container code {
    background: rgba(255, 255, 255, 0.08);
}

.dark-theme .callout {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--dark-border);
}

.dark-theme .callout-header,
.dark-theme .callout-body {
    color: var(--dark-text);
}

.dark-theme .markdown-container blockquote {
    background: rgba(96, 165, 250, 0.08);
}

.dark-theme .about-card {
    background: var(--dark-card);
    border-color: var(--dark-border);
}

.dark-theme .about-card .info-link {
    color: var(--dark-text-secondary);
}

.dark-theme .about-card .info-link:hover {
    background: rgba(96, 165, 250, 0.15);
    color: var(--primary) !important;
}

.dark-theme .about-card-content h4,
.dark-theme .about-card-content p,
.dark-theme .about-card .info-link,
.dark-theme .about-card .app-name,
.dark-theme .about-card .app-package {
    color: var(--dark-text) !important;
}

.dark-theme .about-grid::-webkit-scrollbar-thumb {
    background: var(--dark-text-secondary);
}

#license-content,
#readme-content,
#changelog-content {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

#info-about {
    overflow: hidden;
}

.markdown-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow);
    vertical-align: middle;
}

.markdown-container .centered-text img,
.markdown-container center img,
.markdown-container [align="center"] img {
    display: block;
    margin: 16px auto;
}

.no-tweaks-badge {
    display: inline-block;
    background: var(--warning);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.no-tweaks-badge:hover {
    background: #F59E0B;
    transform: scale(1.05);
}

.cpu-badge {
    display: inline-block;
    background: var(--info);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.cpu-badge:hover {
    background: #3B82F6;
    transform: scale(1.05);
}

.blocked-badge {
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-badge.blocked-badge {
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    margin-left: 4px;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.disable-tweaks-group.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.disable-tweaks-group.disabled .toggle-label {
    color: var(--text-secondary);
}

.disable-tweaks-group.disabled .modal-badge {
    opacity: 0.3;
}

.blocked-badge:hover {
    background: #DC2626;
    transform: scale(1.05);
}

.installed-badge {
    display: inline-block;
    background: var(--success);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.installed-badge:hover {
    background: #10B981;
    transform: scale(1.05);
}

#no-tweaks-popup .popup-content {
    max-width: 320px;
    padding: 0;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

#no-tweaks-popup .popup-header {
    padding: 20px 20px 0 20px;
    margin-bottom: 8px;
}

#no-tweaks-popup .popup-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--primary);
    text-align: center;
}

#no-tweaks-popup .popup-body {
    padding: 0 20px 20px 20px;
    text-align: center;
}

#no-tweaks-popup .popup-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--success);
}

#no-tweaks-popup .popup-icon.icon-remove {
    background: var(--error);
}

#no-tweaks-popup .popup-icon::before {
    content: '';
    width: 24px;
    height: 24px;
    background: white;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") no-repeat center;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") no-repeat center;
}

#no-tweaks-popup .popup-icon.icon-remove::before {
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M18 6L6 18M6 6l12 12'/%3E%3C/svg%3E") no-repeat center;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M18 6L6 18M6 6l12 12'/%3E%3C/svg%3E") no-repeat center;
}

#no-tweaks-popup .popup-package {
    font-family: 'Roboto Mono', monospace;
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 12px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    line-height: 1.4;
    word-break: break-all;
}

#no-tweaks-popup .popup-footer {
    display: flex;
    justify-content: flex-end;
    padding: 16px 20px;
    gap: 8px;
    border-top: 1px solid var(--border);
}

#no-tweaks-popup .popup-btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    min-width: 80px;
}

#no-tweaks-popup .cancel-btn {
    background: var(--border);
    color: var(--text);
}

#no-tweaks-popup .action-btn {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 2px 8px var(--shadow);
}

#no-tweaks-popup .cancel-btn:hover {
    background: var(--text-secondary);
    transform: scale(1.02);
}

#no-tweaks-popup .action-btn:hover {
    background: var(--primary-gradient);
    transform: scale(1.05);
    box-shadow: 0 4px 12px var(--shadow);
}

.dark-theme #no-tweaks-popup .popup-content {
    background: var(--dark-card);
}

.dark-theme #no-tweaks-popup .popup-package {
    background: rgba(255, 255, 255, 0.05);
    color: var(--dark-text-secondary);
}

.dark-theme #no-tweaks-popup .popup-footer {
    border-color: var(--dark-border);
}

.dark-theme #no-tweaks-popup .cancel-btn {
    background: var(--dark-border);
    color: var(--dark-text);
}

.dark-theme #no-tweaks-popup .action-btn {
    background: linear-gradient(135deg, #1E3A8A, #6B7280);
}

.dark-theme #no-tweaks-popup .cancel-btn:hover {
    background: var(--dark-text-secondary);
}

.dark-theme #no-tweaks-popup .action-btn:hover {
    background: var(--primary-gradient);
}

.game-name-popup {
    display: block;
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
}

.package-name-popup {
    display: block;
    font-size: 13px;
    font-family: 'Roboto Mono', monospace;
    color: var(--text-secondary);
    word-break: break-all;
}

#no-tweaks-popup-message {
    color: var(--text);
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 16px;
}

.dark-theme .game-name-popup {
    color: var(--dark-text);
}

.dark-theme .package-name-popup {
    color: var(--dark-text-secondary);
}

.dark-theme #no-tweaks-popup-message {
    color: var(--dark-text);
}

.no-tweaks-explanation-popup .popup-content {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 4px 12px var(--shadow);
    text-align: left;
    transform: scale(0.9);
    opacity: 0;
}

.no-tweaks-explanation-popup .explanation-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--primary);
    margin: 0 0 16px;
}

.no-tweaks-explanation-popup .explanation-text {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 20px;
    line-height: 1.5;
}

.no-tweaks-explanation-popup .highlight {
    color: var(--primary);
    font-weight: 600;
}

.no-tweaks-explanation-popup .important-note {
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid var(--primary);
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
    line-height: 1.4;
}

.no-tweaks-explanation-popup .important-text {
    color: var(--primary);
    font-weight: 600;
}

.no-tweaks-explanation-popup .explanation-text ul {
    margin: 10px 0;
    padding-left: 20px;
}

.no-tweaks-explanation-popup .explanation-text li {
    color: var(--text);
    margin: 4px 0;
}

.no-tweaks-explanation-popup .action-btn {
    background: var(--primary-gradient);
    color: #fff;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    width: 100%;
    box-shadow: 0 4px 12px var(--shadow);
    transition: all 0.3s ease;
}

.no-tweaks-explanation-popup .action-btn:hover {
    background: var(--primary-gradient);
    transform: scale(1.05);
    box-shadow: 0 6px 16px var(--shadow);
}

.dark-theme .no-tweaks-explanation-popup .popup-content {
    background: var(--dark-card);
}

.dark-theme .no-tweaks-explanation-popup .explanation-text {
    color: var(--dark-text);
}

.dark-theme .no-tweaks-explanation-popup .highlight {
    color: var(--primary);
}

.dark-theme .no-tweaks-explanation-popup .important-note {
    background: rgba(96, 165, 250, 0.15);
    border-color: var(--primary);
    color: var(--dark-text);
}

.dark-theme .no-tweaks-explanation-popup .important-text {
    color: var(--primary);
}

.dark-theme .no-tweaks-explanation-popup .explanation-text li {
    color: var(--dark-text);
}

.dark-theme .no-tweaks-explanation-popup .action-btn {
    background: linear-gradient(135deg, #1E3A8A, #6B7280);
}

.dark-theme .no-tweaks-explanation-popup .action-btn:hover {
    background: var(--primary-gradient);
}

.blocked-globally-badge {
    display: inline-block;
    background: var(--error);
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.blocked-globally-badge:hover {
    background: #DC2626;
    transform: scale(1.05);
}

.cpu-only-badge {
    display: inline-block;
    background: #8B5CF6;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cpu-only-badge:hover {
    background: #7C3AED;
    transform: scale(1.05);
}

.cpu-spoof-card {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(167, 139, 250, 0.1));
    border-left: 4px solid;
}

.cpu-spoof-card[data-type="blocked"] {
    border-left-color: var(--error);
}

.cpu-spoof-card[data-type="cpu_only"] {
    border-left-color: #8B5CF6;
}

.dark-theme .cpu-spoof-card {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.15), rgba(167, 139, 250, 0.15));
}

.cpu-spoof-card .info-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.cpu-spoof-card .info-btn:hover {
    background: rgba(96, 165, 250, 0.2);
    transform: scale(1.1);
    color: var(--primary);
}

.dark-theme .cpu-spoof-card .info-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--dark-text-secondary);
}

.dark-theme .cpu-spoof-card .info-btn:hover {
    background: rgba(96, 165, 250, 0.15);
    color: var(--primary);
}

.game-type-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px 0;
}

.game-type-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--card-bg);
    border-radius: 12px;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-type-option:hover {
    border-color: var(--primary);
    background: rgba(96, 165, 250, 0.05);
    transform: translateY(-2px);
}

.game-type-option.selected {
    border-color: var(--primary);
    background: rgba(96, 165, 250, 0.1);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.2);
}

.dark-theme .game-type-option {
    background: var(--dark-card);
    border-color: var(--dark-border);
}

.dark-theme .game-type-option:hover {
    border-color: var(--primary);
    background: rgba(96, 165, 250, 0.1);
}

.dark-theme .game-type-option.selected {
    background: rgba(96, 165, 250, 0.15);
    border-color: var(--primary);
}

.game-type-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.device-icon {
    background: linear-gradient(135deg, #60A5FA, #3B82F6);
    color: white;
}

.cpu-icon {
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
    color: white;
}

.blocked-icon {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
}

.game-type-info {
    flex: 1;
}

.game-type-info h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.dark-theme .game-type-info h4 {
    color: var(--dark-text);
}

.game-type-info p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.dark-theme .game-type-info p {
    color: var(--dark-text-secondary);
}

.device-select-group {
    transition: all 0.3s ease;
}

.device-select-group.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.device-select-group.disabled input {
    background: var(--border);
    color: var(--text-secondary);
}

.dark-theme .device-select-group.disabled input {
    background: var(--dark-border);
    color: var(--dark-text-secondary);
}

.game-type-selector {
    margin: 8px 0;
}

.type-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.type-option {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    text-align: center;
}

.type-option:hover {
    border-color: var(--primary);
    background: rgba(96, 165, 250, 0.05);
    transform: translateY(-2px);
}

.type-option.selected {
    border-color: var(--primary);
    background: rgba(96, 165, 250, 0.1);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.2);
}

.type-option.selected .type-icon {
    transform: scale(1.1);
}

.dark-theme .type-option {
    background: var(--dark-card);
    border-color: var(--dark-border);
    color: var(--dark-text);
}

.dark-theme .type-option:hover {
    border-color: var(--primary);
    background: rgba(96, 165, 250, 0.1);
}

.dark-theme .type-option.selected {
    background: rgba(96, 165, 250, 0.15);
    border-color: var(--primary);
}

.type-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.type-icon svg {
    width: 20px;
    height: 20px;
}

.type-option span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.type-picker-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

.type-picker-card:hover {
    border-color: var(--primary);
    background: rgba(96, 165, 250, 0.05);
    transform: translateY(-2px);
}

.type-picker-card.selected {
    border-color: var(--primary);
    background: rgba(96, 165, 250, 0.1);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.2);
}

.dark-theme .type-picker-card {
    background: var(--dark-card);
    border-color: var(--dark-border);
}

.dark-theme .type-picker-card:hover {
    border-color: var(--primary);
    background: rgba(96, 165, 250, 0.1);
}

.dark-theme .type-picker-card.selected {
    background: rgba(96, 165, 250, 0.15);
    border-color: var(--primary);
}

.type-picker-card .type-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.type-picker-card .type-icon.device-icon {
    background: linear-gradient(135deg, #60A5FA, #3B82F6);
}

.type-picker-card .type-icon.cpu-icon {
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
}

.type-picker-card .type-icon.blocked-icon {
    background: linear-gradient(135deg, #EF4444, #DC2626);
}

.type-picker-card .type-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.type-info {
    flex: 1;
    min-width: 0;
}

.type-info h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.dark-theme .type-info h4 {
    color: var(--dark-text);
}

.type-info p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.dark-theme .type-info p {
    color: var(--dark-text-secondary);
}

.cpu-spoof-explanation-popup .popup-content {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 4px 12px var(--shadow);
    text-align: left;
    transform: scale(0.9);
    opacity: 0;
}

.cpu-spoof-explanation-popup .popup-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.cpu-spoof-explanation-popup .explanation-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cpu-spoof-explanation-popup .explanation-icon.blocked-icon {
    background: linear-gradient(135deg, #EF4444, #DC2626);
}

.cpu-spoof-explanation-popup .explanation-icon.cpu-icon {
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
}

.cpu-spoof-explanation-popup .explanation-icon::before {
    content: '';
    width: 24px;
    height: 24px;
    background: white;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3C/svg%3E") no-repeat center;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3C/svg%3E") no-repeat center;
}

.cpu-spoof-explanation-popup .explanation-icon.cpu-icon::before {
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z'/%3E%3Cpath d='M9 9h6'/%3E%3Cpath d='M9 15h6'/%3E%3Cpath d='M9 12h6'/%3E%3C/svg%3E") no-repeat center;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z'/%3E%3Cpath d='M9 9h6'/%3E%3Cpath d='M9 15h6'/%3E%3Cpath d='M9 12h6'/%3E%3C/svg%3E") no-repeat center;
}

.cpu-spoof-explanation-popup .explanation-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--primary);
    margin: 0;
    flex: 1;
}

.cpu-spoof-explanation-popup .explanation-text {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 20px;
    line-height: 1.5;
}

.cpu-spoof-explanation-popup .explanation-text ul {
    margin: 10px 0;
    padding-left: 20px;
}

.cpu-spoof-explanation-popup .explanation-text li {
    color: var(--text);
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cpu-spoof-explanation-popup .section-title {
    font-weight: 600;
    color: var(--primary);
    margin: 16px 0 8px;
    font-size: 15px;
}

.cpu-spoof-explanation-popup .purpose-list {
    margin: 8px 0;
    padding-left: 20px;
}

.cpu-spoof-explanation-popup .purpose-list li {
    color: var(--text);
    margin: 6px 0;
    position: relative;
    padding-left: 8px;
}

.cpu-spoof-explanation-popup .purpose-list li::before {
    content: '•';
    color: var(--primary);
    font-weight: bold;
    position: absolute;
    left: -12px;
}

.cpu-spoof-explanation-popup .highlight {
    color: var(--primary);
    font-weight: 600;
}

.cpu-spoof-explanation-popup .important-note {
    margin-top: 16px;
    padding: 12px;
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid var(--primary);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

.cpu-spoof-explanation-popup .important-text {
    color: var(--primary);
    font-weight: 600;
}

.cpu-spoof-explanation-popup .popup-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    margin-top: 16px;
}

.cpu-spoof-explanation-popup .action-btn {
    background: var(--primary-gradient);
    color: #fff;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--shadow);
    transition: all 0.3s ease;
    min-width: 100px;
}

.cpu-spoof-explanation-popup .action-btn:hover {
    background: var(--primary-gradient);
    transform: scale(1.05);
    box-shadow: 0 6px 16px var(--shadow);
}

.dark-theme .cpu-spoof-explanation-popup .popup-content {
    background: var(--dark-card);
}

.dark-theme .cpu-spoof-explanation-popup .explanation-text {
    color: var(--dark-text);
}

.dark-theme .cpu-spoof-explanation-popup .explanation-text li {
    color: var(--dark-text);
}

.dark-theme .cpu-spoof-explanation-popup .purpose-list li {
    color: var(--dark-text);
}

.dark-theme .cpu-spoof-explanation-popup .important-note {
    background: rgba(96, 165, 250, 0.15);
    border-color: var(--primary);
    color: var(--dark-text);
}

.dark-theme .cpu-spoof-explanation-popup .highlight {
    color: var(--primary);
}

.dark-theme .cpu-spoof-explanation-popup .popup-footer {
    border-color: var(--dark-border);
}

.dark-theme .cpu-spoof-explanation-popup .action-btn {
    background: linear-gradient(135deg, #1E3A8A, #6B7280);
}

.dark-theme .cpu-spoof-explanation-popup .action-btn:hover {
    background: var(--primary-gradient);
}

.disable-tweaks-group {
    margin-top: 16px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.dark-theme .disable-tweaks-group {
    background: var(--dark-card);
    border-color: var(--dark-border);
}

.disable-tweaks-group.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.toggle-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.toggle-wrapper .toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.dark-theme .toggle-wrapper .toggle-label {
    color: var(--dark-text);
}

.notweak-indicator {
    font-size: 11px;
    padding: 2px 6px;
    background: var(--warning);
    color: white;
    border-radius: 10px;
    font-family: 'Roboto Mono', monospace;
    font-weight: 400;
    opacity: 0.8;
}

.switch.small-switch {
    width: 42px;
    height: 22px;
}

.switch.small-switch .slider {
    border-radius: 22px;
}

.switch.small-switch .slider:before {
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
}

.switch.small-switch input:checked + .slider:before {
    transform: translateX(20px);
}

.switch.small-switch input:disabled + .slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.modal-badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    margin-left: 8px;
    opacity: 0.6;
    transition: all 0.3s ease;
    cursor: default;
    pointer-events: none;
}

.no-tweaks-badge.modal-badge {
    background: var(--warning);
    color: white;
    border: 1px solid #F59E0B;
}

.cpu-badge.modal-badge {
    background: var(--info);
    color: white;
    border: 1px solid #3B82F6;
}

input:checked ~ .slider ~ .toggle-label .modal-badge {
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.badge-container {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
}

.toggle-wrapper .toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    cursor: pointer;
}

.toggle-wrapper .toggle-label span:first-child {
    flex: 1;
    margin-right: 8px;
    font-weight: 500;
    color: var(--text);
}

.dark-theme .toggle-wrapper .toggle-label span:first-child {
    color: var(--dark-text);
}

.disable-tweaks-group.disabled .modal-badge {
    opacity: 0.3 !important;
}

#game-modal .disable-tweaks-group .toggle-wrapper {
    padding: 8px 0;
    margin: 4px 0;
}

#game-modal .disable-tweaks-group .toggle-label {
    font-size: 13px;
    line-height: 1.3;
}

#game-modal .disable-tweaks-group .toggle-label span:first-child {
    font-weight: 500;
    color: var(--text);
}

#game-modal .modal-badge {
    font-size: 10px;
    padding: 2px 6px;
    margin-left: 6px;
    height: 18px;
    display: inline-flex;
    align-items: center;
}

#game-modal .small-switch {
    width: 36px;
    height: 18px;
    min-width: 36px;
}

#game-modal .small-switch .slider:before {
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
}

#game-modal .small-switch input:checked + .slider:before {
    transform: translateX(18px);
}

#game-modal .disable-tweaks-group {
    margin: 4px 0;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

#game-modal .disable-tweaks-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

#game-modal .toggle-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 32px;
}

#game-modal .badge-container {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
}

#game-modal .form-group label {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}

#game-modal input[type="text"] {
    font-size: 14px;
    padding: 10px 12px;
    height: 40px;
}

#game-modal .disable-tweaks-group {
    margin: 6px 0;
    padding: 6px 0;
}

#game-modal .modal-content {
    max-height: 85vh;
    overflow-y: auto;
}

#game-modal .modal-content .scroll-container {
    max-height: 60vh;
}

#game-modal .form-group {
    margin-bottom: 12px;
}

#game-modal .form-buttons {
    margin-top: 16px;
    padding-top: 16px;
}

#game-modal .disable-tweaks-group {
    margin: 4px 0;
    padding: 8px 12px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.dark-theme #game-modal .disable-tweaks-group {
    background: var(--dark-card);
    border-color: var(--dark-border);
}

#game-modal .disable-tweaks-group .toggle-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    min-height: 32px;
    margin: 0;
}

#game-modal .disable-tweaks-group .toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    flex: 1;
}

#game-modal .disable-tweaks-group .small-switch {
    width: 36px;
    height: 18px;
    min-width: 36px;
    margin: 0;
}

#game-modal #disable-tweaks-container,
#game-modal #cpu-spoof-container,
#game-modal #block-cpu-container {
    margin-bottom: 8px;
}

#game-modal #block-cpu-container {
    margin-bottom: 0;
}

@media (max-width: 480px) {
    .info-popup-content {
        padding: 16px 16px 0 16px;
    }
    
    .popup-footer {
        padding: 12px 16px;
    }
    
    #info-popup .popup-content {
        min-height: 460px;
        max-height: 88vh;
    }
    
    .markdown-container {
        padding: 12px;
        font-size: 12px;
    }
    
    .markdown-container pre {
        font-size: 11px;
    }
}

@media (max-width: 380px) {
    .info-tab-nav .tab-btn {
        font-size: 12px;
        padding: 10px 4px;
    }
}

@media (max-width: 600px) and (orientation: landscape) {
    #info-popup .popup-content {
        max-height: 85vh;
    }
}

@media (max-height: 700px) {
    #info-popup .popup-content {
        min-height: 460px;
        max-height: 88vh;
    }
}

@media (max-height: 600px) {
    #info-popup .popup-content {
        min-height: 440px;
        max-height: 88vh;
    }
    
    .about-card {
        padding: 12px;
        gap: 10px;
    }
    
    .about-card-icon {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    #info-popup .popup-content {
        width: 94vw;
        max-width: 94vw;
        min-width: 300px;
        min-height: 460px;
        max-height: 88vh;
    }
}

#game-modal .toggle-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 32px;
    width: 100%;
    gap: 8px;
}

#game-modal .toggle-label {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    overflow: hidden;
}

#game-modal .toggle-label span:first-child {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    margin-right: 4px;
}

#game-modal .badge-container {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    flex-shrink: 0;
}

@media (max-width: 380px) {
    #game-modal .toggle-label span:first-child {
        font-size: 12px;
    }
    
    #game-modal .modal-badge {
        font-size: 9px;
        padding: 1px 4px;
    }
}

.dark-theme #game-modal .toggle-label {
    color: var(--dark-text) !important;
}

.dark-theme #game-modal .toggle-label span:first-child {
    color: var(--dark-text) !important;
}

.dark-theme #game-modal .form-group label {
    color: var(--dark-text) !important;
}

.dark-theme #game-modal .disable-tweaks-group .toggle-label {
    color: var(--dark-text) !important;
}

.dark-theme .modal-badge {
    color: white !important;
}

.dark-theme .no-tweaks-badge.modal-badge {
    background: var(--warning) !important;
    border-color: #F59E0B !important;
}

.dark-theme .cpu-badge.modal-badge {
    background: var(--info) !important;
    border-color: #3B82F6 !important;
}

.dark-theme .blocked-badge.modal-badge {
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.dark-theme #game-modal input[type="text"] {
    color: var(--dark-text) !important;
}

.dark-theme #game-modal input[type="text"]::placeholder {
    color: var(--dark-text-secondary) !important;
}

.dark-theme .type-select-wrapper .dropdown-icon,
.dark-theme .device-select-wrapper .dropdown-icon {
    color: var(--dark-text-secondary) !important;
}

.dark-theme .type-select-wrapper input.highlighted ~ .dropdown-icon,
.dark-theme .device-select-wrapper input.highlighted ~ .dropdown-icon {
    color: var(--primary) !important;
}

#package-picker-popup .modal-header h3 {
    color: var(--primary);
}

.dark-theme #package-picker-popup .modal-header h3 {
    color: var(--primary);
}

.app-card.blocked-game {
    background: rgba(248, 113, 113, 0.1) !important;
    border: 1px solid rgba(248, 113, 113, 0.2) !important;
    position: relative;
    overflow: hidden;
}

.app-card.blocked-game::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--error);
    border-radius: 12px 0 0 12px;
}

.app-card.blocked-game:hover {
    background: rgba(248, 113, 113, 0.15) !important;
    border-color: rgba(248, 113, 113, 0.3) !important;
}

.dark-theme .app-card.blocked-game {
    background: rgba(248, 113, 113, 0.08) !important;
    border-color: rgba(248, 113, 113, 0.15) !important;
}

.dark-theme .app-card.blocked-game::before {
    background: var(--error);
}

.dark-theme .app-card.blocked-game:hover {
    background: rgba(248, 113, 113, 0.12) !important;
    border-color: rgba(248, 113, 113, 0.25) !important;
}

.app-card.cpuonly-game {
    background: rgba(139, 92, 246, 0.1) !important;
    border: 1px solid rgba(139, 92, 246, 0.2) !important;
    position: relative;
    overflow: hidden;
}

.app-card.cpuonly-game::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #8B5CF6;
    border-radius: 12px 0 0 12px;
}

.app-card.cpuonly-game:hover {
    background: rgba(139, 92, 246, 0.15) !important;
    border-color: rgba(139, 92, 246, 0.3) !important;
}

.dark-theme .app-card.cpuonly-game {
    background: rgba(139, 92, 246, 0.08) !important;
    border-color: rgba(139, 92, 246, 0.15) !important;
}

.dark-theme .app-card.cpuonly-game::before {
    background: #8B5CF6;
}

.dark-theme .app-card.cpuonly-game:hover {
    background: rgba(139, 92, 246, 0.12) !important;
    border-color: rgba(139, 92, 246, 0.25) !important;
}

.app-card.added-game.cpuonly-game {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.1), rgba(139, 92, 246, 0.1)) !important;
    border: 1px solid rgba(139, 92, 246, 0.3) !important;
}

.app-card.added-game.cpuonly-game::before {
    background: linear-gradient(to bottom, var(--success) 50%, #8B5CF6 50%);
}

.app-card.added-game.cpuonly-game:hover {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.15), rgba(139, 92, 246, 0.15)) !important;
}

.dark-theme .app-card.added-game.cpuonly-game {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.08), rgba(139, 92, 246, 0.08)) !important;
    border-color: rgba(139, 92, 246, 0.2) !important;
}

.dark-theme .app-card.added-game.cpuonly-game:hover {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.12), rgba(139, 92, 246, 0.12)) !important;
}

.app-card.blocked-game {
    background: rgba(248, 113, 113, 0.1) !important;
    border: 1px solid rgba(248, 113, 113, 0.2) !important;
    position: relative;
    overflow: hidden;
}

.app-card.blocked-game::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--error);
    border-radius: 12px 0 0 12px;
}

.app-card.blocked-game:hover {
    background: rgba(248, 113, 113, 0.15) !important;
    border-color: rgba(248, 113, 113, 0.3) !important;
}

.dark-theme .app-card.blocked-game {
    background: rgba(248, 113, 113, 0.08) !important;
    border-color: rgba(248, 113, 113, 0.15) !important;
}

.dark-theme .app-card.blocked-game::before {
    background: var(--error);
}

.dark-theme .app-card.blocked-game:hover {
    background: rgba(248, 113, 113, 0.12) !important;
    border-color: rgba(248, 113, 113, 0.25) !important;
}

.app-card.added-game {
    background: rgba(52, 211, 153, 0.1) !important;
    border: 1px solid rgba(52, 211, 153, 0.2) !important;
    position: relative;
    overflow: hidden;
}

.app-card.added-game::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--success);
    border-radius: 12px 0 0 12px;
}

.app-card.added-game:hover {
    background: rgba(52, 211, 153, 0.15) !important;
    border-color: rgba(52, 211, 153, 0.3) !important;
}

.dark-theme .app-card.added-game {
    background: rgba(52, 211, 153, 0.08) !important;
    border-color: rgba(52, 211, 153, 0.15) !important;
}

.dark-theme .app-card.added-game::before {
    background: var(--success);
}

.dark-theme .app-card.added-game:hover {
    background: rgba(52, 211, 153, 0.12) !important;
    border-color: rgba(52, 211, 153, 0.25) !important;
}

.sort-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
}

.sort-btn svg {
    width: 20px;
    height: 20px;
    stroke: #fff;
}

.sort-dropdown {
    position: absolute;
    top: 50px;
    right: 12px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 16px var(--shadow);
    z-index: 100;
    min-width: 140px;
    overflow: hidden;
    border: 1px solid var(--border);
    display: none;
    animation: dropdownFade 0.2s ease;
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sort-dropdown.show {
    display: block;
}

.sort-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border);
}

.sort-option:last-child {
    border-bottom: none;
}

.sort-option:hover {
    background: rgba(96, 165, 250, 0.1);
}

.sort-option.active {
    background: rgba(96, 165, 250, 0.15);
    color: var(--primary);
}

.sort-option.active svg {
    stroke: var(--primary);
}

.sort-option svg {
    width: 16px;
    height: 16px;
    stroke: var(--text);
}

.sort-option span {
    font-size: 14px;
    font-weight: 500;
}

.dark-theme .sort-dropdown {
    background: var(--dark-card);
    border-color: var(--dark-border);
    box-shadow: 0 4px 16px var(--dark-shadow);
}

.dark-theme .sort-option {
    border-color: var(--dark-border);
    color: var(--dark-text);
}

.dark-theme .sort-option:hover {
    background: rgba(96, 165, 250, 0.15);
}

.dark-theme .sort-option.active {
    background: rgba(96, 165, 250, 0.2);
    color: var(--primary);
}

.dark-theme .sort-option svg {
    stroke: var(--dark-text);
}

.dark-theme .sort-option.active svg {
    stroke: var(--primary);
}

.required-badge {
    font-size: 0.7em;
    color: #EF4444;
    background-color: rgba(239, 68, 68, 0.1);
    padding: 1px 6px;
    border-radius: 6px;
    margin-left: 4px;
    font-weight: 600;
    display: inline-block;
    text-transform: lowercase;
    letter-spacing: 0.3px;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.dark-theme .required-badge {
    color: #F87171;
    background-color: rgba(248, 113, 113, 0.15);
    border-color: rgba(248, 113, 113, 0.3);
}

.required-badge:hover {
    background-color: rgba(239, 68, 68, 0.2);
    transition: background-color 0.2s ease;
}

.dark-theme .required-badge:hover {
    background-color: rgba(248, 113, 113, 0.25);
}

.optional-badge {
    font-size: 0.7em;
    color: #60A5FA;
    background-color: rgba(96, 165, 250, 0.1);
    padding: 1px 6px;
    border-radius: 6px;
    margin-left: 4px;
    font-weight: 600;
    display: inline-block;
    text-transform: lowercase;
    letter-spacing: 0.3px;
    border: 1px solid rgba(96, 165, 250, 0.2);
}

.dark-theme .optional-badge {
    color: #93C5FD;
    background-color: rgba(147, 197, 253, 0.15);
    border-color: rgba(147, 197, 253, 0.3);
}

.optional-badge:hover {
    background-color: rgba(96, 165, 250, 0.2);
    transition: background-color 0.2s ease;
}

.dark-theme .optional-badge:hover {
    background-color: rgba(147, 197, 253, 0.25);
}

#device-sort-dropdown {
    z-index: 101;
}

.sort-option[data-filter="blocklist"] svg {
    stroke: var(--error);
}

.sort-option[data-filter="cpu_only"] svg {
    fill: #8B5CF6;
    stroke: #8B5CF6;
}

.sort-option[data-filter="installed"] svg {
    stroke: var(--success);
}

.sort-option[data-filter="no_tweaks"] svg {
    stroke: var(--warning);
}

.sort-option[data-filter="blocklist"].active {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.sort-option[data-filter="cpu_only"].active {
    background: rgba(139, 92, 246, 0.1);
    color: #8B5CF6;
}

.sort-option[data-filter="installed"].active {
    background: rgba(52, 211, 153, 0.1);
    color: var(--success);
}

.sort-option[data-filter="no_tweaks"].active {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.sort-option[data-filter="clear"] svg {
    stroke: var(--text-secondary);
}

.sort-option[data-filter="clear"]:hover svg {
    stroke: var(--text-primary);
}

.sort-separator {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

.dark-theme .sort-separator {
    background: var(--dark-border);
}

.filter-badge {
    margin-left: auto;
    font-size: 12px;
    background: var(--surfaceContainer);
    color: var(--text);
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.dark-theme .filter-badge {
    background: var(--dark-surfaceContainer);
    color: var(--dark-text);
}

.sort-option[data-filter].active {
    background: rgba(96, 165, 250, 0.15);
    color: var(--primary);
}

.sort-option[data-filter].active svg {
    stroke: var(--primary);
}

.sort-option[data-filter].active .filter-badge {
    background: var(--primary);
    color: white;
}

.dark-theme .sort-option[data-filter].active {
    background: rgba(96, 165, 250, 0.2);
}

.dark-theme .sort-option[data-filter].active .filter-badge {
    background: var(--primary);
    color: white;
}

#clear-filter-btn {
    background: rgba(248, 113, 113, 0.1);
    color: var(--error);
    margin-top: 8px;
    border-top: 1px solid var(--border);
    border-radius: 0 0 12px 12px;
}

#clear-filter-btn:hover {
    background: rgba(248, 113, 113, 0.2);
}

.dark-theme #clear-filter-btn {
    background: rgba(248, 113, 113, 0.15);
    border-color: var(--dark-border);
}

.dark-theme #clear-filter-btn:hover {
    background: rgba(248, 113, 113, 0.25);
}

.with-cpu-badge {
    display: inline-block;
    background: linear-gradient(135deg, #60A5FA 0%, #8B5CF6 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 4px rgba(96, 165, 250, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
}

.with-cpu-badge:hover {
    background: linear-gradient(135deg, #3B82F6 0%, #7C3AED 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(96, 165, 250, 0.3);
}

.blocked-cpu-badge {
    background: linear-gradient(135deg, #F59E0B 0%, #DC2626 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
}

.blocked-cpu-badge:hover {
    background: linear-gradient(135deg, #D97706 0%, #B91C1C 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
}

.cpu-explanation-popup .popup-content {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 4px 12px var(--shadow);
    text-align: left;
    transform: scale(0.9);
    opacity: 0;
}

.cpu-explanation-popup .explanation-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--primary);
    margin: 0 0 16px;
    text-align: center;
}

.cpu-explanation-popup .explanation-text {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 20px;
    line-height: 1.5;
}

.cpu-explanation-popup .explanation-text ul {
    margin: 12px 0;
    padding-left: 20px;
}

.cpu-explanation-popup .explanation-text li {
    color: var(--text);
    margin: 8px 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.cpu-explanation-popup .explanation-text li strong {
    font-weight: 600;
}

.cpu-explanation-popup .highlight {
    color: var(--primary);
    font-weight: 600;
}

.cpu-explanation-popup .important-note {
    margin-top: 16px;
    padding: 10px 12px;
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid var(--primary);
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
    line-height: 1.4;
}

.cpu-explanation-popup .warning-note {
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--warning);
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
    line-height: 1.4;
}

.cpu-explanation-popup .important-text {
    color: var(--primary);
    font-weight: 600;
}

.cpu-explanation-popup .action-btn {
    background: var(--primary-gradient);
    color: #fff;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    width: 100%;
    box-shadow: 0 4px 12px var(--shadow);
    transition: all 0.3s ease;
    margin-top: 16px;
}

.cpu-explanation-popup .action-btn:hover {
    background: var(--primary-gradient);
    transform: scale(1.05);
    box-shadow: 0 6px 16px var(--shadow);
}

.dark-theme .cpu-explanation-popup .popup-content {
    background: var(--dark-card);
}

.dark-theme .cpu-explanation-popup .explanation-text {
    color: var(--dark-text);
}

.dark-theme .cpu-explanation-popup .explanation-text li {
    color: var(--dark-text);
}

.dark-theme .cpu-explanation-popup .important-note {
    background: rgba(96, 165, 250, 0.15);
    border-color: var(--primary);
    color: var(--dark-text);
}

.dark-theme .cpu-explanation-popup .warning-note {
    background: rgba(245, 158, 11, 0.15);
    border-color: var(--warning);
    color: var(--dark-text);
}

.dark-theme .cpu-explanation-popup .action-btn {
    background: linear-gradient(135deg, #1E3A8A, #6B7280);
}

.dark-theme .cpu-explanation-popup .action-btn:hover {
    background: var(--primary-gradient);
}

.dark-theme .with-cpu-badge {
    box-shadow: 0 2px 4px rgba(96, 165, 250, 0.3);
}

.dark-theme .blocked-cpu-badge {
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.modal-badge {
    display: inline-block;
    padding: 2px 6px !important;
    border-radius: 10px !important;
    font-size: 9px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.2px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    transition: all 0.3s ease !important;
    margin-left: 6px !important;
    height: 16px !important;
    line-height: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
}

.no-tweaks-badge.modal-badge {
    background: var(--warning) !important;
    color: white !important;
    border-color: #F59E0B !important;
}

.with-cpu-badge.modal-badge {
    background: linear-gradient(135deg, #60A5FA 0%, #8B5CF6 100%) !important;
    color: white !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.blocked-cpu-badge.modal-badge {
    background: linear-gradient(135deg, #F59E0B 0%, #DC2626 100%) !important;
    color: white !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.dark-theme .modal-badge {
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 0;
}

.search-input-wrapper input {
    width: 100%;
    padding: 10px 44px 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    background: var(--background);
    color: var(--text);
    transition: all 0.3s ease;
}

.search-input-wrapper .sort-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    padding: 0;
    background: rgba(96, 165, 250, 0.1);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2;
}

.search-input-wrapper .sort-btn:hover {
    background: rgba(96, 165, 250, 0.2);
    transform: translateY(-50%) scale(1.05);
}

.search-input-wrapper .sort-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.search-input-wrapper .sort-btn svg {
    width: 18px;
    height: 18px;
    stroke: var(--primary);
}

.dark-theme .search-input-wrapper input {
    background: var(--dark-bg);
    border-color: var(--dark-border);
    color: var(--dark-text);
}

.dark-theme .search-input-wrapper .sort-btn {
    background: rgba(96, 165, 250, 0.15);
}

.dark-theme .search-input-wrapper .sort-btn:hover {
    background: rgba(96, 165, 250, 0.25);
}

.search-input-wrapper input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 8px rgba(96, 165, 250, 0.3);
}

.search-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 4px 12px var(--shadow);
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.sort-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 16px var(--shadow);
    z-index: 100;
    min-width: 140px;
    overflow: hidden;
    border: 1px solid var(--border);
    display: none;
    animation: dropdownFade 0.2s ease;
}

@media (max-width: 480px) {
    .search-input-wrapper input {
        padding: 10px 40px 10px 12px;
        font-size: 14px;
    }
    
    .search-input-wrapper .sort-btn {
        width: 30px;
        height: 30px;
        right: 4px;
    }
    
    .search-input-wrapper .sort-btn svg {
        width: 16px;
        height: 16px;
    }
}

.suggested-value {
    border-color: #10B981 !important;
    background-color: rgba(16, 185, 129, 0.05) !important;
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.2) !important;
}

.dark-theme .suggested-value {
    background-color: rgba(16, 185, 129, 0.1) !important;
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.3) !important;
}
