.tk-race {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

.tk-race__head h1,
.tk-race-detail h1 {
    margin: 0.35rem 0 0.4rem;
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    line-height: 1.15;
}

.tk-race__head p,
.tk-race__dates,
.tk-race-card__text {
    margin: 0;
    color: var(--muted);
}

.tk-race__list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    margin: 1.25rem 0 0;
    padding: 0;
    list-style: none;
}

.tk-race-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    color: inherit;
    text-decoration: none;
}

.tk-race-card__image {
    width: 100%;
    height: 11rem;
    object-fit: cover;
    background: #f1f5f9;
}

.tk-race-card__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    padding: 1rem 1.1rem 1.15rem;
}

.tk-race-card:hover,
.tk-race-card:focus {
    border-color: #b9d4f5;
    text-decoration: none;
    color: inherit;
}

.tk-race-card h2 {
    margin: 0.2rem 0 0.35rem;
    font-size: 1.2rem;
}

.tk-race-hero__image {
    display: block;
    width: 100%;
    max-height: 24rem;
    object-fit: cover;
    border-radius: 16px;
    background: #f1f5f9;
}

.tk-race-hero__body {
    margin-top: 1rem;
}

.tk-race-count {
    margin-top: 0.35rem;
}

.tk-race-count__label {
    margin: 0 0 0.4rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.tk-race-count__units {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tk-race-count__unit {
    min-width: 4.1rem;
    padding: 0.4rem 0.3rem 0.35rem;
    border-radius: 10px;
    background: #0f172a;
    color: #fff;
    text-align: center;
}

.tk-race-count__unit b {
    display: block;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.1;
}

.tk-race-count__unit small {
    display: block;
    margin-top: 0.1rem;
    font-size: 0.68rem;
    opacity: 0.78;
}

.tk-race-count--done {
    display: inline-block;
    margin: 0.35rem 0 0;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 700;
}

.tk-race-card__text {
    margin-top: 0.45rem;
}

.tk-race__badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.tk-race__badge--live {
    background: #dcfce7;
    color: #166534;
}

.tk-race__badge--done {
    background: #f1f5f9;
    color: #475569;
}

.tk-race__badge--soon {
    background: #fef3c7;
    color: #92400e;
}

.tk-race__empty {
    margin-top: 1.25rem;
    color: var(--muted);
}

.tk-race__crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.tk-race__crumbs a {
    color: var(--blue);
    text-decoration: none;
}

.tk-race-tabs {
    margin-top: 1.75rem;
}

.tk-race-tabs__bar {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid var(--border);
}

.tk-race-tabs__tab {
    margin: 0;
    padding: 0.75rem 1rem;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.tk-race-tabs__tab.is-active {
    color: var(--text);
    border-bottom-color: var(--blue);
}

.tk-race-tabs__tab:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

.tk-race-tabs__panel {
    padding-top: 1.35rem;
}

.tk-race-tabs__panel[hidden] {
    display: none !important;
}

.tk-race-about h2,
.tk-race-detail__text {
    max-width: 46rem;
}

.tk-race-about h2 {
    margin: 0 0 0.7rem;
    font-size: 1.35rem;
}

.tk-race-detail__text {
    margin: 0;
    line-height: 1.6;
}

.tk-race-detail__text p {
    margin: 0 0 0.8rem;
}

.tk-race-detail__text p:last-child {
    margin-bottom: 0;
}

.tk-race-detail__text ul,
.tk-race-detail__text ol {
    margin: 0 0 0.8rem;
    padding-left: 1.25rem;
}

.tk-race-detail__text a {
    color: var(--blue);
}

.tk-race-board,
.tk-race-prizes {
    margin-top: 1.5rem;
}

.tk-race-tabs__panel > .tk-race-prizes:first-child,
.tk-race-tabs__panel > .tk-race-board:first-child,
.tk-race-tabs__panel > .tk-race-about:first-child {
    margin-top: 0;
}

.tk-race-board__note {
    margin: 0 0 0.85rem;
    color: var(--muted);
}

.tk-race-board__list {
    margin: 0;
    padding: 0;
    list-style: none;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.tk-race-board__row,
.tk-race-board__gap {
    border-top: 1px solid var(--border);
}

.tk-race-board__list > :first-child {
    border-top: 0;
}

.tk-race-board__row {
    display: grid;
    grid-template-columns: 2.5rem minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.8rem 1rem;
}

.tk-race-board__row--mine {
    background: #eff6ff;
}

.tk-race-board__gap {
    margin: 0;
    padding: 0.45rem 1rem;
    text-align: center;
    letter-spacing: 0.25em;
    color: var(--muted);
}

.tk-race-board__count {
    margin: 0.85rem 0 0;
    font-weight: 700;
}

.tk-race-board__rank {
    font-weight: 800;
    color: var(--blue);
}

.tk-race-board__who {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tk-race-board__name {
    font-weight: 700;
}

.tk-race-board__place,
.tk-race-board__points {
    color: var(--muted);
    font-size: 0.92rem;
}

.tk-race-board__points {
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

.tk-race-board__secret {
    position: relative;
    justify-self: end;
}

.tk-race-board__secret-btn {
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--text);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.tk-race-board__secret-btn:hover,
.tk-race-board__secret-btn:focus-visible,
.tk-race-board__secret-btn.is-open {
    background: #e2e8f0;
}

.tk-race-board__secret-tip {
    display: none;
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.4rem);
    z-index: 2;
    width: max-content;
    max-width: 16rem;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    background: #1a1a2e;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.35;
    white-space: normal;
}

.tk-race-board__secret:hover .tk-race-board__secret-tip,
.tk-race-board__secret:focus-within .tk-race-board__secret-tip,
.tk-race-board__secret-btn.is-open + .tk-race-board__secret-tip {
    display: block;
}

.tk-race-board h2,
.tk-race-prizes h2 {
    margin: 0 0 0.9rem;
    font-size: 1.35rem;
}

.tk-race-prizes__stage {
    display: grid;
    gap: 0.85rem;
}

.tk-race-prizes__rest {
    display: grid;
    gap: 0.35rem;
    margin: 1.35rem 0 0;
    padding: 0;
    list-style: none;
}

.tk-race-prize {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    margin: 0;
    padding: 1.15rem 1rem 1.3rem;
    border-radius: 20px;
    background: #fff;
    text-align: center;
}

.tk-race-prize--1 {
    padding-top: 1.5rem;
    padding-bottom: 1.6rem;
}

.tk-race-prize__rank {
    margin: 0;
    font-size: 2.15rem;
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: -0.04em;
}

.tk-race-prize--1 .tk-race-prize__rank {
    font-size: 3.1rem;
    color: #b45309;
}

.tk-race-prize--2 .tk-race-prize__rank {
    color: #475569;
}

.tk-race-prize--3 .tk-race-prize__rank {
    color: #c2410c;
}

.tk-race-prize__image {
    width: auto;
    max-width: 9.5rem;
    height: 7.5rem;
    object-fit: contain;
}

.tk-race-prize--1 .tk-race-prize__image {
    max-width: 12rem;
    height: 9rem;
}

.tk-race-prize__name {
    margin: 0;
    max-width: 16rem;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
}

.tk-race-prize--1 .tk-race-prize__name {
    font-size: 1.2rem;
}

.tk-race-prize--rest {
    flex-direction: row;
    align-items: center;
    gap: 0.85rem;
    padding: 0.55rem 0.15rem;
    border-radius: 0;
    background: #fff;
    text-align: left;
}

.tk-race-prize--rest .tk-race-prize__rank {
    flex: 0 0 2.4rem;
    font-size: 1.35rem;
    color: var(--text);
}

.tk-race-prize--rest .tk-race-prize__image {
    width: 3.25rem;
    height: 3.25rem;
    max-width: none;
    object-fit: cover;
    border-radius: 10px;
}

.tk-race-prize--rest .tk-race-prize__name {
    max-width: none;
    font-size: 1rem;
}

.tk-race-comments {
    margin-top: 2.5rem;
}

.tk-race-comments h2 {
    margin: 0 0 1rem;
    font-size: 1.35rem;
}

.tk-race-comments__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.tk-race-comment {
    display: grid;
    grid-template-columns: 7.5rem minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
}

.tk-race-comment__user {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    text-align: center;
}

.tk-race-comment__body {
    min-width: 0;
}

.tk-race-comment__avatar {
    width: 4.5rem;
    height: 4.5rem;
    object-fit: cover;
    border-radius: 12px;
    background: #fff;
}

.tk-race-comment__avatar--empty {
    display: block;
    background: #f4f6f8;
}

.tk-race-comment__name,
.tk-race-comment__meta,
.tk-race-comment__text,
.tk-race-comment__time {
    margin: 0;
}

.tk-race-comment__name {
    font-weight: 800;
    font-size: 0.92rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.tk-race-comment__meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.tk-race-comment__text {
    white-space: pre-wrap;
}

.tk-race-comment__time {
    margin-bottom: 0.55rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.tk-race-comment__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.tk-race-comment__like,
.tk-race-comment__report {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
    margin: 0;
    padding: 0.35rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

.tk-race-comment__icon {
    width: 1.35rem;
    height: 1.35rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.tk-race-comment__icon--on {
    display: none;
    fill: currentColor;
    stroke: none;
}

.tk-race-comment__like.is-on .tk-race-comment__icon--off,
.tk-race-comment__report.is-on .tk-race-comment__icon--off {
    display: none;
}

.tk-race-comment__like.is-on .tk-race-comment__icon--on,
.tk-race-comment__report.is-on .tk-race-comment__icon--on {
    display: block;
}

.tk-race-comment__like:focus-visible,
.tk-race-comment__report:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

.tk-race-comment__like.is-on {
    color: #e11d48;
}

.tk-race-comment__like-count {
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}

.tk-race-comment__report.is-on,
.tk-race-comment__report:disabled {
    color: #b45309;
    cursor: default;
}

.tk-race-comment__like[aria-busy="true"],
.tk-race-comment__report[aria-busy="true"] {
    opacity: 0.6;
}

.tk-race-comment-form .tk-race-comment__avatar {
    width: 3rem;
    height: 3rem;
    flex: 0 0 3rem;
    border-radius: 50%;
}

@media (max-width: 520px) {
    .tk-race-comment {
        grid-template-columns: 5.5rem minmax(0, 1fr);
        gap: 0.65rem;
    }

    .tk-race-comment__avatar {
        width: 3.5rem;
        height: 3.5rem;
    }

    .tk-race-comment-form .tk-race-comment__avatar {
        width: 3rem;
        height: 3rem;
    }
}

.tk-race-comments__error {
    margin: 1rem 0 0;
    color: #b91c1c;
    font-weight: 700;
}

.tk-race-comments__wait,
.tk-race-comment-form__note {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.tk-race-comments__wait {
    margin-top: 1rem;
    color: #166534;
    font-weight: 700;
}

.tk-race-comment-form {
    margin-top: 1.25rem;
}

.tk-race-comment-form__compose {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.tk-race-comment-form__fields {
    display: grid;
    flex: 1;
    gap: 0.55rem;
    min-width: 0;
}

.tk-race-comment-form label {
    font-weight: 700;
}

.tk-race-comment-form textarea {
    width: 100%;
    min-height: 7rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    font: inherit;
    resize: vertical;
}

.tk-race-comment-form button {
    justify-self: start;
    margin: 0;
    padding: 0.7rem 1.15rem;
    border: 0;
    border-radius: 999px;
    background: var(--blue);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.tk-race-comment-form button:hover,
.tk-race-comment-form button:focus-visible {
    background: var(--blue-dark, #004a99);
}

.tk-race-comments__login a {
    color: var(--blue);
    font-weight: 700;
}

.tk-race__back {
    color: var(--blue);
    font-weight: 600;
}

@media (min-width: 760px) {
    .tk-race-prizes__stage {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: end;
        gap: 1rem;
    }

    .tk-race-prizes__stage:has(.tk-race-prize--2):not(:has(.tk-race-prize--3)) {
        grid-template-columns: repeat(2, minmax(0, 18rem));
        justify-content: center;
    }

    .tk-race-prizes__stage:not(:has(.tk-race-prize--2)) {
        grid-template-columns: minmax(0, 22rem);
        justify-content: center;
    }

    .tk-race-prize--1 {
        order: 2;
    }

    .tk-race-prize--2 {
        order: 1;
    }

    .tk-race-prize--3 {
        order: 3;
    }

    .tk-race-prizes__stage:not(:has(.tk-race-prize--3)) .tk-race-prize--1,
    .tk-race-prizes__stage:not(:has(.tk-race-prize--3)) .tk-race-prize--2 {
        order: 0;
    }
}

@media (min-width: 980px) {
    .tk-race__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
