@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

:root {
    --page-bg: #050505;
    --panel-bg: #ffffff;
    --muted-bg: #e8e8e8;
    --teal: #35c7c8;
    --teal-dark: #1f9da0;
    --text: #111111;
    --subtle-text: #606060;
    --shadow: 0 28px 70px rgba(0, 0, 0, 0.18);
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: "Montserrat", "Trebuchet MS", "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top right, rgba(53, 199, 200, 0.18), transparent 24%),
        linear-gradient(180deg, #111111 0%, #050505 100%);
}

body {
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.screen,
.shell {
    min-height: 100vh;
}

.shell {
    width: 100%;
    background: var(--panel-bg);
}

.shell--app {
    display: flex;
    flex-direction: column;
}

.brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 148px;
    height: 106px;
    border-radius: 0 0 26px 26px;
    background: var(--teal);
    color: #ffffff;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-align: center;
    line-height: 1.05;
    font-size: 1.05rem;
}

.brand:hover,
.brand:focus,
.brand:active {
    color: #ffffff;
}

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 34px;
}

.page-head--center {
    justify-content: center;
    text-align: center;
}

.page-head--center > div {
    max-width: 860px;
}

.page-head--auth {
    align-items: flex-start;
    margin-bottom: 120px;
    padding: 0 36px;
}

.page-head__title {
    flex: 1;
    padding-top: 10px;
    text-align: center;
}

.page-head__spacer {
    width: 148px;
    flex: 0 0 148px;
}

.page-head h1,
.page-title {
    margin: 0;
    font-size: clamp(2.15rem, 2.6vw, 3rem);
    font-weight: 800;
}

.page-subtitle {
    margin: 12px 0 0;
    color: var(--subtle-text);
    font-size: 1.2rem;
    line-height: 1.45;
}

.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 44px;
    padding: 0 36px;
}

.utility-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 14px;
    padding-top: 20px;
}

.utility-nav form {
    margin: 0;
}

.utility-nav__toggle {
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    min-width: 120px;
    padding: 0 20px;
    border: 0;
    border-radius: 16px;
    background: #e8e8e8;
    color: #111111;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
}

.utility-nav__menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 14px;
}

.utility-nav__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    min-width: 164px;
    padding: 0 22px;
    border: 0;
    border-radius: 16px;
    background: #e8e8e8;
    color: #111111;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
}

.utility-nav__button--primary {
    background: var(--teal);
    color: #ffffff;
}

.app-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 0 36px 36px;
}

.auth-card {
    width: min(100%, 430px);
    margin: 0 auto;
    padding: 20px 18px 12px;
    border-radius: 18px;
    background: #d6d6d6;
}

.auth-card h2 {
    margin: 0 0 4px;
    text-align: center;
    font-size: 1.9rem;
    font-weight: 800;
}

.auth-card p {
    margin: 0 0 16px;
    text-align: center;
    color: var(--subtle-text);
    font-size: 0.82rem;
}

.field {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.field label {
    font-weight: 700;
}

.field--inline {
    grid-template-columns: 58px 1fr;
    align-items: center;
    gap: 14px;
}

.field--inline label {
    font-weight: 500;
    font-size: 0.95rem;
}

.field input,
.field select,
.field textarea {
    min-height: 42px;
    padding: 0 16px;
    border: 0;
    border-radius: 10px;
    background: #ffffff;
}

.field textarea {
    min-height: 120px;
    padding: 12px 16px;
    resize: vertical;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.actions--center {
    justify-content: center;
    margin-top: 10px;
}

.button,
.card__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    min-width: 126px;
    padding: 0 22px;
    border: 0;
    border-radius: 12px;
    background: #999999;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

.card__cta {
    min-height: 64px;
    width: 100%;
    margin-top: auto;
    background: var(--teal);
    font-size: 1.12rem;
}

.button--secondary {
    background: var(--muted-bg);
    color: var(--text);
}

.button--nav {
    min-height: 64px;
    min-width: min(100%, 280px);
    padding: 0 28px;
    border-radius: 16px;
    background: var(--teal);
}

.button--disabled {
    background: #b8b8b8;
    color: #ffffff;
    cursor: default;
    pointer-events: none;
}

.error,
.notice {
    margin: 0 0 18px;
    padding: 16px 18px;
    border-radius: var(--radius-sm);
}

.error {
    background: #fde4e3;
    color: #a92822;
}

.notice {
    background: #e5f7f7;
    color: #156a6d;
}

.auth-help {
    margin: 10px 0 0;
    font-size: 0.72rem;
    text-align: center;
    color: #666666;
}

.auth-card form {
    max-width: 360px;
    margin: 0 auto;
}

.tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.tile {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    aspect-ratio: 1 / 1;
    padding: 34px;
    border-radius: 30px;
    background: #d9d9d9;
    overflow: hidden;
    isolation: isolate;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.tile--image {
    color: #ffffff;
}

.tile__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
}

.tile__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(17, 17, 17, 0.18) 0%, rgba(17, 17, 17, 0.58) 100%);
    z-index: -1;
}

