:root {
    --app-bg: #F4F6FB;
    --app-card: #FFFFFF;
    --app-card-alt: #EDF0F7;
    --app-border: #E2E8F0;
    --app-border-hover: #A855F7;
    --app-text: #0F172A;
    --app-text-muted: #64748B;
    --pixel-accent: #7C3AED;
    --pixel-accent-hover: #6D28D9;
    --pixel-shadow: rgba(124, 58, 237, 0.08);
    --pixel-bevel-light: #FFFFFF;
    --pixel-bevel-dark: #E2E8F0;
    --pixel-outer-shadow: rgba(15, 23, 42, 0.05);
    --pixel-success: #10B981;
    --pixel-danger: #EF4444;
}

html.dark {
    --app-bg: #0B0811;
    --app-card: #140E20;
    --app-card-alt: #1F1530;
    --app-border: #382454;
    --app-border-hover: #A855F7;
    --app-text: #F7F4FC;
    --app-text-muted: #9D8BAE;
    --pixel-accent: #A855F7;
    --pixel-accent-hover: #C084FC;
    --pixel-shadow: #382454;
    --pixel-bevel-light: #523778;
    --pixel-bevel-dark: #050308;
    --pixel-outer-shadow: #050308;
    --pixel-success: #22C55E;
    --pixel-danger: #F43F5E;
}


*, *::before, *::after {
    box-sizing: border-box;
}


.rounded-full, [class*="rounded-full"] { border-radius: 9999px !important; }
.rounded-3xl, [class*="rounded-3xl"] { border-radius: 1.5rem !important; }
.rounded-2xl, [class*="rounded-2xl"] { border-radius: 1rem !important; }
.rounded-xl, [class*="rounded-xl"] { border-radius: 0.75rem !important; }
.rounded-lg, [class*="rounded-lg"] { border-radius: 0.5rem !important; }


.font-mono, #display-balance, [inputmode="numeric"], input, select, textarea, table, pre, code {
    font-family: 'JetBrains Mono', monospace !important;
}


h1, h2, h3, h4, .pixel-font, .font-pixel, .nav-btn span, .badge, [data-tab] span, #modal-card-title, #admin-panel-title {
    font-family: 'Silkscreen', monospace;
    letter-spacing: 0.04em;
}

body { 
    font-family: 'JetBrains Mono', monospace; 
    background-color: var(--app-bg); 
    color: var(--app-text); 
    -webkit-tap-highlight-color: transparent; 
    background-image: 
        linear-gradient(to right, rgba(122, 34, 226, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(122, 34, 226, 0.03) 1px, transparent 1px);
    background-size: 16px 16px;
    transition: background-color 0.25s ease, color 0.25s ease;
}

html.dark body {
    background-image: 
        linear-gradient(to right, rgba(168, 85, 247, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(168, 85, 247, 0.04) 1px, transparent 1px);
    background-size: 16px 16px;
}


button, a, input, select, textarea, .pixel-box, .pixel-card, .credit-card {
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}


.pixel-box {
    border: 2px solid var(--app-border) !important;
    border-radius: 16px;
    box-shadow: 2px 2px 0 var(--pixel-outer-shadow), 4px 4px 0 var(--pixel-outer-shadow);
}

.pixel-box:hover {
    border-color: var(--pixel-accent-hover) !important;
}

.pixel-box-lg {
    border: 2px solid var(--app-border) !important;
    border-radius: 24px;
    box-shadow: 3px 3px 0 var(--pixel-outer-shadow), 6px 6px 0 var(--pixel-outer-shadow);
}

.pixel-card {
    border: 2px solid var(--app-border) !important;
    background-color: var(--app-card) !important;
    border-radius: 20px;
    box-shadow: 2px 2px 0 var(--pixel-outer-shadow), 4px 4px 0 var(--pixel-outer-shadow);
    position: relative;
}

.pixel-card:hover {
    border-color: var(--pixel-accent-hover) !important;
    transform: translateY(-2px);
    box-shadow: 2px 4px 0 var(--pixel-accent-hover), 4px 8px 0 var(--pixel-outer-shadow);
}


button, .pixel-btn, a[role="button"] {
    font-family: 'Silkscreen', monospace;
    border-radius: 12px;
}

button:active:not(:disabled), .pixel-btn:active:not(:disabled) {
    transform: scale(0.97) translateY(1px) !important;
}


input, select, textarea {
    border: 2px solid var(--app-border) !important;
    background-color: var(--app-card) !important;
    color: var(--app-text) !important;
    outline: none !important;
    border-radius: 12px;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--pixel-accent) !important;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2) !important;
}

input::placeholder, textarea::placeholder {
    color: var(--app-text-muted) !important;
    opacity: 0.75;
}


html:not(.dark) .text-white {
    color: var(--app-text) !important;
}

