
/* Umum */

.player-page,
.player-form-page {
    display: grid;
    gap: 18px;
    width: 100%;
    max-width: none;
    min-width: 0;
}

.player-page *,
.player-form-page *,
.player-page *::before,
.player-form-page *::before,
.player-page *::after,
.player-form-page *::after {
    box-sizing: border-box;
}

.player-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.player-eyebrow {
    color: #A5DFB1;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .11em;
}

.player-eyebrow--green {
    color: #318A53;
}

/* Header */

.player-hero,
.player-form-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    min-width: 0;
    padding: 28px 32px;
    border-radius: 20px;
    overflow: hidden;
    background:
        radial-gradient(
            circle at 95% 10%,
            rgba(104,180,73,.23),
            transparent 42%
        ),
        linear-gradient(115deg,#092543,#15527C);
    color: white;
}

.player-hero h1,
.player-form-hero h1 {
    margin: 9px 0 7px;
    color: white;
    font-size: clamp(27px,4vw,44px);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -.045em;
}

.player-hero h1 span,
.player-form-hero h1 span {
    color: #FFA93E;
}

.player-hero p,
.player-form-hero p {
    margin: 0;
    color: #CDDFEF;
    font-size: 12px;
    line-height: 1.5;
}

.player-hero__decoration {
    flex-shrink: 0;
    color: rgba(255,255,255,.15);
    font-size: 88px;
    font-weight: 900;
    font-style: italic;
    line-height: 1;
}

/* Pencarian */

.player-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
}

.player-search {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}

.site-main .player-search input {
    display: block;
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
    min-width: 0;
    height: 49px;
    min-height: 49px;
    padding: 11px 48px 11px 15px;
    border: 1.5px solid #CBD9E6;
    border-radius: 11px;
    background: white;
    color: #173B5A;
    font-size: 13px;
    font-weight: 600;
    outline: none;
}

.site-main .player-search input:focus {
    border-color: #1769AA;
    box-shadow: 0 0 0 4px rgba(23,105,170,.1);
}

.player-search input::-webkit-search-cancel-button {
    display: none;
}

.player-search > svg {
    position: absolute;
    top: 50%;
    right: 16px;
    width: 19px;
    height: 19px;
    color: #1769AA;
    transform: translateY(-50%);
    pointer-events: none;
}

.player-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 0 0 auto;
    height: 49px;
    min-height: 49px;
    padding: 10px 17px;
    border-radius: 11px;
    background: #F39222;
    color: #35230D;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    text-decoration: none;
}

.player-add:hover {
    background: #FFB34D;
    color: #35230D;
}

.player-add > span {
    font-size: 21px;
    font-weight: 500;
    line-height: 1;
}

/* Ranking */

.player-board {
    width: 100%;
    min-width: 0;
    padding: 19px;
    border: 1px solid #DFE8F0;
    border-radius: 18px;
    background: white;
}

.player-board__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 17px;
}

.player-board__heading h2 {
    margin: 5px 0 0;
    color: #153B5E;
    font-size: clamp(19px,3vw,25px);
    font-weight: 850;
}

.player-board__count {
    flex-shrink: 0;
    padding: 7px 11px;
    border-radius: 30px;
    background: #EDF5FB;
    color: #386A8F;
    font-size: 11px;
    font-weight: 800;
}

.player-list {
    display: grid;
    gap: 8px;
}

/* Baris pemain */

.player-row {
    display: grid;
    grid-template-columns:
        32px
        42px
        minmax(0,1fr)
        65px;
    align-items: center;
    gap: 12px;
    min-width: 0;
    min-height: 70px;
    padding: 12px 14px;
    border: 1px solid #E2EAF1;
    border-left: 3px solid #D5E1EA;
    border-radius: 12px;
    background: white;
}

.player-row--actions {
    grid-template-columns:
        32px
        42px
        minmax(0,1fr)
        65px
        76px;
}

.player-row[hidden],
.player-empty[hidden],
.player-pagination[hidden] {
    display: none !important;
}

.player-row--gold {
    border-color: #F3D6A8;
    border-left-color: #EAA12A;
    background: #FFF7E9;
}

.player-row--silver {
    border-color: #C9DFEE;
    border-left-color: #3487C4;
    background: #EFF7FE;
}

