/* Page Background */
html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

body {
    background-color: #0A0A0A;
    font-family: Arial, Helvetica, system-ui, sans-serif;
    margin: 0;
    padding: 20px;
    color: #FFD400;
}

.top-actions {
    max-width: 1400px;
    margin: 0 auto 8px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.top-action-btn {
    width: 34px;
    height: 34px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #000000;
    border: 2px solid #FFD400;
    border-radius: 4px;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    text-decoration: none;
    line-height: 0;
    overflow: hidden;
}

.top-action-btn img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: block;
}

.top-action-btn:focus-visible {
    outline: 1px solid #FFD400;
    outline-offset: 1px;
}

/* Main Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    background-color: #000000;
    border: 2px solid #FFD400;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(255, 212, 0, 0.1);
}

/* Header Styling */
.banner {
    background-color: #000000;
    padding: 10px 0;
    text-align: center;
}

.banner img {
    max-width: 100%;
    height: auto;
    display: inline-block;
}

.header {
    background-color: #FFD400;
    color: #000000;
    padding: 2px 0;
    border-bottom: 2px solid #FFD400;
}

.header h2 {
    display: grid;
    grid-template-columns: 20% 26% 26% 18% 10%;
    gap: 0;
    margin: 0;
    padding: 0;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
    align-items: start;
    width: 100%;
    box-sizing: border-box;
}

.header h2 > span {
    padding: 4px 12px;
    white-space: nowrap;
}

.header-footnote {
    display: inline-block;
    font-size: 9px;
    line-height: 1;
    margin-left: 1px;
    vertical-align: baseline;
    transform: translateY(-0.45em);
}

.header h2 > span:nth-child(1) { /* Release */
    text-align: left;
    padding-left: 14px;
}

.header h2 > span:nth-child(2) { /* Catalog */
    text-align: right;
}

.header h2 > span:nth-child(3) { /* Identification */
    text-align: left;
}

.header h2 > span:nth-child(4) { /* Acquisition Details */
    text-align: left;
    padding-left: 11px;
}

.header h2 > span:nth-child(5) { /* Personal Rating */
    text-align: right;
    padding-right: 12px;
    transform: translateX(-15px);
    position: relative;
}

.header h2 > span:nth-child(5)::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: #FFD400;
    transform: translateX(-6px);
}

/* Table Styling */
.cd-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #000000;
    color: #FFD400;
    table-layout: fixed; /* respect column widths */
}

.table-wrapper {
    max-height: none; /* allow full page height - no internal scrollbar */
    overflow: visible;
    overflow-x: auto;
}

.table-footnotes {
    max-width: 1400px;
    margin: 8px auto 0;
    padding: 0 12px;
}

.footnotes-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 4px;
}

.footnotes-content {
    margin-top: 4px;
}

.footnotes-content .table-footnote-line {
    margin: 0 0 4px;
}

.table-footnote-line {
    margin: 0;
    font-size: 10px;
    color: #FFD400;
    opacity: 0.8;
}

.table-last-updated {
    margin: 0;
    font-size: 10px;
    color: #FFD400;
    opacity: 0.8;
    text-align: right;
    white-space: nowrap;
}

.rating-legend-scale {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: flex-start;
}

.rating-legend-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-align: center;
}

.rating-legend-star {
    width: 22px;
    height: 22px;
    background-color: #FFD400;
    color: #000000;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    clip-path: polygon(50% 0%, 61% 35%, 100% 35%, 75% 57%, 80% 100%, 50% 75%, 20% 100%, 25% 57%, 0% 35%, 39% 35%);
}

.rating-legend-label {
    font-size: 9px;
    color: #FFD400;
    line-height: 1.1;
    white-space: nowrap;
}

/* horizontal row separators */
.cd-row {
    border-bottom: 1px solid #FFD400;
}


.cd-row td {
    vertical-align: middle;
    padding: 8px 12px; /* reduced padding */
    text-align: left;
}

.cd-row td:last-child {
    border-right: none;
}

.col-release {
    flex: 2;
}

.col-catalog {
    flex: 1.2;
}

.col-identification {
    flex: 1.2;
}

