:root {
    --base-font-size: clamp(13px, 1.5vh, 16px);
    --app-vh: 1vh;
    --header-height-desktop: 6.25rem;
    --header-height-mobile: 6.5rem;
    --mobile-ad-reserve: 4.5rem;
    --desktop-ad-reserve: 4.5rem;
    --tab-font-family: Arial, sans-serif;
    --tab-font-size: 1.75rem;
    --tab-font-weight: bold;
    --tab-letter-spacing: 0.5px;
    --tab-color-inactive: #888888;
    --tab-color-active: #f5c400;
    --tab-color-hover: #ffffff;
    --tab-gap: 1.95rem;
    --tab-padding-y: 0.5rem;
    --tab-underline-weight: 3px;
}

@media (max-width: 768px) {
    :root {
        --tab-font-size: 0.9375rem;
        --tab-gap: 1.66rem;
    }
}

@media (max-width: 375px) {
    :root {
        --tab-font-size: 0.78125rem;
        --tab-gap: 1.25rem;
    }
}

html {
    font-size: var(--base-font-size);
    overscroll-behavior-y: none;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
}

body {
    font-family: Arial, sans-serif;
    background: #0a0a0a;
    color: white;
    min-height: 100vh;
}

#header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height-desktop);
    z-index: 100;
    background: #000;
    border-bottom: 2px solid #1d1d1d;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2.5rem;
    box-sizing: border-box;
}

#brandContainer {
    display: flex;
    align-items: center;
    padding: 0.5rem 1.5rem;
    padding-left: 3.5rem;
}

#headerText {
    font-family: 'Jersey 20', sans-serif;
    font-size: 4.75rem;
    line-height: 1;
    letter-spacing: 0.25rem;
    background: radial-gradient(circle, #f5c400 50%, hsl(138, 95%, 7%) 60%);
    background-size: 4.5px 4.5px;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 4px rgba(245, 196, 0, 0.9));
    display: inline-block;
}

.logo-wrapper {
    position: relative;
    display: inline-block;
    margin-left: 1rem;
}

#headerLogo {
    height: 4.5rem;
    width: auto;
    display: block;
}

#headerLogo.logo-spin {
    animation: logoSpin 0.8s ease-out;
}

@keyframes logoSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (min-width: 769px) {
    .logo-wrapper {
        cursor: pointer;
    }
}

.logo-tm {
    position: absolute;
    bottom: -0.32rem;
    right: -0.5rem;
    width: 0.55rem;
    height: 0.55rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.5rem;
    color: rgba(255, 255, 255, 0.6);
    font-family: Arial, sans-serif;
    line-height: 1;
}

#modeSwitcher {
    display: flex;
    align-items: center;
    gap: var(--tab-gap);
    padding: var(--tab-padding-y) 1.875rem;
    margin-right: 6rem;
}

.mode-btn {
    background: none;
    border: none;
    color: var(--tab-color-inactive);
    font-family: var(--tab-font-family);
    font-size: var(--tab-font-size);
    font-weight: var(--tab-font-weight);
    letter-spacing: var(--tab-letter-spacing);
    cursor: pointer;
    padding: var(--tab-padding-y) 0;
    border-bottom: var(--tab-underline-weight) solid transparent;
    transition: all 0.2s ease;
}

.mode-btn:hover {
    color: var(--tab-color-hover);
}

.mode-btn.active {
    color: var(--tab-color-active);
    border-bottom: var(--tab-underline-weight) solid var(--tab-color-active);
}

#menuContainer {
    position: relative;
}

#menuBtn {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 0.35rem;
    border: 1px solid #333;
    background: #0f0f0f;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.22rem;
    padding: 0 0.4rem;
    cursor: pointer;
}

#menuBtn span {
    display: block;
    width: 100%;
    height: 2px;
    background: #f5c400;
}

#menuBtn.open {
    border-color: #f5c400;
}

#menuDropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    min-width: max-content;
    background: #111;
    border: 1px solid #333;
    border-radius: 0.625rem;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

#menuDropdown.show {
    display: block;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    border: none;
    background: transparent;
    color: #ffffff;
    font-family: Arial, sans-serif;
    font-size: 1.32rem;
    font-weight: bold;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.95rem 1.2rem;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.menu-item .menu-icon {
    font-size: 1.25rem;
    line-height: 1;
    flex-shrink: 0;
}

.menu-item:hover {
    background: #1a1a1a;
    color: #f5c400;
}

.menu-item + .menu-item {
    border-top: 1px solid #1c1c1c;
}

.standalone-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    justify-content: center;
    align-items: center;
    z-index: 220;
    backdrop-filter: blur(4px);
}