.player-row--bronze {
    border-color: #CBE7D3;
    border-left-color: #36A05C;
    background: #EFF9F1;
}

.player-row__rank {
    color: #8093A5;
    font-size: 19px;
    font-weight: 900;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.player-row--gold .player-row__rank {
    color: #C58013;
}

.player-row--silver .player-row__rank {
    color: #2875B1;
}

.player-row--bronze .player-row__rank {
    color: #2E9653;
}

/* Avatar */

.player-avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid #CFDFEC;
    border-radius: 50%;
    background: #EDF5FB;
    color: #1769AA;
}

.player-avatar--female {
    border-color: #E4D5EC;
    background: #F7EEFA;
    color: #9762AA;
}

.player-avatar svg {
    width: 25px;
    height: 25px;
}

/* Informasi pemain */

.player-row__info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    min-width: 0;
}

.player-row__name {
    display: block;
    min-width: 0;
    color: #173B5A;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.player-row--long-name .player-row__name {
    font-size: 12px;
}

.player-row__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    color: #74899B;
    font-size: 10px;
    line-height: 1.4;
}

.player-row__stats span {
    white-space: nowrap;
}

.player-row__stats b {
    color: #3D617D;
    font-weight: 850;
}

.player-row__score {
    min-width: 0;
    color: #173B5A;
    font-size: 22px;
    font-weight: 900;
    text-align: right;
    letter-spacing: -.04em;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

/* Tombol aksi */

.player-row__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    padding-left: 9px;
    border-left: 1px solid #DFE7EE;
}

.player-row__actions form {
    display: inline-flex;
    margin: 0;
}

.player-action {
    display: inline-grid;
    place-items: center;
    width: 33px;
    height: 33px;
    padding: 8px;
    border: 0;
    border-radius: 9px;
    cursor: pointer;
}

.player-action svg {
    display: block;
    width: 17px;
    height: 17px;
}

.player-action--edit {
    background: #E1F0FC;
    color: #1769AA;
}

.player-action--edit:hover {
    background: #CBE5F7;
    color: #124C7C;
}

.player-action--delete {
    background: #FCE7E7;
    color: #BF4545;
}

.player-action--delete:hover {
    background: #FAD2D2;
}

/* Pagination */

.player-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 19px;
    padding-top: 15px;
    border-top: 1px solid #E3EBF2;
}

.player-pagination button {
    min-height: 36px;
    padding: 9px 13px;
    border: 1px solid #D7E6F1;
    border-radius: 9px;
    background: #EDF5FB;
    color: #1769AA;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.player-pagination button:disabled {
    opacity: .4;
    cursor: default;
}

.player-pagination > span {
    color: #64748B;
    font-size: 11px;
    font-weight: 750;
}

.player-empty {
    padding: 32px 15px;
    border: 1px dashed #C9D9E6;
    border-radius: 11px;
    background: #F7FAFC;
    text-align: center;
}

.player-empty strong {
    color: #264864;
    font-size: 14px;
}

.player-empty p {
    margin: 8px 0 0;
    color: #8193A5;
    font-size: 12px;
}

/* Form card */

.player-form-card {
    display: block;
    width: 100%;
    max-width: none;
    min-width: 0;
    padding: clamp(18px,3vw,30px);
    border: 1px solid #DFE8F0;
    border-radius: 18px;
    background: white;
    box-shadow: 0 8px 28px rgba(12,50,81,.035);
}

.player-form-card__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid #E4ECF2;
}

.player-form-card__heading h2 {
    margin: 5px 0 0;
    color: #153B5E;
    font-size: clamp(19px,3vw,25px);
    font-weight: 850;
    overflow-wrap: anywhere;
}

.player-form-card__tag {
    flex-shrink: 0;
    padding: 7px 10px;
    border-radius: 8px;
    background: #EAF4FC;
    color: #1769AA;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .03em;
}

/* Field */

.player-form {
    display: grid;
    gap: 25px;
    width: 100%;
    min-width: 0;
}

.player-form__grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 22px 20px;
    width: 100%;
    min-width: 0;
}

