:root {
    --bg: #000;
    --text: #8b0000;
    --accent: #ff0000;
    --gold: #C69214;
    --border: #222;
    --radius: 4px;
    /* Sharper edges for a retro feel */
    --logo-size: clamp(80px, 10vw, 100px);
    --fs-base: clamp(14px, 1.1vw, 17px);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 400 var(--fs-base) 'Source Code Pro', monospace;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: 0.1s;
}

a:hover {
    background: var(--accent);
    color: #000 !important;
}

/* Layout Overrides for Unified Header */
.header-inner {
    max-width: none !important;
    margin: 0 !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
}

main,
footer {
    max-width: none !important;
    margin: 0 !important;
    padding-left: 20px;
    padding-right: 20px;
}

/* Search Section: Left Aligned */
.search-section {
    padding: 120px 0 0 0;
    text-align: center;
    position: relative;
}

.top-left-links {
    position: absolute;
    top: 10px;
    left: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    text-align: left;
    z-index: 1;
}

.search-link {
    font-size: 1.1rem;
    font-weight: bold;
    text-decoration: none;
    transition: 0.1s;
    color: #4285F4;
}

.top-right-links {
    position: absolute;
    top: 10px;
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    z-index: 1;
}

.search-link:hover {
    background: var(--accent);
    color: #000 !important;
}

.search-section h2 {
    color: #cc8800;
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: bold;
}

.search-section h2 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.1s;
}

.search-section h2 a:hover {
    color: var(--accent) !important;
    background: transparent !important;
}

.search-box {
    width: 100%;
    max-width: 584px;
    background: #000;
    border: 1px solid var(--accent);
    padding: 12px;
    color: var(--accent);
    font-family: inherit;
    outline: none;
    border-radius: var(--radius);
    transition: box-shadow 0.2s;
    margin: 0 auto;
    display: block;
}

.search-box:focus {
    box-shadow: 0 0 10px var(--accent);
}

/* Unified search with engine toggle */
.unified-search {
    display: flex;
    align-items: stretch;
    width: 100%;
    max-width: 584px;
    margin: 0 auto;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    background: #000;
    position: relative;
}

.unified-search:focus-within {
    box-shadow: 0 0 10px var(--accent);
}

.search-engine-picker {
    position: relative;
    display: flex;
}

.search-engine-toggle {
    background: #000;
    color: var(--accent);
    border: none;
    border-right: 1px solid var(--accent);
    font-family: inherit;
    font-weight: bold;
    font-size: 1rem;
    padding: 0 14px;
    cursor: pointer;
    min-width: 64px;
    transition: 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.search-engine-toggle:hover {
    background: var(--accent);
    color: #000;
}

.search-engine-caret {
    font-size: 0.7rem;
    opacity: 0.8;
}

.search-engine-menu {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    min-width: 180px;
    margin: 0;
    padding: 0;
    list-style: none;
    background: #000;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    z-index: 50;
    text-align: left;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.4);
}

.search-engine-menu[hidden] {
    display: none;
}

.search-engine-menu li {
    padding: 8px 12px;
    color: var(--accent);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border);
}

.search-engine-menu li:last-child {
    border-bottom: none;
}

.search-engine-menu li:hover,
.search-engine-menu li[aria-selected="true"] {
    background: var(--accent);
    color: #000;
}

.search-engine-menu .engine-icon {
    font-weight: bold;
    min-width: 28px;
    text-align: center;
}

.unified-search .unified-search-input {
    border: none;
    border-radius: 0;
    max-width: none;
    flex: 1;
    width: auto;
    margin: 0;
    text-align: center;
}

.unified-search .unified-search-input:focus {
    box-shadow: none;
}

.search-engine-spacer {
    min-width: 64px;
}

.clock-container {
    margin-top: 15px;
    color: var(--text);
    font-size: 0.9rem;
    opacity: 0.8;
    text-align: center;
}

.clock-time {
    color: var(--accent);
    letter-spacing: 1px;
}

/* Grid Layout: Left Aligned */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 0;
}

.card {
    border: 1px solid var(--border);
    background: #050505;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    /* Items start on the left */
    transition: 0.2s;
}

.card:hover {
    border-color: var(--accent);
}

.card .thumb {
    width: 100%;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* Align icon to left */
    margin-bottom: 15px;
    opacity: 0.7;
}

.card img {
    max-width: 80px;
    max-height: 100%;
    object-fit: contain;
}

.card-links {
    font-size: 0.95rem;
    line-height: 1.6;
    border-top: 1px solid var(--border);
    width: 100%;
    padding-top: 12px;
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.card-links a {
    display: inline-block;
    width: auto;
    max-width: 100%;
    padding: 1px 4px;
    border-radius: 2px;
    text-shadow:
        0 0 4px rgba(255, 0, 0, .9),
        0 0 12px rgba(255, 0, 0, .6),
        0 0 24px rgba(255, 0, 0, .35);
    box-shadow:
        0 0 0 1px rgba(255, 0, 0, .5),
        0 0 10px rgba(255, 0, 0, .55),
        0 0 24px -4px rgba(255, 0, 0, .4);
}

footer {
    border-top: 1px solid var(--border);
    margin-top: auto;
    color: #555;
}

/* Last.fm now-playing bar */
.lastfm-widget {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    margin-top: 12px;
    border-bottom: 1px solid var(--border);
    background: #050505;
    font-size: 0.8rem;
    color: #888;
    flex-wrap: wrap;
}


.lastfm-label {
    color: #d51007;
}

#lastfm-status {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lastfm-profile {
    color: #d51007;
    white-space: nowrap;
    flex-shrink: 0;
}

