/**
 * Lamprozo Template - Core Styles
 */

:root {
    --color-bg: #0e0e10;
    --color-surface: #18181b;
    --color-border: #2a2a2e;
    --color-text: #efeff1;
    --color-text-muted: #adadb8;
    --color-twitch: #9146ff;
    --color-youtube: #ff0000;
    --color-discord: #5865f2;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
}

/* ── Header ── */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 60px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

#header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

#logo img {
    height: 36px;
    width: auto;
}

#site-name {
    font-weight: 700;
    font-size: 1.1rem;
}

#site-name a {
    text-decoration: none;
    color: var(--color-text);
}

/* ── Nav ── */
nav {
    display: flex;
    align-items: center;
}

nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0;
}

nav li {
    position: relative;
}

nav a {
    display: block;
    padding: 0.5rem 0.9rem;
    text-decoration: none;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.15s;
    white-space: nowrap;
}

nav a:hover {
    color: var(--color-text);
}

/* ── Dropdown ── */
nav ul ul {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    min-width: 140px;
    flex-direction: column;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

nav ul ul li {
    width: 100%;
}

nav ul ul a {
    padding: 0.5rem 1rem;
}

nav li:hover > ul {
    display: flex;
}

/* ── Main ── */
main {
    min-height: calc(100vh - 200px);
}

.content {
    max-width: 100%;
}

/* ── Hero ── */
.home-hero {
    background: linear-gradient(135deg, #1a0a2e 0%, #0e0e10 60%);
    border-bottom: 1px solid var(--color-border);
    padding: 4rem 2rem;
    text-align: center;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 0%, var(--color-twitch) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.75rem;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

.hero-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── Buttons ── */
.btn {
    display: inline-block;
    padding: 0.65rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: opacity 0.15s, transform 0.1s;
}

.btn:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--color-twitch);
    color: #fff;
}

.btn-twitch {
    background: var(--color-twitch);
    color: #fff;
}

.btn-youtube {
    background: var(--color-youtube);
    color: #fff;
}

.btn-discord {
    background: var(--color-discord);
    color: #fff;
}

/* ── About page ── */
.about-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.about-hero {
    margin-bottom: 3rem;
    border-left: 4px solid var(--color-twitch);
    padding-left: 1.25rem;
}

.about-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0 0 0.4rem;
}

.about-subtitle {
    color: var(--color-text-muted);
    font-size: 1rem;
    margin: 0;
}

.about-block {
    margin-bottom: 2.5rem;
}

.about-block h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    color: var(--color-twitch);
}

.about-block p {
    color: var(--color-text);
    line-height: 1.8;
    margin: 0 0 1rem;
}

.about-cats-img {
    width: 100%;
    max-width: 480px;
    border-radius: 10px;
    display: block;
}

/* ── Active challenge ── */
.active-challenge {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.active-challenge__inner {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-twitch);
    border-radius: 8px;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.active-challenge__label {
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: var(--color-twitch);
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.active-challenge__title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    color: var(--color-text);
}

.active-challenge__meta {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin: 0;
}

.active-challenge__inner > .btn {
    margin-left: auto;
    white-space: nowrap;
}

/* ── Stream section ── */
.stream-section {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.stream-header {
    margin-bottom: 1rem;
}

.stream-title {
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.live-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-border);
}

.stream-embed-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--color-surface);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--color-border);
}

#twitch-embed,
#twitch-embed iframe,
.twitch-iframe {
    width: 100% !important;
    height: 100% !important;
    border: 0;
    display: block;
}

/* ── Footer ── */
footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    color: var(--color-text-muted);
    padding: 2rem;
    text-align: center;
    font-size: 0.9rem;
}

footer p {
    margin: 0.25rem 0;
}

.footer-contact a {
    color: var(--color-twitch);
    text-decoration: none;
}

.footer-contact a:hover {
    text-decoration: underline;
}

/* ── 404 ── */
.error-404 {
    text-align: center;
    padding: 6rem 2rem;
}