.col-acquisition {
    flex: 0.9;
}

.col-release { width: 20%; }
.col-catalog { width: 26%; text-align: right; }
.col-catalog .field { text-align: right; }
.col-identification { width: 26%; }
.col-acquisition { width: 18%; }
.col-rating { width: 10%; text-align: right; white-space: nowrap; overflow: visible; padding-left: 12px; transform: translateX(-15px); position: relative; }
.col-rating::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: #FFD400;
    transform: translateX(-6px);
}
.col-rating .rating {
    display: inline-block;
    white-space: nowrap;
    font-size: 16px; /* smaller to fit */
    letter-spacing: 1px;
}
.release-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Release container: thumbnail + text inline */
.release-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Album cover thumbnail sizing */
.album-cover {
    width: 50px;
    height: 50px;
    max-width: 50px;
    max-height: 50px;
    display: block;
    object-fit: cover;
    border: 1px solid #FFD400;
}

/* Field Styling */
.field {
    padding: 0;
    line-height: 1.4;
    color: #FFD400;
}

.album-title {
    font-weight: bold;
    font-size: 14px;
    color: #FFD400;
}

.artist-name {
    font-size: 12px;
    color: #FFD400;
    opacity: 0.9;
}

.label,
.catalog-number {
    font-size: 13px;
    color: #FFD400;
    margin-bottom: 4px;
}

.label strong,
.catalog-number strong {
    font-weight: bold;
}

.matrix,
.sids,
.year-region {
    font-size: 11px;
    color: #FFD400;
    line-height: 1.5;
}

.year-region {
    margin-top: 6px;
    padding-top: 0;
    border-top: none; /* removed separator line */
    opacity: 0.9;
}

.sids {
    margin-bottom: 4px;
}

.date,
.price {
    font-size: 13px;
    color: #FFD400;
    margin-bottom: 8px;
}

.price {
    font-weight: bold;
}

/* Rating Stars */
.rating {
    font-size: 20px;
    color: #FFD400;
    letter-spacing: 2px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.star-icon {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
}

/* Sort Button Styling */
.sort-button {
    background: none;
    border: none;
    color: #000000;
    font-size: 12px;
    cursor: pointer;
    padding: 0 4px;
    margin-left: 4px;
    vertical-align: middle;
    transition: transform 0.2s;
    text-shadow: none;
    filter: none;
}

.sort-button:hover {
    transform: none;
}

.sort-button.ascending::after {
    content: '';
}

.sort-button.descending {
    transform: rotate(180deg);
}

.release-header-controls {
    display: inline-block;
    gap: 2px;
    position: relative;
    overflow: visible;
    line-height: 1;
    vertical-align: top;
}

#release-header .sort-button,
#release-header .album-search-input {
    vertical-align: top;
}

.album-search-input {
    width: 34px;
    height: 14px;
    background-color: #FFD400;
    border: 1px solid #000000;
    border-radius: 2px;
    cursor: pointer;
    padding: 0 4px;
    margin-left: 4px;
    vertical-align: middle;
    opacity: 0.9;
    color: transparent;
    font-size: 10px;
    line-height: 12px;
    outline: none;
    box-sizing: border-box;
    transition: width 0.25s ease, opacity 0.2s ease, background-color 0.25s ease;
}

.album-search-input::placeholder {
    color: rgba(0, 0, 0, 0);
    opacity: 0;
}

.album-search-input.open,
.album-search-input:focus {
    width: 180px;
    opacity: 1;
    background-color: #FFD400;
    color: #000000;
    cursor: text;
}

.album-search-input.open::placeholder,
.album-search-input:focus::placeholder {
    color: #000000;
    opacity: 0.8;
}

#sort-price-btn {
    width: 12px;
    height: 12px;
    background-image: url('mula.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    padding: 0;
}

/* Scrollbar Styling removed (using page scroll) */

.ceelo-popup {
    display: none !important;
    position: fixed;
    z-index: 1100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(20, 0, 0, 0.85);
}