.standalone-modal-content {
    background: #111;
    border: 2px solid #f5c400;
    border-radius: 0.75rem;
    width: min(34rem, 90vw);
    max-height: 90svh;
    overflow-y: auto;
    padding: 1.5rem;
    box-sizing: border-box;
    position: relative;
}

.standalone-modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.85rem;
    background: none;
    border: none;
    color: #888;
    font-size: 1.75rem;
    cursor: pointer;
}

.standalone-modal-close:hover {
    color: #fff;
}

.standalone-modal-content h2 {
    text-align: center;
    color: #f5c400;
    margin: 0 0 1.25rem 0;
    font-family: 'Jersey 20', sans-serif;
    font-size: 2.2rem;
    letter-spacing: 0.08rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.stat-box {
    background: #0a0a0a;
    border: 1px solid #2a2a2a;
    border-radius: 0.5rem;
    padding: 0.9rem 0.7rem;
    text-align: center;
}

.stat-label {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}

.stat-value {
    color: #fff;
    font-size: 1.35rem;
    font-weight: 700;
}

#pageView {
    display: none;
    position: relative;
    z-index: 20;
    min-height: calc(100vh - var(--header-height-desktop) - 2rem);
    background: transparent;
    padding: 2rem;
    padding-top: calc(var(--header-height-desktop) + 1.5rem);
    box-sizing: border-box;
}

#pageView.active {
    display: block;
}

#pageView.active ~ #siteFooter {
    margin-top: calc(100vh - var(--header-height-desktop));
}

#pageViewContent {
    max-width: 37.5rem;
    margin: 0 auto;
    background: #111;
    color: white;
    padding: 2.5rem;
    border-radius: 0.9375rem;
    border: 2px solid #333;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

#pageViewContent h2 {
    font-family: 'Jersey 20', sans-serif;
    font-size: 3rem;
    margin-top: 0;
    color: #f5c400;
    letter-spacing: 0.125rem;
    text-transform: uppercase;
}

.about-ikb {
    margin: 0 0 1.5rem 0;
    padding: 1.25rem 1.2rem;
    border-radius: 0.75rem;
    border: 1px solid #5a8cb6;
    background: linear-gradient(180deg, #6fa4cb 0%, #4b81aa 55%, #3f729a 100%);
    text-align: center;
}

.about-ikb h3 {
    margin: 0 0 0.85rem 0;
    color: #ffffff;
    font-family: 'Jersey 20', sans-serif;
    font-size: 3rem;
    line-height: 0.95;
    text-transform: uppercase;
    letter-spacing: 0.08rem;
}

#pageViewContent .about-ikb p {
    margin: 0 0 0.8rem 0;
    color: #d7dee8;
    text-align: left;
}

#pageViewContent .about-ikb p:last-child {
    margin-bottom: 0;
}

#pageViewContent .about-ikb .about-ikb-follow {
    margin-top: 1rem;
    margin-bottom: 0.55rem;
    color: #ffffff;
    font-size: 0.75rem;
    text-align: center;
}

.about-ikb-socials {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.about-ikb-socials a {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.125rem;
    line-height: 1;
    text-decoration: underline;
    text-underline-offset: 2px;
    filter: none;
}

.about-ikb-socials a:hover {
    color: #f5c400;
    transform: none;
    filter: none;
}

#pageViewContent p, #pageViewContent li {
    font-size: 1.125rem;
    line-height: 1.6;
    color: #ccc;
    text-align: left;
}

#pageViewContent ul {
    padding-left: 1.25rem;
    margin-bottom: 1.875rem;
}

#pageViewContent .example-text {
    margin: 0.5rem 0 0.9375rem 1.5625rem;
    font-size: 1rem;
    color: #999;
    font-style: italic;
    display: block;
}

#pageViewContent #abbrevList {
    text-align: left;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.625rem 1.875rem;
}

.page-back-btn {
    display: inline-block;
    margin-bottom: 1.5rem;
    background: none;
    border: 1px solid #444;
    color: #ccc;
    padding: 0.5rem 1.25rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 1rem;
    font-family: Arial, sans-serif;
    transition: all 0.2s ease;
    text-decoration: none;
}

.page-back-btn:hover {
    background: #222;
    color: #f5c400;
    border-color: #f5c400;
}

.abbrev-item {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #333;
    padding: 0.3125rem 0;
}

.abbrev-college {
    color: #ccc;
}

#field {
    position: fixed;
    top: var(--header-height-desktop);
    left: 0;
    width: 100%;
    height: calc(100svh - var(--header-height-desktop));
    background: hsl(138, 95%, 7%);
    display: flex;
    z-index: 1;
}

