@font-face {
    font-family: "Tomorrow";
    src: url("/display_font.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --bulma-link-h: 193deg;
    --bulma-link-s: 100%;
    --bulma-link-l: 44%;
    --bulma-primary-h: 158deg;
    --bulma-primary-s: 100%;
    --bulma-primary-l: 48%;
    --nascent-cyan: #00b1e1;
    --nascent-green: #00f59a;
    --nascent-gradient: linear-gradient(90deg, var(--nascent-cyan), var(--nascent-green));
    --nascent-display: "Tomorrow", sans-serif;
}

:root[data-theme=dark] {
    --bulma-scheme-main-l: 6%;
    --bulma-scheme-main-bis-l: 8%;
    --bulma-scheme-main-ter-l: 10%;
    --bulma-background-l: 11%;
    --bulma-border-weak-l: 17%;
    --bulma-border-l: 20%;
    --bulma-link-text-l: 58%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-variant-numeric: tabular-nums;
}

#app {
    display: flex;
    flex: 1;
    flex-direction: column;
}

main {
    flex: 1;
}

main:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--nascent-cyan);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -3rem;
    z-index: 100;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    background: var(--nascent-cyan);
    color: #041015;
    font-weight: 600;
}

.skip-link:focus {
    top: 1rem;
}

.title,
.subtitle,
.stat-value,
.difficulty-value,
.navbar-brand .navbar-item {
    font-family: var(--nascent-display);
    font-weight: 400;
}

.navbar-burger {
    border: none;
    background: none;
    color: inherit;
}

.nav-logo {
    width: 1.75rem;
    height: 1.75rem;
    max-height: none;
}

.navbar-item.is-active,
.tabs li.is-active a {
    background-image: var(--nascent-gradient);
    background-position: bottom;
    background-repeat: no-repeat;
    background-size: 100% 2px;
}

.tabs li.is-active a {
    border-bottom-color: transparent;
}

a.navbar-item.is-active,
a.navbar-item.is-active:hover,
a.navbar-item.is-active:focus,
a.navbar-item.is-active:focus-within {
    background-color: transparent;
    color: var(--bulma-navbar-item-color);
}

.button.is-primary {
    background-image: var(--nascent-gradient);
    border: none;
    color: #041015;
    font-weight: 600;
}

.button.is-primary:hover {
    filter: brightness(1.08);
}

.is-refreshing {
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 0.15s;
}

.hero {
    margin-bottom: 2rem;
    border-radius: 12px;
    background: radial-gradient(ellipse at 20% 0%, rgba(0, 177, 225, 0.18), transparent 60%), radial-gradient(ellipse at 90% 100%, rgba(0, 245, 154, 0.12), transparent 55%), #070a0e;
}

.hero-body {
    padding: 3rem 2rem;
}

.home-logo {
    display: block;
    width: 100%;
    max-width: 34rem;
    height: auto;
}

.hero-tagline {
    max-width: 36rem;
    margin-top: 1rem !important;
    color: var(--bulma-text-weak);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem;
}


.auth-box {
    max-width: 26rem;
}

.auth-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.session-client {
    max-width: 16rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.review-flags {
    list-style: disc;
    margin-left: 1.25rem;
}

.review-actions {
    max-width: 40rem;
}

.logo-loader {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    padding: 4rem 0;
}

.logo-loader img {
    width: 2.5rem;
    height: 2.5rem;
    opacity: 0.18;
    animation: letter-light 1.4s ease-in-out infinite;
}

@keyframes letter-light {
    0%,
    55%,
    100% {
        opacity: 0.18;
        filter: none;
    }

    20% {
        opacity: 1;
        filter: drop-shadow(0 0 6px rgba(0, 220, 200, 0.7));
    }
}

.box.stat {
    height: 100%;
    text-align: center;
}

.stat-label {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bulma-text-weak);
}

.stat-value {
    font-size: 1.5rem;
    line-height: 1.3;
}

.grade {
    display: inline-block;
    min-width: 1.8em;
    padding: 0 0.4em;
    border-radius: 4px;
    background-color: #141414;
    font-family: var(--nascent-display);
    font-size: 1.15em;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
}

.grade-X { color: var(--grade-x); }
.grade-S { color: var(--grade-s); }
.grade-A { color: var(--grade-a); }
.grade-B { color: var(--grade-b); }
.grade-C { color: var(--grade-c); }
.grade-D { color: var(--grade-d); }
.grade-E { color: var(--grade-e); }
.grade-F { color: var(--grade-f); }

.grade-X,
.grade-S {
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 35%, transparent);
    text-shadow: 0 0 0.45em color-mix(in srgb, currentColor 65%, transparent);
}

