@font-face {
    font-family: "RbtvSans";
    src: url("../fonts/RbtvSans/RBTVSans-Bold.otf") format("opentype");
    font-style: normal;
}

body {
    background: black;
    color: white;
    font-family: "RbtvSans", sans-serif;
    text-align: center;
    margin: 0;
    min-height: 100vh;
}

.timer-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 56px 48px 72px;
    box-sizing: border-box;
}

.players-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 48px;
    align-items: start;
}

.player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.player-name {
    font-size: clamp(2rem, 3vw, 3.2rem);
    line-height: 1;
    text-align: center;
    max-width: 240px;
}

.player h2 {
    margin: 0;
    font-size: clamp(2rem, 3vw, 3.2rem);
    line-height: 1;
}

.player button,
.round-actions button {
    padding: 0.35rem 0.9rem;
    margin: 0;
    border: 1px solid #666;
    background: #fff;
    color: #111;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.player button {
    width: 100%;
    max-width: 210px;
}

.round-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    margin-top: 96px;
}

.round-name {
    display: inline-block;
    max-width: 80vw;
    min-height: 1em;
    border: none;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: clamp(2rem, 3vw, 3.2rem);
    line-height: 1;
    padding: 0;
    text-align: center;
    outline: none;
    caret-color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.round-name:empty::before {
    content: attr(data-placeholder);
    color: rgba(255, 255, 255, 0.55);
}

.round-name:focus-visible {
    text-shadow: 0 0 0.03em currentColor;
}

.round-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.round-history-panel {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    margin-top: 88px;
}

.round-history-list {
    width: min(960px, 96vw);
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
    font-size: clamp(1.4rem, 2.8vw, 2.2rem);
}

.round-history-item {
    width: 100%;
    padding: 0.45rem 0.8rem;
    border: 1px solid #666;
    background: #fff;
    color: #111;
    font: inherit;
    font-size: inherit;
    text-align: left;
    cursor: pointer;
}

.is-hidden {
    display: none !important;
}

.nav-button {
    display: inline-block;
    padding: 0.35rem 0.9rem;
    border: 1px solid #666;
    background: #fff;
    color: #111;
    font-size: 1.35rem;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

.score-nav {
    align-self: flex-start;
    margin-bottom: 24px;
}

.score-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px 24px 64px;
    box-sizing: border-box;
}

.score-page h1 {
    margin: 0 0 36px;
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 900;
    line-height: 1;
}

.ranking-list {
    width: min(920px, 96vw);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ranking-item {
    display: grid;
    grid-template-columns: 0.8fr 1.6fr 1.2fr;
    align-items: baseline;
    column-gap: 32px;
    font-size: clamp(2rem, 4vw, 4rem);
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.ranking-rank {
    text-align: right;
}

.ranking-name {
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-time {
    text-align: right;
}

.player-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px 24px 64px;
    box-sizing: border-box;
}

.player-page h1 {
    margin: 0 0 42px;
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 900;
    line-height: 1;
}

.player-round-list {
    width: min(1280px, 98vw);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.player-round-row {
    display: grid;
    grid-template-columns: 0.62fr 2.4fr 0.95fr 0.62fr;
    align-items: baseline;
    column-gap: 10px;
}

.player-round-delete,
.player-round-manual {
    width: 100%;
    padding: 0.35rem 0.6rem;
    border: 1px solid #666;
    background: #fff;
    color: #111;
    font-family: inherit;
    font-size: clamp(1.35rem, 2.2vw, 1.85rem);
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.player-round-delete {
    justify-self: start;
    max-width: 190px;
}

.player-round-manual {
    justify-self: end;
    max-width: 150px;
}

.player-round-label,
.player-round-time {
    font-size: clamp(2rem, 4vw, 4rem);
    font-weight: 900;
    line-height: 1;
}

.player-round-label {
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-round-time {
    text-align: right;
}

button {
    font-family: inherit;
}

@media (max-width: 1100px) {
    .players-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media (max-width: 640px) {
    .timer-page {
        padding: 32px 18px 48px;
    }

    .players-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .round-panel {
        margin-top: 48px;
    }

    .round-history-panel {
        margin-top: 48px;
    }

    .round-name {
        width: 100%;
        box-sizing: border-box;
    }

    .score-page {
        padding: 28px 16px 40px;
    }

    .ranking-item {
        grid-template-columns: 0.6fr 1.4fr 1fr;
        column-gap: 12px;
    }

    .player-page {
        padding: 28px 16px 40px;
    }

    .player-round-list {
        width: 100%;
        gap: 14px;
    }

    .player-round-row {
        grid-template-columns: 1fr;
        row-gap: 8px;
    }

    .player-round-delete,
    .player-round-manual {
        max-width: 100%;
    }

    .player-round-time {
        text-align: left;
    }
}