/* Project V8: the page is the game's main menu, in the game's default theme
   (Theme.cs: backgroundTop/Bottom, button, accent, dim, silhouette). */

@font-face {
    font-family: 'Good Timing';
    src: url('/Font/GoodTimingBd.otf') format('opentype');
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: 'Unsteady Oversteer';
    src: url('/Font/UnsteadyOversteer.otf') format('opentype');
    font-display: swap;
}

:root {
    --bg-top: #A8338F;
    --bg-bottom: #F2865C;
    --panel: rgba(58, 15, 34, 0.80);
    --button: rgba(58, 14, 18, 0.72);
    --accent: #FFB13B;
    --text: #FFFFFF;
    --dim: rgba(255, 224, 230, 0.85);
    --silhouette: rgba(74, 14, 51, 0.32);
    --title-font: 'Good Timing', 'Arial Black', sans-serif;
    --label-font: 'Unsteady Oversteer', 'Trebuchet MS', sans-serif;

    /* For OverdriveCommunity.css (graph and tracks), in this theme. */
    --neon-orange: #FFB13B;
    --neon-purple: #F2865C;
    --dark-bg: rgba(30, 12, 22, 0.55);
    --card-bg: #3A0F22;
    --border-color: rgba(255, 255, 255, 0.14);
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 224, 230, 0.85);
    --error-color: #ff5c7a;
}

/* Unsteady Oversteer has capitals only. */
.status, .slant-btn small, .footer-note { text-transform: uppercase; letter-spacing: 1px; }

html {
    background: var(--bg-bottom);
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

body {
    background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100vh, var(--bg-bottom) 100%);
    color: var(--text);
    font-family: inherit;
    min-height: 100vh;
    overflow-x: hidden;
}

/* The site's global boxes around headings and links don't belong here. */
h1, h2, h3, h4, a { background: none; width: auto; }
a { color: inherit; }

/* ---------- The menu ---------- */

.menu {
    position: relative;
    height: 100vh;
    height: 100svh;
    min-height: 560px;
    overflow: hidden;
    isolation: isolate;
}

/* Just the palms: the menu's other scenery is left out. */
.scenery > div {
    position: absolute;
    pointer-events: none;
    background: var(--silhouette);
    -webkit-mask: var(--shape) no-repeat center / contain;
    mask: var(--shape) no-repeat center / contain;
}

/* The site's copy of the palm drops the art's 25% opacity, so it takes the theme's silhouette colour as the game does. */
/* Trunks stand on the bottom of the screen; each palm is the art mirrored, so they lean in towards the title. */
.palm {
    --shape: url('/CDN/Images/ProjectV8/over-tree-2-bg.svg');
    background: var(--silhouette);
    aspect-ratio: 713 / 627;
    bottom: 0;
    -webkit-mask-position: center bottom;
    mask-position: center bottom;
}
.palm-left  { width: min(68vw, 960px); left: -8vw; transform: scaleX(-1); }
.palm-right { width: min(60vw, 840px); right: -6vw; }

/* Portrait: one palm, large, leaning across the middle. */
@media (orientation: portrait) {
    .palm-right { display: none; }
    .palm-left { width: 165vw; left: -32vw; }
}

/* Top bar: the player, then the icon buttons. */
.top-bar {
    position: absolute;
    top: 0; left: 0; right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 28px;
    gap: 16px;
}

.player, .icons {
    display: flex;
    align-items: center;
    gap: 22px;
    min-width: 0;
}