.grade-X {
    animation: grade-glow 4s linear infinite, grade-shimmer 2.1s ease-in-out infinite;
}

@keyframes grade-shimmer {
    0%, 100% { color: var(--grade-x); }
    50% { color: color-mix(in srgb, var(--grade-x) 30%, white); }
}

@keyframes grade-glow {
    0%, 100% { text-shadow: 0 0 0.45em color-mix(in srgb, var(--nascent-cyan) 70%, transparent); }
    50% { text-shadow: 0 0 0.45em color-mix(in srgb, var(--nascent-green) 70%, transparent); }
}

.grade-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
}

.grade-counts li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rank-medal {
    display: inline-block;
    min-width: 2.6em;
    padding: 0 0.5em;
    border-radius: 999px;
    font-family: var(--nascent-display);
    text-align: center;
    color: var(--medal);
    background: color-mix(in srgb, var(--medal) 14%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--medal) 50%, transparent), 0 0 0.6em color-mix(in srgb, var(--medal) 18%, transparent);
}

.rank-1 { --medal: var(--rank-1); }
.rank-2 { --medal: var(--rank-2); }
.rank-3 { --medal: var(--rank-3); }

.podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 1rem;
    margin: 1.5rem 0 2rem;
}

.podium-place {
    display: flex;
    flex: 0 1 12rem;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    text-align: center;
    color: inherit;
}

.podium-name {
    max-width: 100%;
    overflow: hidden;
    font-family: var(--nascent-display);
    font-size: 1.15rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.podium-place:hover .podium-name {
    text-decoration: underline;
}

.podium-performance {
    font-family: var(--nascent-display);
    font-size: 1.4rem;
    color: var(--medal);
}

.podium-accuracy {
    color: var(--bulma-text-weak);
}

.podium-block {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-radius: 0.5rem 0.5rem 0 0;
    font-family: var(--nascent-display);
    font-size: 2rem;
    color: var(--medal);
    background: linear-gradient(to top, color-mix(in srgb, var(--medal) 4%, transparent), color-mix(in srgb, var(--medal) 26%, transparent));
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--medal) 70%, transparent), 0 -0.4em 1.2em color-mix(in srgb, var(--medal) 12%, transparent);
}

.podium-place.rank-1 .podium-block { height: 7rem; }
.podium-place.rank-2 .podium-block { height: 5rem; }
.podium-place.rank-3 .podium-block { height: 3.75rem; }

.table td,
.table th {
    vertical-align: middle;
}

.is-numeric {
    text-align: right !important;
    white-space: nowrap;
}

.rate-changed {
    color: rgb(240, 190, 70);
    font-weight: 600;
}

.chart-name {
    min-width: 16rem;
}

.range-input {
    width: 6.5rem;
}

.player-search {
    position: relative;
}

.player-search .input {
    width: 14rem;
}

.search-results {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    right: 0;
    z-index: 30;
    padding: 0.25rem;
}

.search-results li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
}

.search-results li.is-active,
.search-results li[role=option]:not([aria-disabled]):hover {
    background: var(--bulma-background);
}

.play-summary,
.chart-headline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem 2.5rem;
}

.play-grade {
    font-size: 3rem;
    padding: 0 0.3em;
}

.play-grade.grade-X,
.play-grade.grade-S {
    text-shadow: 0 0 0.35em color-mix(in srgb, currentColor 75%, transparent), 0 0 0.9em color-mix(in srgb, currentColor 35%, transparent);
}

.play-stat .stat-value {
    font-size: 1.35rem;
}

.difficulty-value {
    font-size: 3rem;
    line-height: 1.1;
    text-shadow: 0 0 0.5em color-mix(in srgb, currentColor 35%, transparent);
}

.judgement-count {
    gap: 0.5rem;
}

.judgement-name {
    font-family: var(--nascent-display);
}

.judgement-perfect { color: var(--judgement-perfect); }
.judgement-amazing { color: var(--judgement-amazing); }
.judgement-great { color: var(--judgement-great); }
.judgement-good { color: var(--judgement-good); }
.judgement-bad { color: var(--judgement-bad); }
.judgement-miss { color: var(--judgement-miss); }

.density-graph,
.hit-error-graph {
    margin: 0;
}

.density-graph svg {
    display: block;
    width: 100%;
    height: 5rem;
}

.hit-error-graph svg {
    display: block;
    width: 100%;
    height: 9rem;
}

.graph-background {
    fill: rgba(255, 255, 255, 0.03);
}