.player-field {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.player-field > label,
.player-field > legend {
    width: 100%;
    margin: 0;
    padding: 0;
    color: #264864;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.5;
}

.player-required {
    color: #D75D50;
}

.player-optional {
    display: inline-block;
    margin-left: 5px;
    padding: 2px 7px;
    border-radius: 6px;
    background: #EDF3F7;
    color: #71869A;
    font-size: 10px;
    font-weight: 700;
}

.site-main .player-form .player-field > input {
    display: block;
    width: 100%;
    max-width: none;
    min-width: 0;
    height: 46px;
    min-height: 46px;
    margin: 0;
    padding: 10px 13px;
    border: 1.5px solid #CBD9E6;
    border-radius: 10px;
    background: white;
    color: #173B5A;
    font-size: 13px;
    font-weight: 600;
    outline: none;
}

.site-main .player-form .player-field > input::placeholder {
    color: #9AAAB8;
    font-weight: 400;
}

.site-main .player-form .player-field > input:focus {
    border-color: #1769AA;
    box-shadow: 0 0 0 3px rgba(23,105,170,.1);
}

.player-field > small {
    color: #8193A5;
    font-size: 11px;
    line-height: 1.5;
}

/* Jenis kelamin */

.player-gender {
    min-width: 0;
}

.player-gender__options {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 9px;
}

.player-gender__option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-width: 0;
    height: 46px;
    min-height: 46px;
    margin: 0;
    padding: 9px 11px;
    border: 1.5px solid #D7E3ED;
    border-radius: 10px;
    background: white;
    color: #48657D;
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
    white-space: nowrap;
}

.player-gender__option:has(input:checked) {
    border-color: #1769AA;
    background: #EAF4FC;
    color: #1769AA;
}

.site-main .player-gender__option input {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: #1769AA;
}

.player-gender__option span {
    min-width: 0;
}

/* Informasi akun */

.player-form__note {
    margin: 0;
    padding: 12px 14px;
    border: 1px solid #F4DEB8;
    border-radius: 10px;
    background: #FFF8EB;
    color: #96621F;
    font-size: 11px;
    line-height: 1.6;
}

/* Validasi */

.player-form__alert {
    padding: 13px 15px;
    border: 1px solid #F0C5C5;
    border-radius: 10px;
    background: #FFF0F0;
    color: #A94040;
    font-size: 12px;
    line-height: 1.6;
}

.player-form__alert strong {
    display: block;
    margin-bottom: 5px;
}

.player-form__alert ul {
    margin: 0;
    padding-left: 18px;
}

/* Tombol form */

.player-form__actions {
    display: flex;
    align-items: center;
    gap: 11px;
    flex-wrap: wrap;
    padding-top: 20px;
    border-top: 1px solid #E4ECF2;
}

.player-form__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 11px 20px;
    border: 0;
    border-radius: 10px;
    background: #1769AA;
    color: white;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.player-form__submit:hover {
    background: #125487;
}

.player-form__submit:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.player-form__cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 10px 17px;
    color: #64748B;
    font-size: 12px;
    font-weight: 750;
    text-decoration: none;
}

.player-form__cancel:hover {
    color: #1769AA;
}

/* Tablet */

@media (max-width: 750px) {
    .player-row {
        grid-template-columns:
            26px 36px minmax(0,1fr) 52px;
        gap: 8px;
        padding: 10px 9px;
    }

    .player-row--actions {
        grid-template-columns:
            26px 36px minmax(0,1fr) 52px 68px;
    }

    .player-avatar {
        width: 36px;
        height: 36px;
    }

    .player-avatar svg {
        width: 22px;
        height: 22px;
    }

    .player-row__name {
        font-size: 12px;
    }

    .player-row__score {
        font-size: 19px;
    }

    .player-row__actions {
        gap: 4px;
        padding-left: 5px;
    }

    .player-action {
        width: 29px;
        height: 29px;
        padding: 7px;
    }

    .player-form__grid {
        gap: 18px 13px;
    }
}

/* HP */

@media (max-width: 600px) {
    .player-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 11px;
    }

    .player-add {
        order: -1;
        width: 100%;
        height: 47px;
        min-height: 47px;
    }

    .player-search {
        width: 100%;
        flex: none;
    }

    .site-main .player-search input {
        width: 100%;
        height: 47px;
        min-height: 47px;
    }

    .player-form__grid {
        grid-template-columns: minmax(0,1fr);
        gap: 19px;
    }
}