.avatar {
    width: 58px; height: 58px;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.player-name, .stat {
    font-family: var(--title-font);
    font-size: 28px;
    letter-spacing: 1px;
    white-space: nowrap;
}

.stat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.stat img { height: 0.95em; }

.icons a { display: block; line-height: 0; transition: transform 0.15s; }
.icons a:hover { transform: scale(1.1); }
.icons img { height: 44px; }
.icons a:first-child img { opacity: 0.6; }

/* The GOALS tab, here for patch notes. */
.goal-tab {
    position: absolute;
    right: 0;
    top: 120px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 26px 14px 46px;
    background: var(--button);
    clip-path: polygon(30px 0, 100% 0, 100% 100%, 30px 100%, 0 50%);
    font-family: var(--title-font);
    font-size: 26px;
    color: var(--dim);
    text-decoration: none;
    transition: color 0.15s, padding 0.15s;
}

.goal-tab img { height: 30px; opacity: 0.8; }
.goal-tab:hover { color: var(--text); padding-right: 34px; }

/* Title */
.title-block {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 16px;
    pointer-events: none;
}

.logo-title {
    margin: 0;
    font-family: var(--title-font);
    font-weight: 700;
    color: var(--accent);
    font-size: clamp(54px, 11vw, 150px);
    line-height: 1;
    letter-spacing: 2px;
}

.tagline {
    margin: 26px 0 0;
    font-family: var(--title-font);
    font-size: clamp(14px, 2.2vw, 30px);
    letter-spacing: 0.5em;
    margin-right: -0.5em; /* the last letter's spacing would push it off centre */
}

.status {
    margin: 18px 0 0;
    font-family: var(--label-font);
    font-size: clamp(14px, 1.7vw, 22px);
    color: var(--dim);
    min-height: 1.3em;
}

/* Bottom bar: corner tabs and the two play buttons. */
.bottom-bar {
    position: absolute;
    left: 0; right: 0;
    bottom: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
}

.bottom-bar > * { pointer-events: auto; }

.corner {
    display: flex;
    align-items: center;
    height: 80px;
    background: var(--button);
    text-decoration: none;
    transition: filter 0.15s;
}

.corner:hover { filter: brightness(1.4); }
.corner img { height: 46px; }
.corner-left  { padding: 0 66px 0 28px; clip-path: polygon(0 0, 100% 0, calc(100% - 60px) 100%, 0 100%); }
.corner-right { padding: 0 28px 0 66px; clip-path: polygon(60px 0, 100% 0, 100% 100%, 0 100%); }
.corner-right img { height: 40px; }

.play-buttons {
    display: flex;
    gap: 34px;
    justify-content: center;
    flex: 1;
    min-width: 0;
}

.slant-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 300px;
    height: 80px;
    padding: 0 60px;
    box-sizing: border-box;
    border: none;
    background: var(--button);
    clip-path: polygon(64px 0, 100% 0, calc(100% - 64px) 100%, 0 100%);
    color: var(--text);
    font-family: var(--title-font);
    font-size: 34px;
    letter-spacing: 1px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}

.slant-btn small {
    font-family: var(--label-font);
    font-size: 14px;
    letter-spacing: 0;
    color: var(--dim);
}

.slant-btn:hover:not(:disabled) { background: rgba(58, 14, 18, 0.9); transform: translateY(-2px); }
.slant-btn.mine { color: var(--accent); }
.slant-btn:disabled { cursor: default; color: rgba(255, 255, 255, 0.45); }

/* ---------- Below the menu ---------- */

.panels {
    max-width: 90vw;
    margin: 0 auto;
    padding: 40px 16px 60px;
    display: grid;
    gap: 22px;
}

.panel {
    background: var(--panel);
    padding: 26px 30px;
    border-radius: 6px;
    line-height: 1.55;
    font-size: 17px;
}

.panel h2, .panel summary {
    margin: 0 0 12px;
    font-family: var(--title-font);
    font-size: 26px;
    color: var(--accent);
    letter-spacing: 1px;
}

.panel p { margin: 0 0 10px; }
.panel .dim { color: var(--dim); }

.features {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
    display: grid;
    gap: 10px;
}

.features li { display: flex; align-items: center; gap: 12px; }
.features img { height: 20px; width: 24px; object-fit: contain; flex: none; }

.slant-btn.small {
    min-width: 0;
    height: 56px;
    padding: 0 48px;
    font-size: 22px;
    margin-top: 8px;
    clip-path: polygon(36px 0, 100% 0, calc(100% - 36px) 100%, 0 100%);
    background: rgba(58, 14, 18, 0.85);
}

.footer-note {
    text-align: center;
    color: var(--dim);
    font-family: var(--label-font);
    margin: 0;
}

.footer-note a { text-decoration: underline; }

/* The re-imagining line leads the description. */
.panel .lead {
    font-family: var(--title-font);
    font-size: 21px;
    line-height: 1.35;
    color: var(--text);
    margin-bottom: 14px;
}

.panel .small { font-size: 14px; }

