/*
 * Competition mode: the trophy in the header, the name gate, and the leaderboard
 * drawer. Kept out of space3d.css so neither file runs long.
 */
.pp-trophy {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    /* The icon font can fail to load, and a zero-width link cannot be clicked. */
    min-width: 20px;
    min-height: 20px;
    margin-left: 22px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 17px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.pp-trophy:hover {
    color: #e0b64a;
}

/*
 * Signing in sits in the header beside the trophy, because who you are is not a
 * setting. Signed out it reads as the way in; signed in it is your name.
 */
.pp-signin {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 20px;
    margin-left: 18px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 15px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.pp-signin:hover {
    color: #ffffff;
}

.pp-comp-badge {
    display: inline-block;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.08);
    padding: 3px 9px;
    border-radius: 999px;
}

.pp-comp-badge.pp-on {
    color: #ffffff;
    background: #4d82c4;
}

/* --- name gate --- */

.pp-gate {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(10, 14, 22, 0.78);
    backdrop-filter: blur(6px);
}

.pp-gate.show {
    display: flex;
}

.pp-gate-card {
    position: relative;
    width: min(420px, 92vw);
    padding: 30px 30px 26px;
    border-radius: 16px;
    background: #202a3c;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.5);
}

.pp-gate-title {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 10px;
}

.pp-gate-copy {
    font-size: 13px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.62);
    margin: 0 0 18px;
}

.pp-gate-label {
    display: block;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 7px;
}

.pp-gate-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(12, 17, 26, 0.8);
    color: #ffffff;
    font-size: 15px;
    font-family: inherit;
    margin-bottom: 10px;
}

.pp-gate-input:focus {
    outline: none;
    border-color: #4d82c4;
}

.pp-gate-error {
    min-height: 18px;
    font-size: 12px;
    color: #e0846f;
    margin-bottom: 10px;
}

.pp-gate-go,
.pp-gate-alt {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease;
}

.pp-gate-go {
    background: #4d82c4;
    color: #ffffff;
}

.pp-gate-go:hover {
    background: #5b8fce;
}

.pp-gate-alt {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.82);
    margin-top: 8px;
}

.pp-gate-alt:hover {
    background: rgba(255, 255, 255, 0.14);
}

.pp-gate-sep {
    margin: 20px 0 10px;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.34);
    text-align: center;
}

.pp-gate-key {
    padding: 14px;
    border-radius: 10px;
    background: rgba(12, 17, 26, 0.9);
    color: #8fc0ff;
    font-family: "Courier New", monospace;
    font-size: 13px;
    word-break: break-all;
    margin-bottom: 14px;
}

.pp-gate-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
}

.pp-gate-close:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

/* --- leaderboard drawer --- */

.pp-board {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(390px, 94vw);
    z-index: 300;
    display: flex;
    flex-direction: column;
    background: #1b2432;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    transform: translateX(100%);
    transition: transform 0.28s ease;
}

.pp-board.show {
    transform: translateX(0);
}

.pp-board-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 22px 16px;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.pp-board-head i {
    color: #e0b64a;
    margin-right: 8px;
}

.pp-board-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
}

.pp-board-close:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.pp-board-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px 26px;
}

.pp-board-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.pp-board-tab {
    padding: 7px 11px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.pp-board-tab:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.pp-board-tab.pp-on {
    background: #4d82c4;
    color: #ffffff;
}

.pp-board-mine {
    padding: 10px 12px;
    border-radius: 9px;
    background: rgba(77, 130, 196, 0.16);
    color: rgba(255, 255, 255, 0.82);
    font-size: 12px;
    margin-bottom: 14px;
}

.pp-board-rows {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pp-board-row {
    display: grid;
    grid-template-columns: 34px 1fr auto 52px;
    align-items: center;
    gap: 8px;
    padding: 10px 11px;
    border-radius: 9px;
    background: #202a3c;
    margin-bottom: 7px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.86);
}

.pp-board-row.pp-mine {
    background: #2c2447;
}

.pp-board-rank {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.44);
}

.pp-board-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pp-board-score {
    font-weight: 700;
    color: #ffffff;
}

.pp-board-level {
    text-align: right;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
}

.pp-board-empty {
    padding: 24px 4px;
    font-size: 13px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.5);
}

.pp-board-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
}

.pp-board-page {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
}

.pp-board-page:disabled {
    opacity: 0.3;
    cursor: default;
}

.pp-board-count {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
}

@media (max-width: 768px) {
    .pp-trophy {
        margin-left: 14px;
        font-size: 16px;
    }

    .pp-signin {
        margin-left: 12px;
    }

    .pp-comp-badge {
        display: none;
    }
}

/* --- saved games drawer --- */

.pp-saves .pp-board-head i {
    color: #7fb0e6;
}

.pp-slot {
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 13px 14px 12px;
    margin-bottom: 10px;
}

.pp-slot-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.pp-slot-mode {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
}

.pp-slot-field {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    border-radius: 5px;
    padding: 3px 7px;
}

.pp-slot-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.82);
}

.pp-slot-fact i {
    margin-right: 5px;
    opacity: 0.6;
}

.pp-slot-when {
    margin-top: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
}

.pp-slot-acts {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 11px;
}

.pp-slot-go {
    flex: 1;
    border: none;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    background: #4a7cb8;
    cursor: pointer;
}

.pp-slot-go:hover {
    background: #5b91d2;
}

.pp-slot-go i {
    margin-right: 6px;
}

.pp-slot-drop {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
}

.pp-slot-drop:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.pp-slot-none {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.5);
}

.pp-slot-none i {
    font-size: 30px;
    opacity: 0.35;
}

.pp-slot-none p {
    margin: 14px 0 0;
    font-size: 13px;
    line-height: 1.6;
}

/* --- the field switch and the stack of boards --- */

.pp-board-fields {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}

.pp-board-field {
    flex: 1;
    padding: 7px 10px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
}

.pp-board-field:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.pp-board-field.pp-on {
    background: #4a7cb8;
    color: #ffffff;
}

.pp-board-stack {
    margin-bottom: 20px;
}

.pp-board-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    margin-bottom: 8px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.pp-board-title:hover {
    background: rgba(255, 255, 255, 0.13);
}

.pp-board-total {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
}

/* The profile card's score rows. */
.pp-profile-rows {
    margin: 12px 0 16px;
    max-height: 200px;
    overflow-y: auto;
}

.pp-profile-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 2px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pp-profile-row b {
    color: #ffffff;
}