@media (max-width: 480px) {
    .player-page,
    .player-form-page {
        gap: 15px;
    }

    .player-hero,
    .player-form-hero {
        padding: 23px 18px;
        border-radius: 16px;
    }

    .player-hero h1,
    .player-form-hero h1 {
        font-size: clamp(26px,7.5vw,34px);
    }

    .player-hero p,
    .player-form-hero p {
        font-size: 11px;
    }

    .player-hero__decoration {
        display: none;
    }

    .player-board {
        padding: 11px 8px;
        border-radius: 14px;
    }

    .player-board__heading {
        padding: 3px;
        gap: 8px;
    }

    .player-board__heading h2 {
        font-size: 19px;
    }

    .player-board__count {
        padding: 6px 8px;
        font-size: 10px;
    }

    .player-row {
        grid-template-columns:
            21px 29px minmax(0,1fr) 36px;
        gap: 5px;
        min-height: 55px;
        padding: 8px 6px;
        border-radius: 9px;
    }

    .player-row--actions {
        grid-template-columns:
            21px 29px minmax(0,1fr) 36px 55px;
    }

    .player-row__rank {
        font-size: 15px;
    }

    .player-avatar {
        width: 29px;
        height: 29px;
    }

    .player-avatar svg {
        width: 19px;
        height: 19px;
    }

    .player-row__info {
        gap: 3px;
    }

    .player-row__name {
        font-size: 11px;
    }

    .player-row--long-name .player-row__name {
        font-size: 9px;
    }

    .player-row__stats {
        gap: 2px 6px;
        font-size: 8px;
    }

    .player-row__score {
        font-size: 16px;
    }

    .player-row__actions {
        gap: 3px;
        padding-left: 3px;
    }

    .player-action {
        width: 25px;
        height: 27px;
        padding: 6px;
        border-radius: 6px;
    }

    .player-action svg {
        width: 14px;
        height: 14px;
    }

    .player-form-card {
        width: 100%;
        max-width: none;
        padding: 18px 14px;
        border-radius: 14px;
    }

    .player-form-card__heading {
        align-items: flex-start;
        margin-bottom: 21px;
        padding-bottom: 15px;
    }

    .player-form-card__heading h2 {
        font-size: 19px;
    }

    .player-form-card__tag {
        padding: 6px 7px;
        font-size: 9px;
    }

    .player-form {
        gap: 21px;
    }

    .player-field > label,
    .player-field > legend {
        font-size: 12px;
    }

    .site-main .player-form .player-field > input {
        height: 45px;
        min-height: 45px;
    }

    .player-gender__options {
        gap: 8px;
    }

    .player-gender__option {
        height: 43px;
        min-height: 43px;
        padding: 8px 5px;
        font-size: 11px;
    }

    .player-form__actions {
        display: grid;
        grid-template-columns: minmax(0,1fr);
        gap: 7px;
    }

    .player-form__submit,
    .player-form__cancel {
        width: 100%;
        min-height: 45px;
    }

    .player-pagination button {
        padding: 8px;
        font-size: 10px;
    }

    .player-pagination > span {
        font-size: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .player-page *,
    .player-form-page * {
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* Skor tidak terpotong */

.player-row__score {
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
    justify-self: end;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Tablet */

@media (max-width: 750px) {
    .player-row {
        grid-template-columns:
            26px
            36px
            minmax(0, 1fr)
            minmax(48px, max-content);
    }

    .player-row--actions {
        grid-template-columns:
            26px
            36px
            minmax(0, 1fr)
            minmax(48px, max-content)
            68px;
    }
}

/* HP */

@media (max-width: 480px) {
    .player-row {
        grid-template-columns:
            20px
            28px
            minmax(0, 1fr)
            minmax(44px, max-content);
        gap: 4px;
    }

    .player-row--actions {
        grid-template-columns:
            20px
            28px
            minmax(0, 1fr)
            minmax(44px, max-content)
            54px;
    }

    .player-row__score {
        font-size: clamp(12px, 3.7vw, 16px);
        white-space: nowrap;
    }

    .player-row__name {
        overflow-wrap: anywhere;
    }
}