/* Developers */
.devs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.dev {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(0, 0, 0, 0.22);
    padding: 12px 14px;
    border-radius: 6px;
}

.dev img {
    width: 56px; height: 56px;
    border-radius: 50%;
    object-fit: cover;
    flex: none;
}

.dev > div { display: flex; flex-direction: column; min-width: 0; }
.dev-name { font-family: var(--title-font); font-size: 20px; color: var(--accent); text-decoration: none; }
.dev-name:hover { text-decoration: underline; }
.dev-role { color: var(--dim); font-size: 14px; }

/* Graph and tracks: the shared styles, settled into the panels (they expect border-box sizing). */
.community *, .track-popup-overlay, .track-popup-overlay * { box-sizing: border-box; }
.community #usergraph, .community #trackviewer { clip-path: none; border-radius: 4px; margin-bottom: 0; }
.community #usergraph { box-shadow: none; }
.community #trackviewer { min-height: 200px; }
.community button, .track-popup button {
    font-family: inherit;
    color: var(--text-primary);
    background: var(--button);
    border: 1px solid var(--border-color);
    padding: 8px 14px;
    cursor: pointer;
}
.track-popup .comment-submit { background: var(--accent); color: #3A0E12; border: none; font-weight: 700; }
.track-popup { border-radius: 6px; }

/* Release admin (admins only; markup from /projectV8Admin.js) */
#release-admin[hidden], #release-admin [hidden] { display: none !important; }
#release-admin summary { cursor: pointer; margin: 0; }
#release-admin[open] summary { margin-bottom: 12px; }
#release-admin .section-title { font-size: 18px; margin: 0 0 8px; color: var(--text); }
#release-admin .section-icon { display: none; }
#release-admin .section-blurb, #release-admin .v8-current, #release-admin .v8-progress { color: var(--dim); font-size: 13px; word-break: break-word; }
#release-admin .v8-current b { color: var(--text); }
#release-admin .form-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-top: 12px; }
#release-admin .form-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
#release-admin label { font-size: 13px; color: var(--dim); }
#release-admin input { background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 255, 255, 0.25); color: var(--text); padding: 8px; min-width: 0; font-family: inherit; }
#release-admin .form-actions { margin-top: 14px; }
#release-admin .btn { background: var(--accent); color: #3A0E12; border: none; padding: 10px 20px; font-weight: 700; cursor: pointer; }
#release-admin .btn:disabled { opacity: 0.4; cursor: default; }
#release-admin .error-message, #release-admin .success-message { padding: 10px 14px; margin-top: 12px; border: 1px solid; }
#release-admin .error-message { color: #ffb4b4; }
#release-admin .success-message { color: #b8ffc9; }

/* ---------- Narrow screens: the menu stacks ---------- */

@media (max-width: 900px) {
    .player-name, .stat:last-child { display: none; }
    .stat { font-size: 22px; }
    .goal-tab { top: 100px; font-size: 20px; padding: 10px 18px 10px 40px; }
    .goal-tab img { height: 22px; }
    .slant-btn { min-width: 0; padding: 0 44px; font-size: 26px; height: 70px; clip-path: polygon(40px 0, 100% 0, calc(100% - 40px) 100%, 0 100%); }
    .corner { height: 64px; }
    .corner img { height: 34px; }
    .corner-left  { padding: 0 44px 0 16px; clip-path: polygon(0 0, 100% 0, calc(100% - 40px) 100%, 0 100%); }
    .corner-right { padding: 0 16px 0 44px; clip-path: polygon(40px 0, 100% 0, 100% 100%, 0 100%); }
    .corner-right img { height: 30px; }
    #release-admin .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .top-bar { padding: 16px; }
    .avatar { width: 46px; height: 46px; }
    .icons { gap: 16px; }
    .icons img { height: 34px; }
    .logo-title { font-size: 12.5vw; white-space: nowrap; }
    .tagline { letter-spacing: 0.3em; margin-right: -0.3em; }
    /* The play buttons stack in the middle; the corner tabs stay at the edges, lower down. */
    .bottom-bar { bottom: 28px; flex-wrap: wrap; }
    .play-buttons { order: -1; flex-basis: 100%; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 22px; }
    .slant-btn { width: min(78vw, 320px); }
    .panel { padding: 20px; font-size: 16px; }
}
