html,
body {
    height: 100%;
}

body {
    font-family: "JetBrains Mono", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.logo {
    max-width: 4.5rem;
}

.logo-group {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.5rem;
}

.logo-text {
    margin-bottom: 0;
    margin-left: 1.5rem;
    text-align: left;
}

.logo-text-up {
    margin-bottom: -5px;
    font-size: 20px;
    opacity: 0.7;
}

.logo-text-down {
    font-size: 40px;
    margin-bottom: 0;
    letter-spacing: 2px;
}

.scores {
    display: flex;
    /* flex-direction: column; */
    flex-direction: row;
    align-items: flex-start;
    flex-wrap: wrap;
    max-width: 60em;
    gap: 0.75rem;
    justify-content: center;
    margin: 0 auto;
    /* align-items: center; */
}

.score-card {
    width: 25rem;
}

.score-card .card-body {
    padding: 0.75rem;
}

.score-thumb {
    width: 6.25rem;
    position: relative;
}

/* A4 ratio (1 : 1.414) */
.score-thumb::before {
    content: "";
    display: block;
    padding-top: 141.4%;
}

.score-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.2rem;
    border: 1px solid rgba(0,0,0,.125);
    background: rgba(0,0,0,.02);
}

.score-thumb-img {
    cursor: pointer;
}

.score-preview-img {
    width: 100%;
    height: auto;
    max-height: calc(100vh - 10rem);
    object-fit: contain;
    display: block;
}

/* Keep preview modal close to A4 aspect (w/h ≈ 0.707) */
#scorePreviewModal .score-preview-dialog {
    width: 90vw;
    max-width: calc((100vh - 10rem) * 0.707);
}

.score-meta {
    margin-left: 1.1rem;
    min-width: 0;
    flex: 1;
    position: relative;
}

.score-dates {
    position: absolute;
    right: 0;
    bottom: 0;
    font-size: 0.8em;
    white-space: nowrap;
}

.score-title-row {
    min-width: 0;
}

.score-title {
    min-width: 0;
}

.score-note {
    font-size: 0.85em;
}

.card-body {
    padding: 0.75rem;
}

.fake-link {
    color: inherit;
    text-decoration: none;
}

.fake-link:hover {
    color: inherit;
    text-decoration: none;
}

#colormode {
    position: fixed;
    margin-left: 4px;
    margin-right: 4px;
    bottom: 1em;
    right: 1em;
    color: #222;
}

[data-theme='dark'] body {
    background-color: #1d1d1d;
    color: rgba(255,255,255,0.9);
}

[data-theme='dark'] #colormode {
    color: rgba(255,255,255,0.9);
}

[data-theme='dark'] .card {
    background-color: #1d1d1d;
    border: 1px solid rgba(255,255,255,.125)
}

[data-theme='dark'] .modal-content {
    background-color: #1d1d1d;
    border: 1px solid rgba(255,255,255,.125);
}

[data-theme='dark'] .modal-header {
    border-bottom-color: rgba(255,255,255,.125);
}

[data-theme='dark'] .modal .close {
    color: rgba(255,255,255,.7);
    text-shadow: none;
    opacity: .85;
}

[data-theme='dark'] .modal .close:hover {
    color: rgba(255,255,255,.85);
    opacity: 1;
}

[data-theme='dark'] .score-thumb img {
    border-color: rgba(255,255,255,.125);
    background: rgba(255,255,255,.03);
}

/* Dark-mode popover */
[data-theme='dark'] .popover {
    background-color: #1d1d1d;
    border-color: rgba(255,255,255,.125);
}

[data-theme='dark'] .popover-body {
    color: rgba(255,255,255,0.9);
}

[data-theme='dark'] .popover-header {
    background-color: #1d1d1d;
    color: rgba(255,255,255,0.9);
    border-bottom-color: rgba(255,255,255,.125);
}

/* Arrow border (before) + arrow fill (after) */
[data-theme='dark'] .bs-popover-top .arrow::before,
[data-theme='dark'] .bs-popover-auto[x-placement^="top"] .arrow::before {
    border-top-color: rgba(255,255,255,.125);
}
[data-theme='dark'] .bs-popover-top .arrow::after,
[data-theme='dark'] .bs-popover-auto[x-placement^="top"] .arrow::after {
    border-top-color: #1d1d1d;
}

[data-theme='dark'] .bs-popover-right .arrow::before,
[data-theme='dark'] .bs-popover-auto[x-placement^="right"] .arrow::before {
    border-right-color: rgba(255,255,255,.125);
}
[data-theme='dark'] .bs-popover-right .arrow::after,
[data-theme='dark'] .bs-popover-auto[x-placement^="right"] .arrow::after {
    border-right-color: #1d1d1d;
}

[data-theme='dark'] .bs-popover-bottom .arrow::before,
[data-theme='dark'] .bs-popover-auto[x-placement^="bottom"] .arrow::before {
    border-bottom-color: rgba(255,255,255,.125);
}
[data-theme='dark'] .bs-popover-bottom .arrow::after,
[data-theme='dark'] .bs-popover-auto[x-placement^="bottom"] .arrow::after {
    border-bottom-color: #1d1d1d;
}

[data-theme='dark'] .bs-popover-left .arrow::before,
[data-theme='dark'] .bs-popover-auto[x-placement^="left"] .arrow::before {
    border-left-color: rgba(255,255,255,.125);
}
[data-theme='dark'] .bs-popover-left .arrow::after,
[data-theme='dark'] .bs-popover-auto[x-placement^="left"] .arrow::after {
    border-left-color: #1d1d1d;
}

.heti-spacing {
    font-size: 0.5em;
}