#fieldOverlay {
    position: absolute;
    inset: 0;
    z-index: 2;
}

#yardNumbers div {
    position: absolute;
    color: white;
    font-size: 2.125rem;
    font-weight: 700;
    font-family: 'Stardos Stencil', system-ui;
    transform: translate(-50%, -50%) rotate(180deg);
    user-select: none;
    background: hsl(138, 95%, 7%);
    padding: 0 0.75rem;
    z-index: 10;
}

#yardNumbers div.yard-number-bottom {
    transform: translate(-50%, -50%);
}

#hashMarks div {
    position: absolute;
    width: 0.125rem;
    height: 1.125rem;
    background: white;
    border-radius: 0.1875rem;
    transform: translate(-50%, -50%);
}

#majorLines div {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 0.25rem;
    background: white;
    opacity: 0.85;
    z-index: 2;
}

#majorLines div:nth-child(-n+2), #majorLines div:nth-last-child(-n+2) {
    top: 0;
}

#yardNumbers div:nth-child(1), #yardNumbers div:nth-child(3), #yardNumbers div:nth-child(15), #yardNumbers div:nth-child(17) {
    display: block;
}

#siteFooter {
    position: relative;
    z-index: 20;
    margin-top: calc(100vh + var(--desktop-ad-reserve));
    background: #0a0a0a;
    border-top: 2px solid #222;
    padding: 3rem 2rem;
}

#footerContent {
    max-width: 37.5rem;
    margin: 0 auto;
    text-align: center;
}

#footerContent h3 {
    font-family: 'Jersey 20', sans-serif;
    font-size: 2rem;
    color: #f5c400;
    text-transform: uppercase;
    letter-spacing: 0.125rem;
    margin: 0 0 1.5rem 0;
}

.footer-socials {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.footer-socials a {
    color: #888;
    text-decoration: none;
    font-size: 1.125rem;
    font-family: Arial, sans-serif;
    transition: color 0.2s ease;
}

.footer-socials a:hover {
    color: #f5c400;
}

.footer-page-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    row-gap: 0.5rem;
    column-gap: 1.75rem;
    margin-bottom: 2rem;
}

.footer-page-links a {
    color: #4e87b8;
    text-decoration: underline;
    font-size: 1.421875rem;
    font-family: Arial, sans-serif;
    line-height: 1.25;
}

.footer-page-links a:hover {
    color: #f5c400;
}

.footer-divider {
    border: none;
    border-top: 1px solid #333;
    margin: 1.5rem 0;
}

.footer-legal {
    color: #555;
    font-size: 0.8125rem;
    font-family: Arial, sans-serif;
    line-height: 1.6;
}

.footer-legal a {
    color: #777;
    text-decoration: underline;
}

.footer-legal a:hover {
    color: #f5c400;
}

/* ===== LARGE DESKTOP: center helmet logo only, title stays left ===== */
@media (min-width: 1061px) {
    .logo-wrapper {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        margin-left: 0;
    }
}

@media (min-width: 1061px) and (max-height: 750px) {
    #brandContainer {
        padding-left: clamp(0rem, 0.8vw, 1rem);
    }
    #headerText {
        font-size: clamp(2.45rem, 4vw, 3.5rem);
        letter-spacing: clamp(0.09rem, 0.2vw, 0.22rem);
    }
    #headerLogo {
        height: clamp(4.375rem, 7vh, 5.25rem);
    }
}

@media (min-width: 1061px) and (max-height: 620px) {
    #header {
        min-height: 3rem;
        padding-top: 0.3rem;
        padding-bottom: 0.3rem;
    }
    #brandContainer {
        padding-left: clamp(1.15rem, 2.8vw, 3.2rem);
    }
    #headerText {
        font-size: clamp(2.35rem, 3.8vw, 3.35rem);
        letter-spacing: clamp(0.08rem, 0.18vw, 0.22rem);
    }
    #headerLogo {
        height: clamp(3.125rem, 5.31vh, 4.19rem);
    }
    #modeSwitcher {
        gap: clamp(0.55rem, 1.1vw, 1.35rem);
        margin-right: clamp(0.75rem, 2.2vw, 3rem);
    }
    .mode-btn {
        font-size: clamp(0.95rem, 1.9vh, 1.35rem);
    }
}