html:not(.dark) .iris-gradient,
html:not(.dark) .iris-gradient *,
html:not(.dark) .rainbow-gradient,
html:not(.dark) .rainbow-gradient *,
html:not(.dark) .credit-card,
html:not(.dark) .credit-card *,
html:not(.dark) .ipay-physical-card,
html:not(.dark) .ipay-physical-card *,
html:not(.dark) #profile-avatar,
html:not(.dark) #profile-avatar *,
html:not(.dark) .game-circle,
html:not(.dark) .game-circle *,
html:not(.dark) .clicker-btn,
html:not(.dark) .clicker-btn *,
html:not(.dark) [class*="bg-iris-"],
html:not(.dark) [class*="bg-iris-"] *,
html:not(.dark) [class*="bg-purple-600"],
html:not(.dark) [class*="bg-purple-600"] *,
html:not(.dark) [class*="bg-red-600"],
html:not(.dark) [class*="bg-red-600"] *,
html:not(.dark) [class*="bg-emerald-600"],
html:not(.dark) [class*="bg-emerald-600"] *,
html:not(.dark) [class*="bg-blue-600"],
html:not(.dark) [class*="bg-blue-600"] *,
html:not(.dark) .keep-white,
html:not(.dark) .keep-white * {
    color: #FFFFFF !important;
}

html:not(.dark) .text-slate-400,
html:not(.dark) .text-slate-500 {
    color: var(--app-text-muted) !important;
}

html:not(.dark) .bg-dark-bg {
    background-color: var(--app-bg) !important;
}

html:not(.dark) .bg-dark-card {
    background-color: var(--app-card) !important;
}

html:not(.dark) .border-dark-border {
    border-color: var(--app-border) !important;
}