.tile:hover,
.tile:focus {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
}

.tile__title {
    margin: auto 0;
    text-align: center;
    font-size: clamp(2rem, 3vw, 2.8rem);
    font-weight: 800;
}

.tile__meta {
    color: var(--subtle-text);
    font-size: 1.08rem;
    line-height: 1.45;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
}

.search {
    display: block;
    width: 100%;
    min-height: 54px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: var(--muted-bg);
}

.chips,
.player-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border-radius: 999px;
    background: var(--muted-bg);
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
}

.chip--active {
    background: var(--teal);
    color: #ffffff;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

.card {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    border-radius: 28px;
    background: #f5f5f5;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
}

.card--link {
    display: block;
    height: 100%;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card--link:hover,
.card--link:focus {
    transform: translateY(-4px);
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.14);
}

.card__thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    padding: 18px;
    background: linear-gradient(135deg, #d7d7d7 0%, #c9c9c9 100%);
    color: #3a3a3a;
    text-align: center;
    overflow: hidden;
}

.card__thumb--placeholder {
    position: relative;
}

.card__thumb--placeholder::after {
    content: "";
    position: absolute;
    right: -36px;
    bottom: -50px;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: rgba(53, 199, 200, 0.18);
}

.card__thumb--image {
    padding: 0;
    background: #d8d8d8;
}

.card__thumb--image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #d8d8d8;
}

.card__thumb-text {
    position: relative;
    z-index: 1;
    max-width: 100%;
    padding: 0 8px;
    font-weight: 700;
    font-size: clamp(1.1rem, 1.8vw, 1.5rem);
    line-height: 1.2;
}

.panel {
    padding: 24px;
    border-radius: var(--radius-lg);
    background: #f6f6f6;
}

.panel h2 {
    margin: 0 0 16px;
    font-size: 1.55rem;
}

.panel--playlist-list {
    margin-top: 24px;
}

.list {
    display: grid;
    gap: 14px;
}

.list-item {
    display: grid;
    gap: 6px;
    padding: 16px 18px;
    border-radius: var(--radius-md);
    background: #ffffff;
}

.list-item span {
    color: var(--subtle-text);
}

.list-item--active {
    outline: 3px solid rgba(53, 199, 200, 0.55);
}

.hint {
    margin-top: 18px;
    color: var(--subtle-text);
    font-size: 0.95rem;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 26px;
}

.stat-box {
    padding: 24px;
    border-radius: 22px;
    background: #f5f5f5;
    text-align: center;
}

.stat-box strong,
.stat-box span {
    display: block;
}

.stat-box strong {
    font-size: 2rem;
}

.stat-box span {
    margin-top: 6px;
    color: var(--subtle-text);
}

.admin-tabs {
    margin-top: 34px;
}

.admin-tabs__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.admin-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 0 22px;
    border: 0;
    border-radius: 16px;
    background: #e8e8e8;
    color: #111111;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
}

.admin-tab.is-active {
    background: var(--teal);
    color: #ffffff;
}

.admin-panel {
    padding: 26px;
    border-radius: 28px;
    background: #f6f6f6;
}

.admin-section__head {
    margin-bottom: 18px;
}

.admin-section__head h2 {
    margin: 0 0 8px;
    font-size: 1.8rem;
}

.admin-section__head p {
    margin: 0;
    color: var(--subtle-text);
    line-height: 1.45;
}

.admin-form {
    position: relative;
    padding: 22px;
    border-radius: 24px;
    background: #ffffff;
}

.admin-form.is-submitting {
    pointer-events: none;
    opacity: 0.72;
}

.submit-lock-status {
    margin-top: 16px;
    padding: 16px 18px;
    border-radius: 16px;
    background: #eefafa;
    color: #156a6d;
    font-weight: 700;
    line-height: 1.45;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 18px;
    align-items: start;
}

.admin-grid--dashboard-order {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choice-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.choice-card {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 16px;
    border-radius: 14px;
    background: #ffffff;
    border: 2px solid #e6e6e6;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.choice-card input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.choice-card.is-active {
    border-color: var(--teal);
    background: #eefafa;
    transform: translateY(-1px);
}

.admin-source-panels {
    display: grid;
    gap: 16px;
    margin-bottom: 8px;
}

.admin-source-panel,
.admin-subpanel {
    padding: 18px;
    border-radius: 18px;
    background: #f5f5f5;
}

.admin-search {
    margin-bottom: 18px;
    width: 100%;
}

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    font-weight: 600;
}

.checkbox input {
    width: 20px;
    height: 20px;
}

.admin-table-wrap {
    overflow-x: auto;
    border-radius: 24px;
    background: #ffffff;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 920px;
}

.admin-table th,
.admin-table td {
    padding: 16px 18px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #ececec;
}

.admin-table th {
    background: #f7f7f7;
    font-size: 0.92rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--subtle-text);
}

.admin-table tbody tr:last-child td {
    border-bottom: 0;
}

.admin-table__sub,
.admin-table__url {
    margin-top: 4px;
    color: var(--subtle-text);
    word-break: break-word;
}

