* {
    box-sizing: border-box;
}

:root {
    --accent: #3cff75;
    --accent-rgb: 60, 255, 117;
}

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    color: white;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    background: #000;
}

/* =========================================================
   PARTICLES
   ========================================================= */

#particleCanvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* =========================================================
   HOME
   ========================================================= */

.home-page {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.leaf-logo {
    font-family: "Brush Script MT", "Segoe Script", cursive;
    font-size: 110px;
    line-height: 1;
    color: var(--accent);
    text-shadow:
        0 0 10px rgba(var(--accent-rgb), .15),
        0 0 35px rgba(var(--accent-rgb), .08);
    user-select: none;
}

.home-subtitle {
    color: #555;
    font-size: 13px;
    margin-top: 12px;
    margin-bottom: 30px;
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* =========================================================
   SEARCH
   ========================================================= */

.home-search {
    width: min(680px, 90%);
    height: 58px;
    display: flex;
    align-items: center;
    position: relative;
    isolation: isolate;

    background: rgba(9, 9, 9, .88);
    border: 1px solid #202020;
    border-radius: 15px;

    box-shadow:
        0 10px 40px rgba(0, 0, 0, .5),
        inset 0 0 20px rgba(255, 255, 255, .01);

    transition:
        border-color .2s,
        box-shadow .2s;
}

.home-search:focus-within {
    border-color: rgba(var(--accent-rgb), .5);

    box-shadow:
        0 0 25px rgba(var(--accent-rgb), .06),
        0 10px 40px rgba(0, 0, 0, .5);
}

.home-search input {
    flex: 1;
    height: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: white;
    font-size: 16px;
    padding: 0 12px;
}

.home-search input::placeholder {
    color: #555;
}

.search-icon,
.search-go {
    width: 58px;
    height: 58px;
    flex-shrink: 0;
    border: 0;
    background: transparent;
    color: #666;
    font-size: 25px;
    cursor: pointer;
    transition:
        color .15s,
        transform .15s;
}

.search-icon:hover,
.search-go:hover {
    color: var(--accent);
}

.search-go:hover {
    transform: translateX(2px);
}

/* =========================================================
   SEARCH BORDER LIGHT
   ========================================================= */

.search-border {
    position: absolute;
    inset: -2px;
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    pointer-events: none;
    overflow: visible;
    z-index: -1;
}

.search-border rect {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-linecap: round;

    stroke-dasharray: 65 900;
    stroke-dashoffset: 0;

    filter:
        drop-shadow(0 0 4px var(--accent))
        drop-shadow(0 0 9px rgba(var(--accent-rgb), .45));

    animation: leafSearchBorder 3.5s linear infinite;
}

@keyframes leafSearchBorder {
    to {
        stroke-dashoffset: -965;
    }
}

/* =========================================================
   QUICK BUTTONS
   ========================================================= */

.quick-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 22px;
    width: min(700px, 92%);
}

.quick-button {
    width: 86px;
    height: 86px;
    padding: 8px 5px;

    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;

    position: relative;

    border: 1px solid #202020;
    border-radius: 12px;
    background: rgba(8, 8, 8, .88);

    color: #aaa;
    cursor: pointer;

    transition:
        border-color .15s,
        color .15s,
        background .15s,
        transform .15s,
        box-shadow .15s;
}

.quick-button:hover {
    border-color: rgba(var(--accent-rgb), .45);
    background: rgba(12, 12, 12, .95);
    color: white;
    transform: translateY(-3px);

    box-shadow:
        0 8px 25px rgba(0, 0, 0, .35),
        0 0 18px rgba(var(--accent-rgb), .05);
}

.quick-button:active {
    transform: translateY(-1px) scale(.97);
}

.quick-icon {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;
}

.quick-icon svg {
    width: 34px;
    height: 34px;
    display: block;
}

.quick-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    color: #888;
    transition: color .15s;
}

.quick-button:hover .quick-label {
    color: #ddd;
}

.quick-icon.youtube {
    color: #ff0000;
    filter: drop-shadow(0 0 7px rgba(255, 0, 0, .2));
}