html:not(.dark) .bg-\[\#2A2D3D\],
html:not(.dark) .bg-\[\#1F1530\],
html:not(.dark) .bg-\[\#151824\],
html:not(.dark) .bg-\[\#171A27\] {
    background-color: var(--app-card-alt) !important;
    color: var(--app-text) !important;
}


.iris-gradient {
    background: linear-gradient(135deg, #7A22E2 0%, #A855F7 100%) !important;
    color: #FFFFFF !important;
    border: 2px solid var(--app-border) !important;
    box-shadow: 0 4px 15px rgba(122, 34, 226, 0.3) !important;
    border-radius: 14px;
}

.iris-gradient, .iris-gradient * {
    color: #FFFFFF !important;
}

.iris-gradient:hover {
    filter: brightness(1.08);
    box-shadow: 0 6px 20px rgba(122, 34, 226, 0.45) !important;
}

.glass-panel {
    background: var(--app-card) !important;
    border-color: var(--app-border) !important;
    box-shadow: 0 -4px 12px var(--pixel-outer-shadow);
}


.credit-card {
    position: relative;
    cursor: pointer;
    border-radius: 28px !important;
    border: 2px solid rgba(255, 255, 255, 0.25) !important;
    background: linear-gradient(135deg, #7A22E2 0%, #9B4DF8 50%, #623CEA 100%) !important;
    box-shadow: 0 16px 36px -5px rgba(124, 58, 237, 0.45) !important;
    overflow: hidden;
}

.credit-card:hover {
    transform: translateY(-4px) scale(1.01) !important;
    box-shadow: 0 20px 42px -5px rgba(124, 58, 237, 0.6) !important;
}

.credit-card:active {
    transform: scale(0.98) !important;
}

.credit-card * {
    color: #FFFFFF !important;
}

.card-copy-success {
    animation: cardSuccessPulse 0.4s ease-in-out forwards !important;
}

@keyframes cardSuccessPulse {
    0% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.03); filter: brightness(1.3); }
    100% { transform: scale(1); filter: brightness(1); }
}


.pixel-badge {
    font-family: 'Silkscreen', monospace;
    font-size: 10px;
    text-transform: uppercase;
    padding: 3px 10px;
    border: 1px solid var(--app-border);
    background-color: var(--app-card-alt);
    color: var(--pixel-accent);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}


.spa-screen, .tab-content { 
    display: none; 
    opacity: 0; 
}
.spa-screen.active, .tab-content.active { 
    display: flex; 
    opacity: 1; 
    animation: smoothFadeIn 0.25s ease-out forwards; 
}


.custom-scrollbar::-webkit-scrollbar { 
    width: 8px; 
    height: 8px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: var(--app-bg);
    border-left: 1px solid var(--app-border);
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--pixel-accent);
    border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--pixel-accent-hover);
}


.game-circle {
    position: absolute; 
    width: 56px; 
    height: 56px; 
    border-radius: 9999px !important;
    background: linear-gradient(135deg, #7A22E2 0%, #A855F7 100%);
    border: 3px solid #FFFFFF;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(168, 85, 247, 0.5);
    animation: smoothPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards; 
    transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.game-circle:hover {
    transform: scale(1.1);
}
.game-circle:active { 
    transform: scale(0.92); 
}

.clicker-btn { 
    border-radius: 9999px !important;
    border: 4px solid var(--app-border) !important;
    background: linear-gradient(135deg, #7A22E2 0%, #EC4899 100%) !important;
    box-shadow: 0 10px 30px rgba(236, 72, 153, 0.4) !important;
    cursor: pointer; 
    font-family: 'Silkscreen', monospace !important;
    transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.15s cubic-bezier(0.16, 1, 0.3, 1) !important;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.clicker-btn:hover {
    transform: scale(1.04);
    box-shadow: 0 14px 40px rgba(236, 72, 153, 0.55) !important;
}
.clicker-btn:active { 
    transform: scale(0.95) !important; 
}


.timer-backdrop {
    backdrop-filter: blur(14px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(14px) saturate(150%) !important;
    background: rgba(11, 8, 17, 0.72) !important;
}
html:not(.dark) .timer-backdrop {
    background: rgba(255, 255, 255, 0.78) !important;
}
html:not(.dark) .timer-backdrop span {
    color: #1e293b !important;
}


.ipay-check {
    width: 88px; 
    height: 88px; 
    border-radius: 9999px !important;
    display: grid; 
    place-items: center;
    background: linear-gradient(135deg, #7A22E2 0%, #A855F7 100%);
    border: 3px solid var(--app-border);
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.5);
    position: relative; 
    opacity: 0; 
    transform: scale(0.6);
}
.ipay-check svg { width: 48px; height: 48px; }
.ipay-check-mark {
    fill: none; 
    stroke: #FFFFFF;
    stroke-dasharray: 100; 
    stroke-dashoffset: 100;
    stroke-linecap: round; 
    stroke-linejoin: round;
    opacity: 0;
}
.ipay-success-active .ipay-check { 
    animation: smoothPopIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards; 
}
.ipay-success-active .ipay-check-mark { 
    animation: ipayDraw 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards; 
}

@keyframes ipayDraw {
    0% { opacity: 1; stroke-dashoffset: 100; }
    100% { opacity: 1; stroke-dashoffset: 0; }
}

.ipay-view { animation: smoothFadeIn 0.25s ease-out both; }
.ipay-view.ipay-leaving { animation: smoothPopIn 0.2s ease-in reverse both; pointer-events: none; }

.ipay-method-tile { 
    border: 2px solid var(--app-border) !important;
    background-color: var(--app-card) !important;
    box-shadow: 2px 2px 0 var(--pixel-outer-shadow);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.ipay-method-tile:not(:disabled):hover { 
    transform: translateY(-2px); 
    border-color: var(--pixel-accent-hover) !important; 
    box-shadow: 0 6px 16px rgba(168, 85, 247, 0.2);
}
.ipay-method-tile:not(:disabled):active { 
    transform: scale(0.98); 
}
.ipay-method-tile:disabled { opacity: 0.4; cursor: not-allowed; }

.ipay-physical-card {
    position: relative; 
    aspect-ratio: 1.586 / 1; 
    min-height: 250px;
    background: linear-gradient(135deg, #7A22E2 0%, #A855F7 100%) !important;
    border: 2px solid var(--app-border) !important;
    border-radius: 1.25rem !important;
    box-shadow: 0 15px 35px -5px rgba(124, 58, 237, 0.4);
}

.ipay-chip { 
    position: relative; 
    width: 44px;
    height: 32px;
    background: #EAB308;
    border: 2px solid #854D0E;
    border-radius: 6px;
    box-shadow: inset 1px 1px 0 #FEF08A, inset -1px -1px 0 #713F12;
}

.ipay-card-input { 
    background: rgba(0, 0, 0, 0.35) !important; 
    border: 2px solid rgba(255, 255, 255, 0.3) !important; 
    color: #FFFFFF !important;
    font-family: 'JetBrains Mono', monospace !important;
}
.ipay-card-input:focus { 
    border-color: #FFFFFF !important; 
    background: rgba(0, 0, 0, 0.5) !important; 
}

.ipay-shell { 
    position: relative; 
    z-index: 1; 
    border: 2px solid var(--app-border) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5) !important;
    animation: smoothPopIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both; 
}


.troll-invert { filter: invert(1) hue-rotate(180deg); }
.troll-flip { transform: scaleX(-1); }
.troll-disco { animation: trollDisco 0.3s steps(3) infinite alternate !important; }
@keyframes trollDisco { 0% { filter: hue-rotate(0deg) saturate(200%); } 100% { filter: hue-rotate(360deg) saturate(300%); } }
.troll-crazy-cursor, .troll-crazy-cursor * { cursor: wait !important; }
.troll-comicsans, .troll-comicsans * { font-family: "Comic Sans MS", "Comic Sans", cursive, sans-serif !important; }
.troll-blur { filter: invert(0.8); } 
.troll-upsidedown { transform: rotate(180deg) !important; }
.troll-bouncy * { animation: trollBounce 0.4s steps(3) infinite alternate !important; }
@keyframes trollBounce { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } }
.troll-glitch { animation: trollGlitch 0.2s steps(2) infinite !important; }
@keyframes trollGlitch {
    0% { transform: translate(0); }
    50% { transform: translate(-4px, 4px); }
    100% { transform: translate(4px, -4px); }
}
.troll-gravity > * { transform: translateY(80vh) rotate(20deg) !important; transition: transform 0.8s steps(6) !important; }

@media (max-width: 760px) {
    .ipay-physical-card { min-height: 220px; }
}