.error-404 h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.error-404 a {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--color-twitch);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
}

/* ── Runs page ── */
.runs-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.runs-header {
    margin-bottom: 2.5rem;
}

.runs-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
}

.runs-subtitle {
    color: var(--color-text-muted);
    font-size: 1rem;
}

.challenges-group {
    margin-bottom: 2.5rem;
}

.challenges-group__title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    font-weight: 700;
    margin: 0 0 1rem;
}

.runs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.run-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: border-color 0.15s;
}

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

.run-card--ongoing {
    border-left: 3px solid #00c853;
}

.run-card--completed {
    border-left: 3px solid var(--color-twitch);
}

.run-card--failed {
    border-left: 3px solid #ff1744;
}

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.status-badge--ongoing {
    background: rgba(0, 200, 83, 0.15);
    color: #00c853;
}

.status-badge--completed {
    background: rgba(145, 70, 255, 0.15);
    color: var(--color-twitch);
}

.status-badge--failed {
    background: rgba(255, 23, 68, 0.15);
    color: #ff1744;
}

.run-card__title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.run-card__meta {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.run-card__footer {
    margin-top: auto;
}

.run-card__link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--color-twitch);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: opacity 0.15s;
}

.run-card__link:hover {
    opacity: 0.85;
}

/* ── Challenge detail page ── */
.challenge-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.challenge-back {
    display: inline-block;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    transition: color 0.15s;
}

.challenge-back:hover {
    color: var(--color-text);
}

.challenge-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.3rem;
}