.quick-icon.discord {
    color: #5865f2;
    filter: drop-shadow(0 0 7px rgba(88, 101, 242, .2));
}

.quick-icon.reddit {
    color: #ff4500;
    filter: drop-shadow(0 0 7px rgba(255, 69, 0, .2));
}

.quick-icon.x {
    color: #fff;
}

.quick-icon.games {
    color: var(--accent);
    filter: drop-shadow(0 0 7px rgba(var(--accent-rgb), .2));
}

/* =========================================================
   SETTINGS BUTTON
   ========================================================= */

.settings-button {
    position: fixed;
    right: 18px;
    bottom: 18px;

    width: 44px;
    height: 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid #242424;
    border-radius: 12px;

    background: rgba(8, 8, 8, .9);
    color: #666;

    cursor: pointer;
    z-index: 20;

    font-size: 20px;

    transition:
        color .2s,
        border-color .2s,
        background .2s,
        transform .2s,
        box-shadow .2s;
}

.settings-button:hover {
    color: var(--accent);
    border-color: rgba(var(--accent-rgb), .4);
    background: rgba(14, 14, 14, .95);
    transform: translateY(-2px);

    box-shadow:
        0 8px 25px rgba(0, 0, 0, .4),
        0 0 20px rgba(var(--accent-rgb), .06);
}

/* =========================================================
   SETTINGS PANEL
   ========================================================= */

.settings-panel {
    position: fixed;

    right: 18px;
    bottom: 72px;

    width: 350px;
    max-width: calc(100vw - 36px);
    max-height: calc(100vh - 100px);

    overflow-y: auto;

    padding: 18px;

    background: rgba(8, 8, 8, .97);

    border: 1px solid #242424;
    border-radius: 16px;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, .65),
        0 0 30px rgba(var(--accent-rgb), .04);

    backdrop-filter: blur(18px);

    opacity: 0;
    transform: translateY(10px) scale(.97);
    pointer-events: none;

    transition:
        opacity .18s ease,
        transform .18s ease;

    z-index: 19;
}

.settings-panel.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.settings-panel::-webkit-scrollbar {
    width: 5px;
}

.settings-panel::-webkit-scrollbar-thumb {
    background: #292929;
    border-radius: 10px;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding-bottom: 14px;
    margin-bottom: 4px;

    border-bottom: 1px solid #1b1b1b;
}

.settings-title {
    color: #eee;
    font-size: 17px;
    font-weight: 700;
}

.settings-close {
    width: 30px;
    height: 30px;

    border: 0;
    border-radius: 7px;

    background: transparent;
    color: #555;

    cursor: pointer;
    font-size: 19px;
}

.settings-close:hover {
    color: #eee;
    background: #151515;
}

.settings-section {
    padding: 15px 0;
    border-bottom: 1px solid #181818;
}

.settings-section:last-child {
    border-bottom: 0;
}

.settings-section-title {
    margin-bottom: 10px;

    color: #888;
    font-size: 11px;
    font-weight: 700;

    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.settings-option {
    width: 100%;
    min-height: 48px;

    display: flex;
    align-items: center;
    gap: 11px;

    padding: 8px 10px;

    margin-bottom: 6px;

    border: 1px solid #1b1b1b;
    border-radius: 10px;

    background: #0c0c0c;
    color: #aaa;

    cursor: pointer;
    text-align: left;

    transition:
        background .15s,
        border-color .15s,
        color .15s;
}

.settings-option:last-child {
    margin-bottom: 0;
}

.settings-option:hover {
    background: #111;
    border-color: #292929;
    color: #eee;
}

.settings-option.selected {
    border-color: rgba(var(--accent-rgb), .45);
    background: rgba(var(--accent-rgb), .045);
    color: #eee;
}

.settings-option.disabled {
    opacity: .42;
    cursor: not-allowed;
}

.settings-option.disabled:hover {
    background: #0c0c0c;
    border-color: #1b1b1b;
    color: #aaa;
}

.settings-option-icon {
    width: 30px;
    height: 30px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 7px;

    background: #151515;
    color: #aaa;

    font-size: 15px;
}

.settings-option.selected .settings-option-icon {
    color: var(--accent);
}

.settings-option-info {
    flex: 1;
    min-width: 0;
}

.settings-option-name {
    color: inherit;
    font-size: 13px;
    font-weight: 600;
}

.settings-option-description {
    margin-top: 3px;

    color: #555;
    font-size: 10px;
}

.settings-wip {
    color: #666;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .8px;
}

.settings-check {
    color: var(--accent);
    font-size: 14px;
    opacity: 0;
}

.settings-option.selected .settings-check {
    opacity: 1;
}

/* =========================================================
   CLOAKING ICONS
   ========================================================= */

.cloak-icon {
    overflow: hidden;
}

.cloak-icon img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* =========================================================
   THEMES
   ========================================================= */

.theme-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
}

