* {
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}
body {
    margin: 0;
    padding: 0;
    background: radial-gradient(circle at 50% 35%, #23063d 0%, #0d0118 65%, #040008 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}
.end-pillars {
    position: fixed;
    bottom: 36vh;
    left: 0;
    width: 100%;
    height: 200px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}
.pillar {
    position: absolute;
    bottom: 0;
    background: linear-gradient(180deg, #1b0630 0%, #07010d 100%);
    border: 1px solid #4a148c;
    border-bottom: none;
    box-shadow: 0 0 15px rgba(123, 44, 191, 0.25);
}
.pillar::after {
    content: '';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 8px;
    height: 8px;
    background: #ff007f;
    box-shadow: 0 0 10px #ff007f;
}
.p1 { left: 6%; width: 26px; height: 135px; }
.p2 { left: 20%; width: 20px; height: 90px; }
.p3 { right: 8%; width: 30px; height: 150px; }
.p4 { right: 23%; width: 22px; height: 105px; }
.header {
    position: relative;
    z-index: 10;
    background: #0c0217;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1.5px solid #7b2cbf;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
}
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 900;
    color: #f3d5ff;
    text-shadow: 0 0 12px rgba(199, 125, 255, 0.6);
}
.prem-badge {
    background: linear-gradient(45deg, #ffb703, #fb8500);
    color: #000;
    font-size: 10px;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 5px;
    text-transform: uppercase;
}
.header-btns { display: flex; gap: 6px; }
.header-btns button {
    background: #240046;
    color: #fff;
    border: 1px solid #9d4edd;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.header-btns button.prem-btn {
    background: linear-gradient(45deg, #ff9e00, #ff007f);
    border: none;
}
.header-btns button.install-btn {
    background: linear-gradient(45deg, #00b4d8, #0077b6);
    border: none;
}
.stats {
    position: relative;
    z-index: 5;
    text-align: center;
    padding: 12px 10px 4px;
}
.shards {
    font-size: 38px;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 2px 15px rgba(199, 125, 255, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}
.pearls {
    font-size: 14px;
    color: #4cc9f0;
    margin-top: 2px;
    font-weight: 700;
}
.per-sec {
    font-size: 12px;
    color: #e0aaff;
    margin-top: 5px;
    background: rgba(60, 9, 108, 0.55);
    border: 1px solid rgba(157, 78, 221, 0.4);
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-weight: 600;
}
.arena {
    flex: 1;
    position: relative;
    z-index: 5;
    width: 100%;
    overflow: hidden;
}
.dragon-egg {
    width: 124px;
    height: 156px;
    background: radial-gradient(circle at 32% 25%, #5a189a 0%, #180030 58%, #040008 100%);
    border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
    box-shadow: 0 0 30px rgba(157, 78, 221, 0.9), inset -10px -12px 20px #000, inset 3px 3px 10px rgba(243, 213, 255, 0.45);
    border: 2.5px solid #c77dff;
    cursor: pointer;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    transition: left 0.22s ease-out, top 0.22s ease-out, transform 0.07s ease;
}
.dragon-egg::before {
    content: '';
    position: absolute;
    width: 24px;
    height: 32px;
    background: #9d4edd;
    border-radius: 50%;
    top: 28px;
    left: 24px;
    opacity: 0.55;
    box-shadow: 42px 22px 0 -4px #7b2cbf, 14px 68px 0 2px #5a189a;
}
.dragon-egg:active { transform: translate(-50%, -50%) scale(0.91); }
.prem-active .dragon-egg {
    border-color: #ffd166;
    box-shadow: 0 0 40px rgba(255, 209, 102, 0.95), inset -10px -12px 20px #000, inset 3px 3px 12px rgba(255, 230, 150, 0.5);
}
.tp-flash {
    position: absolute;
    width: 95px;
    height: 95px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(243,213,255,0.95) 0%, rgba(123,44,191,0) 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: tpAnim 0.45s ease-out forwards;
}
@keyframes tpAnim {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(0.3); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.9); }
}
.floating-text {
    position: fixed;
    color: #ffffff;
    font-weight: 900;
    font-size: 21px;
    pointer-events: none;
    z-index: 50;
    animation: floatUp 0.7s ease-out forwards;
    text-shadow: 0 2px 6px #000, 0 0 12px #c77dff;
}
@keyframes floatUp {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-65px) scale(1.2); }
}
.ad-banner {
    position: relative;
    z-index: 10;
    background: #0c0217;
    border: 1px dashed #6c35a3;
    text-align: center;
    padding: 8px;
    margin: 0 12px 8px;
    border-radius: 8px;
    font-size: 11px;
    color: #a389bd;
}
.shop {
    position: relative;
    z-index: 10;
    background: #0b0114;
    border-top: 2px solid #9d4edd;
    border-radius: 22px 22px 0 0;
    padding: 14px;
    height: 41vh;
    overflow-y: auto;
    box-shadow: 0 -6px 25px rgba(123, 44, 191, 0.4);
}
.shop h3 {
    margin: 0 0 10px;
    font-size: 14px;
    color: #f3d5ff;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 800;
}
.upgrade-item {
    background: #170429;
    border: 1px solid #4a148c;
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.up-left { display: flex; align-items: center; gap: 10px; }
.up-icon {
    width: 36px;
    height: 36px;
    background: #240046;
    border: 1px solid #7b2cbf;
    border-radius: 9px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}
.up-info h4 { margin: 0 0 3px; font-size: 14px; color: #fff; font-weight: 700; }
.up-info p { margin: 0; font-size: 11px; color: #c8b6db; }
.buy-btn {
    background: linear-gradient(135deg, #9d4edd, #6a00f4);
    color: #fff;
    border: 1px solid #e0aaff;
    padding: 8px 12px;
    border-radius: 9px;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    min-width: 88px;
    flex-shrink: 0;
}
.buy-btn:disabled { background: #1c1226; border-color: #322142; color: #68557a; }
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.88);
    justify-content: center;
    align-items: center;
    z-index: 100;
    padding: 15px;
}
.modal-content {
    background: #140324;
    border: 2px solid #9d4edd;
    border-radius: 18px;
    padding: 20px;
    width: 100%;
    max-width: 350px;
    text-align: center;
}
.modal-content h2 { margin-top: 0; color: #f3d5ff; font-size: 20px; }
.modal-content input {
    width: 100%;
    padding: 11px;
    margin: 8px 0;
    border-radius: 10px;
    border: 1px solid #7b2cbf;
    background: #08010f;
    color: #fff;
}
.modal-btn {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    border: none;
    border-radius: 10px;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    background: #9d4edd;
    color: #fff;
}
.close-btn {
    background: transparent;
    color: #b8a3cc;
    border: none;
    margin-top: 12px;
    cursor: pointer;
    text-decoration: underline;
}
.rebirth-btn {
    background: linear-gradient(45deg, #7209b7, #f72585);
    color: #fff;
    border: 1px solid #ff70a6;
    padding: 5px 12px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 800;
    margin-top: 6px;
    cursor: pointer;
    box-shadow: 0 0 12px rgba(247, 37, 133, 0.4);
}
.rebirth-btn:disabled {
    background: #1f142b;
    border-color: #3d2852;
    color: #725c8a;
    box-shadow: none;
}
.prof-card {
    background: linear-gradient(135deg, #240046 0%, #10002b 100%);
    border: 1px solid #7b2cbf;
    border-radius: 14px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    margin-bottom: 12px;
}
.prof-avatar {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(45deg, #7209b7, #f72585);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: 900;
    color: #fff;
    border: 2px solid #e0aaff;
    flex-shrink: 0;
}
.prof-id-badge {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid #5a189a;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    color: #4cc9f0;
    font-family: monospace;
    cursor: pointer;
}
.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}
.stat-box {
    background: #0d021a;
    border: 1px solid #3c096c;
    border-radius: 10px;
    padding: 8px;
    text-align: center;
}
.stat-box span {
    display: block;
    font-size: 10px;
    color: #b8a3cc;
    text-transform: uppercase;
}
.stat-box b {
    font-size: 14px;
    color: #f3d5ff;
}
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: 
        radial-gradient(1.5px 1.5px at 15% 25%, #e0aaff 50%, transparent 100%),
        radial-gradient(2px 2px at 72% 18%, #9d4edd 50%, transparent 100%),
        radial-gradient(1.5px 1.5px at 84% 62%, #4cc9f0 50%, transparent 100%),
        radial-gradient(2px 2px at 28% 74%, #f72585 50%, transparent 100%),
        radial-gradient(1px 1px at 50% 45%, #ffffff 50%, transparent 100%);
    background-size: 260px 260px;
    opacity: 0.45;
    pointer-events: none;
    z-index: 0;
}
.dragon-egg {
    box-shadow: 0 0 45px rgba(157, 78, 221, 0.85), 0 0 90px rgba(114, 9, 183, 0.35), inset -12px -14px 24px #000, inset 4px 4px 12px rgba(243, 213, 255, 0.55) !important;
}
.prem-active .dragon-egg {
    box-shadow: 0 0 50px rgba(255, 209, 102, 0.9), 0 0 95px rgba(255, 158, 0, 0.35), inset -12px -14px 24px #000, inset 4px 4px 14px rgba(255, 240, 180, 0.65) !important;
}
.upgrade-item {
    background: linear-gradient(135deg, rgba(36, 0, 70, 0.85) 0%, rgba(16, 0, 43, 0.95) 100%) !important;
    border: 1px solid rgba(157, 78, 221, 0.45) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: transform 0.1s ease, border-color 0.2s ease;
}
.upgrade-item:active { transform: scale(0.98); }
.pass-meter {
    height: 4px;
    width: 100%;
    background: #1a052d;
    border-radius: 4px;
    margin: -4px 0 8px;
    overflow: hidden;
}
.pass-meter-fill {
    height: 100%;
    width: 0%;
    transition: width 0.25s ease, background 0.25s ease;
}
.field-label {
    display: block;
    text-align: left;
    font-size: 11px;
    color: #b8a3cc;
    margin-top: 6px;
    margin-bottom: -4px;
}
.header {
    background: rgba(11, 2, 22, 0.85) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(199, 125, 255, 0.35) !important;
    padding: 12px 24px !important;
}
.shop {
    background: rgba(14, 3, 28, 0.9) !important;
    backdrop-filter: blur(14px);
    border-top: 2px solid #9d4edd !important;
}
.upgrade-item:hover {
    border-color: #c77dff !important;
    background: linear-gradient(135deg, rgba(60, 9, 108, 0.9) 0%, rgba(24, 0, 54, 0.95) 100%) !important;
}
.buy-btn:not(:disabled):hover {
    filter: brightness(1.15);
    box-shadow: 0 0 14px rgba(157, 78, 221, 0.7);
}
@media (min-width: 900px) {
    body {
        display: grid !important;
        grid-template-columns: 1fr 420px;
        grid-template-rows: 60px auto 1fr;
        grid-template-areas:
            "header header"
            "stats shop"
            "arena shop";
    }
    .header { grid-area: header; }
    .stats {
        grid-area: stats;
        padding-top: 28px !important;
    }
    .shards { font-size: 52px !important; }
    .arena { grid-area: arena; }
    .dragon-egg {
        width: 165px !important;
        height: 205px !important;
    }
    .end-pillars {
        width: calc(100% - 420px) !important;
        bottom: 0 !important;
        height: 260px !important;
    }
    .shop {
        grid-area: shop;
        height: calc(100vh - 60px) !important;
        max-height: none !important;
        border-top: none !important;
        border-left: 1.5px solid rgba(157, 78, 221, 0.45);
        border-radius: 0 !important;
        padding: 20px !important;
    }
}
.shop::-webkit-scrollbar { width: 6px; }
.shop::-webkit-scrollbar-track { background: #090112; }
.shop::-webkit-scrollbar-thumb { background: #5a189a; border-radius: 6px; }
.shop::-webkit-scrollbar-thumb:hover { background: #9d4edd; }
.end-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #d896ff;
    border-radius: 50%;
    box-shadow: 0 0 8px #9d4edd, 0 0 14px #f72585;
    pointer-events: none;
    animation: particleFloat 4s linear infinite;
}
@keyframes particleFloat {
    0% { transform: translateY(40px) scale(0.5); opacity: 0; }
    50% { opacity: 0.9; }
    100% { transform: translateY(-180px) scale(1.2); opacity: 0; }
}
.panel-tabs {
    display: flex;
    gap: 8px;
    background: #080110;
    padding: 5px;
    border-radius: 12px;
    border: 1px solid #3c096c;
    margin-bottom: 12px;
}
.panel-tab {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #b8a3cc;
    font-weight: 800;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.panel-tab.active {
    background: linear-gradient(135deg, #7b2cbf, #5a189a);
    color: #fff;
    box-shadow: 0 2px 10px rgba(123, 44, 191, 0.5);
}
.lb-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(28, 4, 54, 0.85), rgba(14, 2, 28, 0.95));
    border: 1px solid rgba(157, 78, 221, 0.3);
    padding: 9px 12px;
    border-radius: 11px;
    margin-bottom: 7px;
}
.lb-row.me { border-color: #4cc9f0; box-shadow: 0 0 12px rgba(76, 201, 240, 0.2); }
.lb-rank {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: #240046;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 12px;
    color: #e0aaff;
    margin-right: 10px;
}
.lb-rank.r1 { background: linear-gradient(45deg, #ffb703, #fb8500); color: #000; }
.lb-rank.r2 { background: linear-gradient(45deg, #e0e1dd, #adb5bd); color: #000; }
.lb-rank.r3 { background: linear-gradient(45deg, #cd7f32, #9c5221); color: #fff; }
.policy-box {
    background: #080110;
    border: 1px solid #4a148c;
    border-radius: 10px;
    padding: 12px;
    height: 185px;
    overflow-y: auto;
    text-align: left;
    font-size: 12px;
    line-height: 1.55;
    color: #d0bfe0;
    margin: 10px 0;
}
.policy-box h4 { color: #f3d5ff; margin: 8px 0 4px; font-size: 13px; }
.policy-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
    font-size: 12px;
    color: #fff;
    background: rgba(60, 9, 108, 0.35);
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #5a189a;
    cursor: pointer;
    margin-bottom: 10px;
}
.policy-check input {
    width: 18px !important;
    height: 18px !important;
    margin: 2px 0 0 !important;
    accent-color: #9d4edd;
    flex-shrink: 0;
}
.donate-list {
    max-height: 55vh;
    overflow-y: auto;
    padding-right: 4px;
}
.don-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1a052e;
    border: 1px solid #5a189a;
    padding: 9px 12px;
    border-radius: 10px;
    margin-bottom: 7px;
    text-align: left;
}
.don-item button {
    background: linear-gradient(135deg, #0096c7, #0077b6);
    color: #fff;
    border: none;
    padding: 7px 12px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 12px;
    cursor: pointer;
    min-width: 82px;
}
.arena-bar-wrap {
    background: #080110;
    border: 1px solid #5a189a;
    border-radius: 10px;
    height: 18px;
    overflow: hidden;
    display: flex;
    margin: 10px 0;
}
.arena-my-bar { background: linear-gradient(90deg, #4cc9f0, #4361ee); height: 100%; transition: width 0.1s; }
.arena-opp-bar { background: linear-gradient(90deg, #f72585, #b5179e); height: 100%; transition: width 0.1s; }