.challenge-meta {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.challenge-description {
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

.challenge-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
    padding: 1.25rem 1.5rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat__value {
    font-size: 1.5rem;
    font-weight: 800;
}

.stat__label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat--highlight .stat__value {
    color: #00c853;
}

.attempts-section {
    margin-bottom: 2.5rem;
}

.attempts-section__title {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
}

.attempts-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.attempt-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    border-left: 3px solid var(--color-border);
    overflow: hidden;
}

.attempt-card--ongoing   { border-left-color: #00c853; }
.attempt-card--failed    { border-left-color: #ff1744; }
.attempt-card--completed { border-left-color: var(--color-twitch); }

.attempt-card__header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0.65rem 1rem;
    gap: 0.35rem;
    width: 100%;
    background: none;
    border: none;
    color: var(--color-text);
    cursor: pointer;
    text-align: left;
}

.attempt-card__header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.attempt-card__header:hover {
    background: rgba(255,255,255,0.03);
}

.attempt-card__notes-preview {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attempt-card--open .attempt-card__notes-preview {
    display: none;
}

.attempt-card__left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.attempt-card__meta-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.attempt-card__vod-count {
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

.attempt-card__badges {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.attempt-card__badge-img {
    height: 20px;
    width: auto;
    display: block;
    image-rendering: -webkit-optimize-contrast;
}

.attempt-card__chevron {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    transition: transform 0.2s;
}

.attempt-card--open .attempt-card__chevron {
    transform: rotate(180deg);
}

.attempt-card__number {
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 100px;
}

.attempt-card__split {
    font-size: 0.82rem;
    color: var(--color-text-muted);
}

/* Collapsible body */
.attempt-card__body {
    display: none;
    padding: 0.75rem 1rem 1rem;
    border-top: 1px solid var(--color-border);
}

.attempt-card--open .attempt-card__body {
    display: block;
}

.attempt-card__notes {
    font-size: 0.88rem;
    color: var(--color-text-muted);
    font-style: italic;
    margin-bottom: 0.75rem;
}

.attempt-card__empty {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* VOD thumbnail grid */
.attempt-card__vod-grid {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.vod-thumb {
    text-decoration: none;
    color: var(--color-text);
    width: 160px;
    flex-shrink: 0;
}

.vod-thumb__img {
    width: 160px;
    height: 90px;
    border-radius: 6px;
    background-color: #000;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    margin-bottom: 0.4rem;
    border: 1px solid var(--color-border);
    transition: border-color 0.15s;
}

.vod-thumb:hover .vod-thumb__img {
    border-color: var(--color-twitch);
}

.vod-thumb__img--no-thumb {
    background-color: var(--color-surface);
}

.vod-thumb__num {
    position: absolute;
    top: 6px;
    left: 8px;
    background: rgba(0,0,0,0.65);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
}

.vod-thumb__play {
    width: 36px;
    height: 36px;
    background: rgba(145,70,255,0.85);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #fff;
    padding-left: 3px;
}

.vod-thumb__label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vod-thumb__summary {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
    margin-top: 2px;
    white-space: normal;
    opacity: 0.85;
}

/* VOD thumbnail as button */
button.vod-thumb {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-align: left;
}

/* ── Fragsheet ── */
.fragsheet {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.fragsheet__heading {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin: 0 0 0.5rem;
    font-weight: 700;
}

.fragsheet__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.frag-mon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 72px;
    cursor: default;
}

.frag-mon__sprite {
    width: 56px;
    height: 56px;
    object-fit: contain;
    image-rendering: pixelated;
}

.frag-mon--dead .frag-mon__sprite {
    filter: grayscale(1) opacity(0.5);
}

.frag-mon__name {
    font-size: 0.68rem;
    text-align: center;
    color: var(--color-text);
    line-height: 1.2;
    word-break: break-word;
}

.frag-mon--dead .frag-mon__name {
    color: var(--color-text-muted);
}

.frag-mon__kills {
    font-size: 0.65rem;
    color: #e53935;
    font-weight: 600;
}

/* ── Pokémon tooltip ── */
.mon-tooltip {
    position: absolute;
    z-index: 200;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.75rem;
    width: 210px;
    font-size: 0.78rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    pointer-events: none;
    line-height: 1.5;
}

.mon-tooltip__name    { font-weight: 700; color: var(--color-text); margin-bottom: 2px; }
.mon-tooltip__nature  { color: var(--color-text-muted); font-style: italic; }
.mon-tooltip__ability { color: var(--color-text-muted); }
.mon-tooltip__met     { color: var(--color-text-muted); margin-bottom: 0.4rem; }

.mon-tooltip__ivs {
    width: 100%;
    border-collapse: collapse;
    margin: 0.4rem 0;
    font-size: 0.75rem;
}

.mon-tooltip__ivs th {
    color: var(--color-text-muted);
    font-weight: 600;
    text-align: center;
    padding: 2px 3px;
    border-bottom: 1px solid var(--color-border);
}

.mon-tooltip__ivs td {
    text-align: center;
    padding: 2px 3px;
    font-weight: 700;
}

.iv--max  { color: #00c853; }
.iv--zero { color: #e53935; }

.mon-tooltip__kills {
    color: var(--color-text-muted);
    font-size: 0.72rem;
    margin-top: 0.4rem;
    line-height: 1.6;
}

/* VOD lightbox modal */
.vod-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.vod-modal--open {
    display: flex;
}

.vod-modal__box {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    overflow: hidden;
    width: 100%;
    max-width: 960px;
}

.vod-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
}

.vod-modal__title {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 40px);
}

.vod-modal__close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 0 0.25rem;
    flex-shrink: 0;
}

.vod-modal__close:hover {
    color: var(--color-text);
}

.vod-modal__embed {
    width: 100%;
    aspect-ratio: 16 / 9;
}

.vod-modal__embed iframe {
    width: 100%;
    height: 100%;
    display: block;
}

.vod-modal__summary {
    padding: 1rem 1.25rem;
    color: var(--color-text);
    font-size: 0.95rem;
    line-height: 1.5;
    white-space: pre-wrap;
    border-top: 1px solid var(--color-border);
    max-height: 30vh;
    overflow-y: auto;
}

.vod-thumb__duration {
    position: absolute;
    bottom: 5px;
    right: 7px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
}