.theme-button {
    height: 43px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    border: 1px solid #1c1c1c;
    border-radius: 9px;

    background: #0d0d0d;
    color: #777;

    cursor: pointer;
    font-size: 10px;
    font-weight: 600;

    transition:
        border-color .15s,
        background .15s,
        color .15s;
}

.theme-button:hover {
    border-color: #303030;
    color: #ddd;
}

.theme-button.selected {
    border-color: rgba(var(--accent-rgb), .45);
    color: #eee;
}

.theme-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--theme-color);
    box-shadow: 0 0 7px var(--theme-color);
}

.custom-theme-row {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 8px;
}

.custom-theme-label {
    color: #666;
    font-size: 11px;
}

#customThemeColor {
    width: 38px;
    height: 28px;
    padding: 2px;

    border: 1px solid #292929;
    border-radius: 7px;

    background: #0c0c0c;
    cursor: pointer;
}

/* =========================================================
   BROWSER
   ========================================================= */

.browser-page {
    display: none;

    width: 100%;
    height: 100%;

    flex-direction: column;

    background: #000;

    position: relative;
    z-index: 2;
}

.top {
    height: 43px;

    display: flex;
    align-items: flex-end;

    background: #050505;
    border-bottom: 1px solid #181818;

    padding-left: 8px;
}

.tabs {
    height: 100%;

    display: flex;
    align-items: flex-end;

    gap: 3px;

    overflow-x: auto;
    overflow-y: hidden;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    height: 36px;
    min-width: 150px;
    max-width: 240px;

    padding: 0 10px;

    display: flex;
    align-items: center;

    background: #0b0b0b;

    border: 1px solid #171717;
    border-bottom: 0;

    border-radius: 9px 9px 0 0;

    color: #666;

    cursor: pointer;

    position: relative;

    transition:
        background .15s,
        color .15s;
}

.tab:hover {
    background: #101010;
    color: #aaa;
}

.tab.active {
    background: #101010;
    color: #ddd;
    border-top: 2px solid var(--accent);
}

.tab-title {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

    flex: 1;

    font-size: 13px;
}

.tab-close {
    width: 25px;
    height: 25px;

    margin-left: 7px;

    border: 0;
    border-radius: 6px;

    background: transparent;
    color: #555;

    font-size: 17px;
    cursor: pointer;
}

.tab-close:hover {
    background: #181818;
    color: #eee;
}

.new-tab {
    width: 38px;
    height: 36px;

    margin-left: 5px;
    margin-bottom: 0;

    border: 0;

    background: transparent;
    color: #555;

    font-size: 24px;
    cursor: pointer;
}

.new-tab:hover {
    color: var(--accent);
}

.toolbar {
    height: 52px;

    display: flex;
    align-items: center;

    gap: 4px;
    padding: 7px 9px;

    background: #070707;
    border-bottom: 1px solid #181818;
}

.nav-button,
.tool-button {
    width: 38px;
    height: 36px;

    flex-shrink: 0;

    border: 1px solid transparent;
    border-radius: 8px;

    background: transparent;
    color: #666;

    font-size: 23px;
    cursor: pointer;

    transition:
        color .15s,
        background .15s,
        border-color .15s;
}