@media (max-width: 1060px) and (min-width: 769px) {
    #header {
        height: auto;
        min-height: 3.5rem;
        padding: 0.5rem clamp(0.5rem, 1.5vw, 1.5rem);
        align-items: center;
    }
    #brandContainer {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        padding: 0.5rem 0.25rem;
        padding-left: clamp(0.25rem, 1vw, 0.9rem);
    }
    #headerText {
        font-size: clamp(3.8rem, 7vw, 5rem);
    }
    #headerLogo {
        height: clamp(3.9rem, 7vw, 5.1rem);
    }
    .logo-wrapper {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        margin-left: 0;
    }
    #modeSwitcher {
        gap: clamp(0.5rem, 1.5vw, 1.2rem);
        padding: 0.5rem 0.75rem;
        margin-right: clamp(0.5rem, 2vw, 2rem);
    }
    .mode-btn {
        font-size: clamp(0.75rem, 1.4vw, 1rem);
    }
    .menu-item {
        font-size: 1.275rem;
        padding: 0.65rem 0.9rem;
    }
    #pageView {
        padding-top: 8.5rem;
    }
}

@media (min-width: 769px) and (max-width: 1060px) and (max-height: 750px) {
    #brandContainer {
        padding-left: clamp(0.2rem, 0.9vw, 0.75rem);
    }
    #headerText {
        font-size: clamp(2.2rem, 4.9vw, 3.6rem);
        letter-spacing: clamp(0.08rem, 0.2vw, 0.2rem);
    }
    #headerLogo {
        height: clamp(2.75rem, 5.6vh, 4rem);
    }
    .mode-btn {
        font-size: clamp(0.95rem, 2.05vh, 1.3rem);
    }
}

@media (min-width: 769px) and (max-width: 1060px) and (max-height: 600px) {
    #brandContainer {
        padding-left: clamp(0.2rem, 0.8vw, 0.65rem);
    }
    #headerLogo {
        height: clamp(2.8rem, 5.8vh, 4rem);
    }
    .mode-btn {
        font-size: clamp(0.9rem, 1.9vh, 1.15rem);
    }
}

@media (max-width: 768px) {
    .standalone-modal-content {
        width: 92vw;
        padding: 1.1rem;
    }
    .standalone-modal-content h2 {
        font-size: 1.9rem;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }

    #header {
        position: relative;
        height: auto;
        min-height: var(--header-height-mobile);
        flex-direction: column;
        padding: 0;
        top: 0;
        background: #0a0a0a;
        pointer-events: auto;
    }
    #brandContainer {
        width: 100%;
        box-sizing: border-box;
        justify-content: center;
        padding: 0.5rem 0.9375rem;
        background: #0a0a0a;
        border-radius: 0 0 0rem 0rem;
    }
    #headerText {
        font-size: 3.90625rem;
        letter-spacing: 0.125rem;
    }
    #headerLogo {
        height: 3.90625rem;
    }
    #modeSwitcher {
        width: 100%;
        box-sizing: border-box;
        justify-content: center;
        margin: 0;
        gap: var(--tab-gap);
        padding: 0.25rem 1rem;
        background: #0a0a0a;
        border-radius: 0 0 0rem 0rem;
    }
    .mode-btn {
        font-size: var(--tab-font-size);
    }
    #menuDropdown {
        width: 12.5rem;
    }
    #field {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100svh;
    }
    #yardNumbers div {
        font-size: 1rem;
    }
    #yardNumbers div:nth-child(1), #yardNumbers div:nth-child(3), #yardNumbers div:nth-child(15), #yardNumbers div:nth-child(17) {
        display: block;
    }
    #majorLines div:nth-child(-n+2), #majorLines div:nth-last-child(-n+2) {
        top: 0;
    }
    #hashMarks div {
        width: 1px;
        height: 7px;
        border-radius: 1px;
    }
    #majorLines div {
        width: 0.125rem;
    }
    #pageView {
        min-height: calc(100svh - var(--header-height-mobile) - 2rem);
        padding: 1rem;
        padding-top: calc(var(--header-height-mobile) + 1rem);
    }
    #pageViewContent {
        padding: 1.25rem;
        border-radius: 0.75rem;
    }
    #pageViewContent h2 {
        font-size: 2.5rem;
    }
    .about-ikb {
        padding: 1rem;
    }
    .about-ikb h3 {
        font-size: 2.5rem;
    }
    #pageViewContent .about-ikb .about-ikb-follow {
        font-size: 0.65rem;
    }
    .about-ikb-socials {
        gap: 0.75rem;
    }
    #pageViewContent p, #pageViewContent li {
        font-size: 1rem;
    }
    #pageViewContent #abbrevList {
        grid-template-columns: 1fr;
    }
    #siteFooter {
        margin-top: 0;
        padding: 2rem 1.25rem;
    }
    #footerContent h3 {
        font-size: 1.5rem;
    }
    .footer-socials {
        gap: 1rem;
    }
    .footer-socials a {
        font-size: 1rem;
    }
}