.graph-center {
    stroke: rgba(255, 255, 255, 0.3);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.graph-miss {
    stroke: rgba(255, 60, 60, 0.35);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.replay-viewer {
    display: grid;
    grid-template-columns: auto minmax(16rem, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.replay-side {
    min-width: 0;
}

.replay-stage canvas {
    display: block;
    margin: 0;
    border-radius: 8px;
    cursor: pointer;
}

.replay-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.replay-timeline svg {
    height: 9rem;
    border-radius: 6px;
}

.hit-error-graph.is-seekable svg {
    cursor: pointer;
    touch-action: none;
}

.hit-error-graph.is-seekable svg:focus-visible {
    outline: 2px solid var(--nascent-cyan);
    outline-offset: 2px;
}

.graph-played {
    fill: rgba(0, 177, 225, 0.1);
    pointer-events: none;
}

.graph-playhead {
    stroke: var(--nascent-cyan);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
    pointer-events: none;
}

.replay-clock {
    min-width: 3rem;
}

.chart-links {
    margin-bottom: 1rem;
}

.history-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.history-value .stat-value {
    font-size: 1.25rem;
}

.history-graph svg {
    display: block;
    width: 100%;
    height: 9rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    touch-action: none;
}

.history-line {
    fill: none;
    stroke: var(--nascent-cyan);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

.history-cursor {
    stroke: rgba(255, 255, 255, 0.4);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.history-axis {
    display: flex;
    justify-content: space-between;
    margin-top: 0.25rem;
}

.history-empty {
    padding: 2rem 0;
}

.activity-heatmap {
    margin: 0;
}

.activity-scroll {
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.activity-scroll svg {
    display: block;
    width: 100%;
    height: auto;
    min-width: 36rem;
}

.heat-label {
    fill: var(--bulma-text-weak);
    font-size: 9px;
}

.heat-0 { fill: rgba(255, 255, 255, 0.06); }
.heat-1 { fill: #0b4a5c; }
.heat-2 { fill: #007ea3; }
.heat-3 { fill: #00b1e1; }
.heat-4 { fill: #00f59a; }

.favorite-charts {
    list-style: none;
    margin: 0;
}

.favorite-charts li + li {
    margin-top: 0.75rem;
}

.sort-link {
    color: inherit;
    white-space: nowrap;
}

.sort-link:hover,
.sort-link.is-sorted {
    color: var(--nascent-cyan);
}

.sort-arrow {
    display: inline-block;
    margin-left: 0.25rem;
    font-size: 0.7em;
}

.skill-scatter svg {
    display: block;
    width: 100%;
    height: auto;
    margin-top: 0.5rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
}

.scatter-grid {
    stroke: rgba(255, 255, 255, 0.07);
    stroke-width: 1;
}

.scatter-label {
    fill: var(--bulma-text-weak);
    font-size: 11px;
}

.scatter-point {
    cursor: pointer;
    stroke: rgba(0, 0, 0, 0.5);
    stroke-width: 1;
    transition: r 0.1s;
}

.scatter-point:focus {
    outline: none;
    stroke: #ffffff;
    stroke-width: 2;
}

.skill-detail {
    min-height: 2.5em;
    margin-top: 0.5rem;
}

.daily-bars {
    margin: 0;
}

.daily-bars svg {
    display: block;
    width: 100%;
    height: 8rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
}

.daily-caption {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.25rem;
}

.share-bars {
    list-style: none;
    margin: 0;
}

.share-bars li {
    display: grid;
    grid-template-columns: 2.5rem 1fr 4.5rem;
    align-items: center;
    gap: 0.75rem;
}

.share-bars li + li {
    margin-top: 0.4rem;
}

.share-label {
    font-family: var(--nascent-display);
}

.share-track {
    height: 0.6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.share-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--nascent-gradient);
}

.share-value {
    text-align: right;
}

@media screen and (max-width: 768px) {
    .podium {
        gap: 0.5rem;
    }

    .podium-name,
    .podium-performance {
        font-size: 1rem;
    }

    .podium-accuracy {
        font-size: 0.85rem;
    }

    .replay-viewer {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.75rem;
    }

    .replay-timeline svg {
        height: 6rem;
    }

    .hero {
        margin-bottom: 1.5rem;
    }

    .hero-body {
        padding: 2rem 1.25rem;
    }

    .chart-name {
        min-width: 11rem;
    }

    .player-search .input {
        width: 100%;
    }

    .play-grade,
    .difficulty-value {
        font-size: 2.25rem;
    }

    .table td,
    .table th {
        padding: 0.4em 0.5em;
    }
}

@media (prefers-reduced-motion: reduce) {
    .logo-loader img {
        animation: none;
        opacity: 0.6;
    }

    .grade-X {
        animation: none;
    }
}

.is-selected-mode th,
.is-selected-mode td {
    background: rgba(0, 177, 225, 0.07);
}