.nav-button:hover,
.tool-button:hover {
    color: #ddd;
    background: #101010;
    border-color: #1c1c1c;
}

.address-wrap {
    height: 36px;

    flex: 1;

    display: flex;
    align-items: center;

    background: #0c0c0c;

    border: 1px solid #1b1b1b;
    border-radius: 9px;

    padding: 0 10px;

    transition: border-color .15s;
}

.address-wrap:focus-within {
    border-color: rgba(var(--accent-rgb), .4);
}

.lock {
    color: var(--accent);
    font-size: 14px;
    margin-right: 8px;
}

.address-wrap input {
    width: 100%;
    height: 100%;

    border: 0;
    outline: 0;

    background: transparent;
    color: #bbb;

    font-size: 13px;
}

.address-wrap input:focus {
    color: white;
}

.pages {
    flex: 1;

    position: relative;

    overflow: hidden;

    background: #fff;
}

.page-frame {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    border: 0;

    display: block;
    visibility: hidden;
    pointer-events: none;

    background: white;
}

.page-frame.active {
    visibility: visible;
    pointer-events: auto;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {
    .leaf-logo {
        font-size: 80px;
    }

    .home-subtitle {
        margin-bottom: 22px;
    }

    .quick-buttons {
        gap: 8px;
    }

    .quick-button {
        width: 72px;
        height: 72px;
        border-radius: 10px;
        gap: 3px;
    }

    .quick-icon {
        width: 32px;
        height: 32px;
    }

    .quick-icon svg {
        width: 28px;
        height: 28px;
    }

    .quick-label {
        font-size: 10px;
    }

    .tab {
        min-width: 120px;
    }

    .nav-button,
    .tool-button {
        width: 32px;
    }

    .settings-panel {
        right: 10px;
        bottom: 64px;
        width: calc(100vw - 20px);
    }

    .settings-button {
        right: 10px;
        bottom: 10px;
    }
}

/* =========================================================
   COOKIE / DATA NOTICE
   ========================================================= */

.cookie-notice {
    position: fixed;
    left: 18px;
    bottom: 18px;
    width: min(440px, calc(100vw - 36px));
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    background: rgba(8, 8, 8, .97);
    border: 1px solid #242424;
    border-radius: 14px;
    box-shadow:
        0 18px 50px rgba(0, 0, 0, .65),
        0 0 25px rgba(var(--accent-rgb), .035);
    backdrop-filter: blur(18px);
    opacity: 0;
    transform: translateY(10px) scale(.98);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
    z-index: 30;
}

.cookie-notice.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.cookie-notice-icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #202020;
    border-radius: 9px;
    background: #101010;
    font-size: 17px;
}

.cookie-notice-content {
    min-width: 0;
    flex: 1;
}

.cookie-notice-title {
    color: #eee;
    font-size: 13px;
    font-weight: 700;
}

.cookie-notice-text {
    margin-top: 4px;
    color: #666;
    font-size: 10px;
    line-height: 1.45;
}

.cookie-notice-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.cookie-notice-actions button {
    height: 32px;
    padding: 0 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 700;
    transition: background .15s, border-color .15s, color .15s, transform .15s;
}

.cookie-allow {
    border: 1px solid rgba(var(--accent-rgb), .35);
    background: rgba(var(--accent-rgb), .08);
    color: var(--accent);
}

.cookie-allow:hover {
    background: rgba(var(--accent-rgb), .14);
    border-color: rgba(var(--accent-rgb), .55);
}

.cookie-decline {
    border: 1px solid #202020;
    background: #0d0d0d;
    color: #777;
}

.cookie-decline:hover {
    border-color: #303030;
    background: #121212;
    color: #ddd;
}

.cookie-notice-actions button:active {
    transform: scale(.96);
}

@media (max-width: 700px) {
    .cookie-notice {
        left: 10px;
        right: 10px;
        bottom: 10px;
        width: auto;
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .cookie-notice-content {
        flex-basis: calc(100% - 48px);
    }

    .cookie-notice-actions {
        width: 100%;
        margin-left: 46px;
    }
}