.admin-table__actions {
    min-width: 180px;
}

.admin-link-button {
    min-width: 120px;
}

.inline-delete {
    margin-top: 12px;
}

.page-head--media-player {
    margin-bottom: 20px;
}

.player-shell {
    margin-top: 10px;
}

.player-stage {
    width: min(100%, 1120px);
    margin: 0 auto;
    overflow: hidden;
    border-radius: 28px;
    background: #000000;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
    aspect-ratio: 16 / 9;
}

.player-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #000000;
    object-fit: contain;
}

.player-control-panel {
    width: min(100%, 1120px);
    margin: 26px auto 0;
}

.player-control-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.player-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 84px;
    padding: 18px 20px;
    border-radius: 18px;
    border: 0;
    font-size: clamp(1.35rem, 2vw, 1.9rem);
    font-weight: 700;
    text-align: center;
}

.player-control-back-row {
    display: flex;
    justify-content: flex-start;
    margin-top: 18px;
}

.player-progress-panel {
    margin-top: 18px;
    padding: 18px 22px;
    border-radius: 22px;
    background: #f1f1f1;
}

.player-progress-label {
    display: block;
    margin-bottom: 12px;
    font-size: 1.05rem;
    font-weight: 700;
}

.player-progress-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
}

.player-progress {
    width: 100%;
    height: 18px;
    margin: 0;
    accent-color: var(--teal);
    cursor: pointer;
}

.player-progress:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.player-time {
    min-width: 52px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--subtle-text);
    text-align: center;
}

.player-control--back {
    width: min(100%, 440px);
}

.player-info-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-top: 30px;
}

.switch-form {
    margin: 0;
}

.switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.switch input {
    display: none;
}

.switch__slider {
    position: relative;
    width: 52px;
    height: 30px;
    border-radius: 999px;
    background: #d5d5d5;
    transition: background 0.2s ease;
}

.switch__slider::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease;
}

.switch input:checked + .switch__slider {
    background: var(--teal);
}

.switch input:checked + .switch__slider::after {
    transform: translateX(22px);
}

.switch__label {
    color: var(--subtle-text);
    font-weight: 600;
}

.admin-cover-preview {
    display: block;
    width: min(240px, 100%);
    aspect-ratio: 1 / 1;
    margin-bottom: 18px;
    border-radius: 22px;
    object-fit: contain;
    background: #d8d8d8;
}

@media (max-width: 1180px) {
    .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .stats-row,
    .admin-grid,
    .admin-grid--dashboard-order,
    .admin-dashboard-grid,
    .player-info-grid {
        grid-template-columns: 1fr;
    }

    .tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .player-stage,
    .player-control-panel {
        width: 100%;
    }

    .player-stage {
        border-radius: 22px;
    }

    .player-control-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .player-progress-row {
        grid-template-columns: 1fr;
    }

    .player-time {
        min-width: 0;
        text-align: left;
    }
}

@media (max-width: 700px) {
    .page-head,
    .topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .player-control-grid {
        grid-template-columns: 1fr;
    }

    .player-control,
    .player-control--back {
        width: 100%;
        min-height: 76px;
        font-size: 1.3rem;
    }

    .page-head--center {
        align-items: center;
    }

    .page-head--auth {
        margin-bottom: 56px;
        padding: 0 18px;
    }

    .page-head__title,
    .page-head__spacer {
        padding-top: 0;
        width: auto;
        flex: none;
    }

    .brand {
        width: 118px;
        height: 88px;
        font-size: 0.9rem;
    }

    .utility-nav {
        width: 100%;
        justify-content: stretch;
        padding-top: 0;
    }

    .utility-nav__toggle {
        display: inline-flex;
        width: 100%;
    }

    .utility-nav__menu {
        display: none;
        width: 100%;
        flex-direction: column;
        justify-content: stretch;
        padding-top: 12px;
    }

    .utility-nav.is-open .utility-nav__menu {
        display: flex;
    }

    .utility-nav__button,
    .admin-tabs__nav,
    .admin-tab,
    .button,
    .button--nav {
        width: 100%;
    }

    .admin-table {
        min-width: 0;
    }

    .admin-table th {
        display: none;
    }

    .admin-table,
    .admin-table tbody,
    .admin-table tr,
    .admin-table td {
        display: block;
        width: 100%;
    }

    .admin-table tr {
        padding: 10px 0;
        border-bottom: 1px solid #ececec;
    }

    .admin-table td {
        padding: 8px 0;
        border-bottom: 0;
    }

    .field--inline {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .topbar,
    .app-content {
        padding-left: 18px;
        padding-right: 18px;
    }

    .tiles,
    .cards {
        grid-template-columns: 1fr;
    }

    .tile {
        padding: 28px;
    }
}

.tile--image .tile__meta {
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
}

.tile--image .tile__title {
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.38);
}

.admin-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.admin-dashboard-card {
    padding: 20px;
    border-radius: 20px;
    background: #f5f5f5;
}

.admin-dashboard-card h3 {
    margin: 0 0 8px;
    font-size: 1.2rem;
}