.lastfm-profile:hover {
    background: #d51007;
    color: #000 !important;
}

/* Phones / touch devices: bigger text, easier tap target, stacked layout */
@media (max-width: 600px), (hover: none) and (pointer: coarse) and (max-width: 820px) {

    .lastfm-widget {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 12px 16px;
        font-size: 0.95rem;
        text-align: center;
    }

    .lastfm-label {
        font-size: 1.2rem;
    }

    #lastfm-status {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        flex: none;
        line-height: 1.4;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    #lastfm-status .lastfm-prefix,
    #lastfm-status .lastfm-track-name,
    #lastfm-status .lastfm-track-artist {
        display: block;
        max-width: 100%;
    }

    #lastfm-status .lastfm-track-name {
        font-weight: bold;
    }

    #lastfm-status .lastfm-sep {
        display: none;
    }

    #lastfm-status .lastfm-track-artist::before {
        content: '— ';
        opacity: 0.6;
    }

    .lastfm-profile {
        align-self: center;
        padding: 10px 18px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid #d51007;
        border-radius: 4px;
        font-weight: bold;
    }
}

/* Age-Restricted Nav Group */
#age-restricted-content {
    position: relative;
    cursor: pointer;
}

#age-restricted-content.locked .nav-list {
    filter: blur(8px);
    opacity: 0.3;
    pointer-events: none;
    user-select: none;
}

#age-restricted-content.locked::after {
    content: '18+ RESTRICTED - CLICK TO VERIFY';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--accent);
    font-size: 0.7rem;
    white-space: nowrap;
    pointer-events: none;
    text-align: center;
    font-weight: bold;
}

#age-restricted-content.unlocked {
    cursor: default;
}

/* Age Verification Modal */
.age-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.age-modal.hidden {
    display: none;
}

.age-modal-content {
    background: #000;
    border: 2px solid var(--accent);
    padding: 30px;
    max-width: 500px;
    text-align: center;
}

.age-modal-content h2 {
    color: var(--accent);
    margin: 0 0 20px 0;
    font-size: 1.3rem;
}

.age-modal-content p {
    margin: 0 0 25px 0;
    line-height: 1.6;
}

.age-modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.age-modal-btn {
    padding: 10px 25px;
    border: 1px solid var(--border);
    background: #000;
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.2s;
}

.age-modal-btn:hover {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

.age-modal-btn.deny:hover {
    background: #555;
    border-color: #555;
}

/* Persistent blue glow halo on the link groups (visible on desktop and touch) */
.top-left-links .search-link,
.top-right-links .search-link {
    display: inline-block;
    border-radius: 2px;
    text-shadow:
        0 0 4px rgba(66, 133, 244, .9),
        0 0 12px rgba(66, 133, 244, .6),
        0 0 24px rgba(66, 133, 244, .35);
    box-shadow:
        0 0 0 1px rgba(66, 133, 244, .5),
        0 0 10px rgba(66, 133, 244, .55),
        0 0 24px -4px rgba(66, 133, 244, .4);
}

/* Phone-only: stack the blue link groups vertically so they don't overlap the search */
@media (max-width: 600px), (hover: none) and (pointer: coarse) and (max-width: 820px) {

    .top-left-links,
    .top-right-links {
        position: static;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        padding: 0 10px;
        margin-bottom: 20px;
        text-align: center;
        z-index: auto;
    }

    .top-left-links .search-link,
    .top-right-links .search-link {
        font-size: 0.95rem;
    }
}

@media (max-width: 850px) {

    header,
    main,
    footer {
        padding: 20px;
    }

    header {
        flex-direction: column;
    }

    .nav-columns {
        width: 100%;
    }

    .age-modal-content {
        margin: 20px;
        padding: 20px;
    }

    .search-section {
        padding: 20px 0 20px 0;
    }

    .search-box {
        padding: 8px 10px;
        font-size: 0.9rem;
    }

    .unified-search {
        max-width: 100%;
    }

    .search-engine-toggle {
        min-width: 48px;
        padding: 0 8px;
        font-size: 0.9rem;
    }

    .unified-search .unified-search-input {
        min-width: 0;
    }
}

/* Additional styles for modal search box */
.search-container {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.age-modal-content form button:hover {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

.modal-search {
    margin: 20px 0;
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.modal-search-hint {
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.modal-search-form {
    display: flex;
    gap: 10px;
}

.modal-search-input {
    flex-grow: 1;
    border: 1px solid var(--border);
    padding: 8px;
    background: #000;
    color: var(--text);
}

.modal-search-button {
    padding: 8px 15px;
    border: 1px solid var(--border);
    background: #000;
    color: var(--text);
    cursor: pointer;
}