.ceelo-popup.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.ceelo-popup-content {
    width: 94%;
    max-width: 980px;
    min-height: 560px;
    height: 86vh;
    border: 2px solid #FFD400;
    background-color: #5a0000;
    box-shadow: 0 0 30px rgba(255, 212, 0, 0.2), inset 0 0 0 1px rgba(255, 212, 0, 0.35);
    padding: 12px;
    position: relative;
    box-sizing: border-box;
}

.ceelo-close {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 34px;
    height: 28px;
    border: 2px solid #FFD400;
    background-color: #550000;
    color: #FFD400;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
}

.ceelo-close:hover,
.ceelo-close:focus-visible {
    background-color: #FFD400;
    color: #000000;
}

.ceelo-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 10px;
    align-items: stretch;
    height: 100%;
    box-sizing: border-box;
}

.ceelo-art {
    border: none;
    background: linear-gradient(to bottom, #5a0000 0%, #2a0000 100%);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 10px 6px;
    box-sizing: border-box;
}

.ceelo-art img {
    width: 100%;
    max-width: 190px;
    height: auto;
    object-fit: contain;
    display: block;
}

.ceelo-game {
    border: 2px solid #FFD400;
    background-color: #000000;
    padding: 12px;
    color: #FFD400;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    box-sizing: border-box;
}

.ceelo-bankroll-row,
.ceelo-bet-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.ceelo-label {
    color: #FFD400;
    font-size: 12px;
    font-weight: bold;
}

.ceelo-value {
    color: #FFD400;
    background-color: #3f0000;
    border: 1px solid #FFD400;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: bold;
    min-width: 84px;
    text-align: center;
}

.ceelo-bet-input {
    width: 96px;
    height: 28px;
    border: 2px solid #FFD400;
    background-color: #0a0000;
    color: #FFD400;
    font-weight: bold;
    padding: 0 8px;
    box-sizing: border-box;
}

.ceelo-btn {
    height: 28px;
    border: 2px solid #FFD400;
    background-color: #6e0000;
    color: #FFD400;
    font-size: 12px;
    font-weight: bold;
    padding: 0 10px;
    cursor: pointer;
}

.ceelo-btn:hover,
.ceelo-btn:focus-visible {
    background-color: #FFD400;
    color: #000000;
}

.ceelo-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.ceelo-rolls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 6px;
}

.ceelo-side {
    border: 1px solid #FFD400;
    background-color: #220000;
    padding: 8px;
}

.ceelo-side-title {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: bold;
    color: #FFD400;
}

.ceelo-dice-row {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.ceelo-dice-row img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border: 1px solid #FFD400;
    background-color: #000000;
}

.ceelo-dice-row.is-rolling img {
    animation: ceeloDiceRoll 0.16s linear infinite;
}

@keyframes ceeloDiceRoll {
    0% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(4deg) scale(1.04);
    }
    100% {
        transform: rotate(-4deg) scale(1);
    }
}

.ceelo-result {
    margin: 0 0 8px;
    font-size: 11px;
    color: #ffb9b9;
    min-height: 16px;
}

.ceelo-message-log {
    margin: 12px 0 0;
    border: 1px solid #FFD400;
    background-color: #1f0000;
    box-shadow: inset 0 0 0 1px rgba(255, 212, 0, 0.15);
    flex: 1;
    min-height: 130px;
    overflow-y: auto;
    padding: 6px;
}

.ceelo-message-item {
    border: 1px solid rgba(255, 212, 0, 0.5);
    background-color: #3b0000;
    color: #FFD400;
    padding: 6px 8px;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 6px;
}

.ceelo-message-item:last-child {
    margin-bottom: 0;
}

.ceelo-message-log::-webkit-scrollbar {
    width: 10px;
}

.ceelo-message-log::-webkit-scrollbar-track {
    background-color: #240000;
}

.ceelo-message-log::-webkit-scrollbar-thumb {
    background-color: #FFD400;
    border: 1px solid #000000;
}

@media (max-width: 780px) {
    .rating-legend-scale {
        gap: 5px;
    }

    .ceelo-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .ceelo-art {
        min-height: 120px;
    }

    .ceelo-popup-content {
        height: auto;
        min-height: 0;
    }

    .ceelo-rolls {
        grid-template-columns: 1fr;
    }
}