body[data-page="kart-race"] {
  background: #050505;
}

body[data-page="kart-race"] .internal-main.games-main {
  inline-size: min(80%, 1780px);
  min-height: calc(100svh - 76px);
  margin: 0 auto;
  padding: 22px 0 34px;
  direction: rtl;
}

body[data-page="kart-race"] .race-game {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border: 1px solid rgba(255, 205, 0, .28);
  border-radius: 12px;
  background:
    radial-gradient(circle at 7px 7px, rgba(220, 7, 24, .58) 0 2px, transparent 2.8px) 0 0 / 20px 20px,
    #060606;
}

body[data-page="kart-race"] .race-game::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(112deg, rgba(221, 6, 23, .1), transparent 28%, transparent 75%, rgba(255, 205, 0, .07));
}

body[data-page="kart-race"] .race-game > * {
  position: relative;
  z-index: 1;
}

.race-game-heading {
  max-width: 760px;
  margin: 0 auto 20px;
  text-align: center;
}

.race-game-kicker {
  margin: 0 0 6px;
  color: #ffd217;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .12em;
}

.race-game-heading h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(2rem, 3.4vw, 3.5rem);
  font-weight: 900;
  line-height: 1;
}

.race-game-heading > p:last-child {
  max-width: 640px;
  margin: 9px auto 0;
  color: rgba(255, 255, 255, .78);
  font-size: clamp(.95rem, 1.25vw, 1.12rem);
  font-weight: 600;
  line-height: 1.45;
}

.race-game-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) minmax(230px, 300px);
  gap: 14px;
  align-items: stretch;
  direction: ltr;
}

.race-panel,
.race-stage {
  direction: rtl;
}

.race-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 12px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 10px;
  background: rgba(12, 12, 13, .92);
  color: #fff;
}

body[data-page="kart-race"] .race-guide-panel {
  border-color: rgba(255, 204, 0, .78);
  background:
    linear-gradient(145deg, rgba(255, 204, 0, .12), transparent 42%),
    #fff;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .34);
  color: #111;
}

body[data-page="kart-race"] .race-guide-panel .race-panel-title > span {
  border-color: #111;
  background: var(--color-accent);
  color: #111;
}

body[data-page="kart-race"] .race-guide-panel .race-panel-title strong {
  color: #111;
}

body[data-page="kart-race"] .race-guide-panel .race-panel-title small {
  color: rgba(17, 17, 17, .64);
}

.race-panel-title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.race-panel-title > span {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #ffd217;
  border-radius: 50%;
  color: #ffd217;
  font-size: .76rem;
  font-weight: 900;
}

.race-panel-title strong,
.race-panel-title small {
  display: block;
}

.race-panel-title strong {
  color: #fff;
  font-size: 1.03rem;
  font-weight: 900;
}

.race-panel-title small {
  margin-top: 1px;
  color: rgba(255, 255, 255, .62);
  font-size: .78rem;
  font-weight: 600;
}

.race-objective {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(255, 210, 23, .36);
  border-radius: 8px;
  background: rgba(255, 210, 23, .07);
}

body[data-page="kart-race"] .race-guide-panel .race-objective {
  border-color: rgba(201, 151, 0, .46);
  background: #fff7ce;
}

.race-objective b {
  color: #ffd217;
  font-size: .98rem;
  font-weight: 900;
}

.race-objective span,
.race-control-note {
  color: rgba(255, 255, 255, .8);
  font-size: .84rem;
  font-weight: 600;
  line-height: 1.42;
}

body[data-page="kart-race"] .race-guide-panel .race-objective span,
body[data-page="kart-race"] .race-guide-panel .race-control-note {
  color: rgba(17, 17, 17, .76);
}

.race-rules {
  display: grid;
  gap: 8px;
}

.race-rule {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 8px;
  background: rgba(255, 255, 255, .045);
}

body[data-page="kart-race"] .race-guide-panel .race-rule {
  border-color: rgba(17, 17, 17, .12);
  background: #f5f5f3;
}

.race-rule img {
  width: 33px;
  height: 33px;
  flex: 0 0 auto;
  object-fit: contain;
}

.race-rule span {
  color: rgba(255, 255, 255, .78);
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.25;
}

body[data-page="kart-race"] .race-guide-panel .race-rule span,
body[data-page="kart-race"] .race-guide-panel .race-rule b {
  color: #1a1a1a;
}

body[data-page="kart-race"] .race-guide-panel .race-rule-good b {
  color: #9a7200;
}

body[data-page="kart-race"] .race-guide-panel .race-rule-bad b {
  color: var(--color-primary);
}

body[data-page="kart-race"] .race-guide-panel .race-rule-oil b {
  color: #0878b9;
}

.race-rule b {
  color: #fff;
  font-weight: 900;
}

.race-rule-good b { color: #ffd217; }
.race-rule-bad b { color: #ff5260; }
.race-rule-oil b { color: #6bc7ff; }

.race-player-name {
  display: grid;
  gap: 6px;
  color: rgba(255, 255, 255, .86);
  font-size: .82rem;
  font-weight: 800;
}

body[data-page="kart-race"] .race-guide-panel .race-player-name {
  color: #1a1a1a;
}

.race-player-name input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  outline: 0;
  background: #fff;
  color: #151515;
  font: inherit;
  font-size: .9rem;
  font-weight: 800;
  text-align: right;
}

.race-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.race-button {
  min-height: 43px;
  padding: 9px 17px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: .91rem;
  font-weight: 900;
  line-height: 1;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.race-button:hover {
  transform: translateY(-2px);
}

.race-button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.race-button-primary {
  border-color: #ffcb12;
  background: linear-gradient(90deg, #ed071c, #ff8f14);
  box-shadow: 0 8px 24px rgba(237, 7, 28, .27);
  color: #fff;
}

.race-button-secondary {
  border-color: rgba(255, 210, 23, .72);
  background: rgba(0, 0, 0, .7);
  color: #ffd217;
}

.race-control-note {
  margin: auto 0 0;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, .11);
}

body[data-page="kart-race"] .race-guide-panel .race-control-note {
  border-top-color: rgba(17, 17, 17, .13);
}

.race-stage {
  position: relative;
  min-height: clamp(510px, calc(100svh - 250px), 720px);
  overflow: hidden;
  border: 2px solid rgba(255, 210, 23, .72);
  border-radius: 12px;
  background: #050505;
  isolation: isolate;
}

.race-stage::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  content: "";
  box-shadow: inset 0 0 70px rgba(0, 0, 0, .64);
}

#raceCanvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
}

.race-hud {
  position: absolute;
  z-index: 4;
  inset-block-start: 12px;
  inset-inline: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  pointer-events: none;
}

.race-hud > div {
  min-width: 0;
  padding: 8px 7px;
  border: 1px solid rgba(255, 210, 23, .55);
  border-radius: 8px;
  background: rgba(5, 5, 5, .78);
  text-align: center;
}

.race-hud span,
.race-hud strong {
  display: block;
}

.race-hud span {
  color: rgba(255, 255, 255, .68);
  font-size: clamp(.65rem, .9vw, .75rem);
  font-weight: 700;
}

.race-hud strong {
  overflow: hidden;
  margin-top: 2px;
  color: #fff;
  font-size: clamp(.86rem, 1.25vw, 1.06rem);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.race-stage-label {
  position: absolute;
  z-index: 4;
  inset-block-end: 10px;
  inset-inline-start: 50%;
  max-width: calc(100% - 30px);
  transform: translateX(50%);
  color: rgba(255, 255, 255, .68);
  font-size: .78rem;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

html[dir="ltr"] .race-stage-label {
  transform: translateX(-50%);
}

.game-overlay {
  position: absolute;
  z-index: 7;
  inset: 0;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, .63);
  backdrop-filter: blur(3px);
}

.game-overlay.is-visible {
  display: grid;
}

.game-overlay-card {
  width: min(470px, 100%);
  padding: clamp(20px, 4vw, 35px);
  border: 1px solid rgba(255, 210, 23, .9);
  border-radius: 12px;
  background:
    radial-gradient(circle at 15% 12%, rgba(235, 7, 28, .32), transparent 44%),
    #101012;
  box-shadow: 0 22px 65px rgba(0, 0, 0, .6);
  color: #fff;
  text-align: center;
}

.overlay-number {
  display: inline-grid;
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
  place-items: center;
  border-radius: 50%;
  background: #ffd217;
  color: #111;
  font-size: .9rem;
  font-weight: 900;
}

.game-overlay-card h2 {
  margin: 0;
  font-size: clamp(1.85rem, 3.7vw, 3rem);
  font-weight: 900;
  line-height: 1.03;
}

.game-overlay-card p {
  margin: 11px auto 16px;
  color: rgba(255, 255, 255, .84);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
}

.overlay-control-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0 0 18px;
  color: #ffd217;
  font-size: .8rem;
  font-weight: 800;
}

.overlay-control-visual i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffd217;
  animation: race-dot-pulse 1.3s ease-in-out infinite;
}

.overlay-control-visual i:nth-of-type(2) { animation-delay: .18s; }
.overlay-control-visual i:nth-of-type(3) { animation-delay: .36s; }

.game-overlay-card .race-button {
  min-width: min(100%, 230px);
}

.race-score-panel {
  justify-content: flex-start;
}

.race-score-card {
  padding: 17px;
  border: 1px solid rgba(255, 210, 23, .65);
  border-radius: 9px;
  background:
    linear-gradient(135deg, rgba(235, 7, 28, .16), transparent 54%),
    rgba(255, 210, 23, .07);
  text-align: center;
}

.race-score-card span,
.race-score-card strong,
.race-score-card small {
  display: block;
}

.race-score-card span {
  color: #ffd217;
  font-size: .78rem;
  font-weight: 900;
}

.race-score-card strong {
  margin: 4px 0;
  color: #fff;
  font-size: clamp(2rem, 3vw, 2.85rem);
  font-weight: 900;
  line-height: 1;
}

.race-score-card small {
  color: rgba(255, 255, 255, .72);
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.35;
}

.precision-timer {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 210, 23, .58);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(235, 7, 28, .15), transparent 55%),
    rgba(255, 255, 255, .04);
  text-align: center;
}

.precision-timer-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: right;
}

.precision-timer-heading > span {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #ffd217;
  border-radius: 50%;
  background: #ffd217;
  color: #171717;
  font-size: .78rem;
  font-weight: 900;
}

.precision-timer-heading strong,
.precision-timer-heading small {
  display: block;
}

.precision-timer-heading strong {
  color: #fff;
  font-size: .98rem;
  font-weight: 900;
}

.precision-timer-heading small {
  margin-top: 1px;
  color: rgba(255, 255, 255, .7);
  font-size: .72rem;
  font-weight: 700;
}

.precision-timer-display {
  display: block;
  color: #ffd217;
  direction: ltr;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: clamp(2.05rem, 3.3vw, 2.8rem);
  font-weight: 900;
  letter-spacing: .04em;
  line-height: 1;
}

.precision-timer-result {
  min-height: 2.4em;
  margin: 0;
  color: rgba(255, 255, 255, .76);
  font-size: .76rem;
  font-weight: 700;
  line-height: 1.35;
}

.precision-timer-result.is-close { color: #ffd217; }
.precision-timer-result.is-excellent { color: #64e694; }

.race-button-timer {
  border-color: #ffd217;
  background: #ffd217;
  box-shadow: 0 8px 20px rgba(255, 210, 23, .18);
  color: #151515;
}

.leaderboard-panel {
  display: grid;
  gap: 12px;
  min-height: 0;
  padding: 14px;
  border: 1px solid rgba(255, 210, 23, .82);
  border-radius: 10px;
  background: #f7f4ec;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .28);
}

.leaderboard-panel > .race-panel-title > span {
  border-color: #111;
  background: #ffd217;
  color: #111;
}

.leaderboard-panel > .race-panel-title strong,
.leaderboard-panel > .race-panel-title small,
.precision-board-heading strong,
.precision-board-heading small {
  font-size: 0;
}

.leaderboard-panel > .race-panel-title strong::after,
.precision-board-heading strong::after {
  content: "\05E9\05D9\05D0\00A0\05D0\05D9\05E9\05D9";
  color: #111;
  font-size: 1.06rem;
  font-weight: 900;
}

.leaderboard-panel > .race-panel-title small::after {
  content: "\05D4\05EA\05D5\05E6\05D0\05D5\05EA\00A0\05D4\05D8\05D5\05D1\05D5\05EA\00A0\05E9\05DC\05DB\05DD";
}

.precision-board-heading small::after {
  content: "\05D4\05E0\05D9\05E1\05D9\05D5\05E0\05D5\05EA\00A0\05D4\05DE\05D3\05D5\05D9\05E7\05D9\05DD\00A0\05E9\05DC\05DB\05DD";
}

.leaderboard-panel > .race-panel-title small::after,
.precision-board-heading small::after {
  color: rgba(17, 17, 17, .64);
  font-size: .75rem;
  font-weight: 700;
}

.leaderboard {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.leaderboard li {
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr) auto;
  min-height: 46px;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border: 1px solid rgba(17, 17, 17, .12);
  border-radius: 8px;
  background: #fff;
}

.leaderboard-rank {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 50%;
  background: #ffd217;
  color: #151515;
  font-size: .72rem;
  font-weight: 900;
}

.leaderboard-name {
  overflow: hidden;
  color: #171717;
  font-size: .83rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard li strong {
  color: #ffd217;
  font-size: .78rem;
  font-weight: 900;
  direction: ltr;
}

.leaderboard .leaderboard-empty {
  display: block;
  min-height: auto;
  padding: 13px;
  color: rgba(17, 17, 17, .65);
  font-size: .86rem;
  font-weight: 700;
  text-align: center;
}

@keyframes race-dot-pulse {
  0%, 100% { opacity: .32; transform: scale(.8); }
  50% { opacity: 1; transform: scale(1.25); }
}

@media (max-width: 1220px) {
  body[data-page="kart-race"] .race-game-layout {
    grid-template-columns: minmax(230px, .7fr) minmax(0, 1.5fr);
  }

  body[data-page="kart-race"] .race-score-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(220px, .45fr) minmax(0, 1fr);
    align-items: start;
  }

  body[data-page="kart-race"] .leaderboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1199px) {
  body[data-page="kart-race"] .internal-main.games-main {
    inline-size: min(100% - 20px, 720px);
    position: relative;
    inset-block-start: 64px;
    margin-block-end: 64px;
    padding: 18px 0 24px;
  }

  body[data-page="kart-race"] .race-game {
    padding: 10px;
    border-radius: 10px;
  }

  .race-game-heading {
    margin: 4px auto 12px;
  }

  .race-game-kicker {
    margin-bottom: 3px;
    font-size: .66rem;
  }

  .race-game-heading h1 {
    font-size: clamp(1.55rem, 7.3vw, 2.1rem);
  }

  .race-game-heading > p:last-child {
    max-width: 500px;
    margin-top: 5px;
    font-size: .82rem;
  }

  body[data-page="kart-race"] .race-game-layout {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  body[data-page="kart-race"] .race-stage {
    order: 1;
    min-height: clamp(430px, calc(100svh - 185px), 590px);
  }

  body[data-page="kart-race"] .race-guide-panel {
    order: 2;
  }

  body[data-page="kart-race"] .race-score-panel {
    order: 3;
    display: flex;
  }

  .race-panel {
    gap: 10px;
    padding: 12px;
  }

  .race-rules {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .race-rule {
    min-height: 78px;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 7px 5px;
    text-align: center;
  }

  .race-rule img {
    width: 27px;
    height: 27px;
  }

  .race-rule span {
    font-size: .68rem;
  }

  .race-objective,
  .race-player-name,
  .race-control-note {
    display: none;
  }

  .race-actions {
    grid-template-columns: 1fr auto;
  }

  .race-score-card {
    padding: 12px;
  }

  .precision-timer {
    padding: 12px;
  }

  .leaderboard {
    grid-template-columns: 1fr;
  }

  .race-hud {
    inset-block-start: 8px;
    inset-inline: 8px;
    gap: 3px;
  }

  .race-hud > div {
    padding: 6px 2px;
  }

  .race-hud span {
    font-size: .59rem;
  }

  .race-hud strong {
    font-size: .73rem;
  }

  .race-stage-label {
    font-size: .68rem;
  }

  .game-overlay {
    padding: 13px;
  }

  .game-overlay-card {
    padding: 20px 16px;
  }

  .game-overlay-card h2 {
    font-size: clamp(1.7rem, 9vw, 2.35rem);
  }

  .game-overlay-card p {
    font-size: .9rem;
  }
}

@media (max-width: 430px) {
  .race-game-heading > p:last-child {
    display: none;
  }

  .race-stage {
    min-height: clamp(425px, calc(100svh - 150px), 540px);
  }

  .race-rule span {
    font-size: .62rem;
  }

  .race-button {
    min-height: 39px;
    padding-inline: 13px;
    font-size: .82rem;
  }
}

/* Game selector: each arcade challenge is a focused, independent experience. */
.race-mode-switch {
  display: inline-flex;
  gap: 7px;
  margin-top: 15px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  background: rgba(0, 0, 0, .52);
}

.race-mode-chip {
  min-height: 34px;
  padding: 7px 15px;
  border-radius: 999px;
  color: rgba(255, 255, 255, .72);
  font-size: .8rem;
  font-weight: 900;
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease, transform .2s ease;
}

.race-mode-chip:hover,
.race-mode-chip:focus-visible {
  color: #fff;
  transform: translateY(-1px);
}

.race-mode-chip.is-active {
  background: linear-gradient(100deg, #e20b1d, #ff8b12);
  box-shadow: 0 5px 16px rgba(227, 9, 27, .28);
  color: #fff;
}

.precision-game-link {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 76px;
  padding: 10px;
  border: 1px solid rgba(255, 210, 23, .6);
  border-radius: 10px;
  background:
    linear-gradient(125deg, rgba(221, 6, 23, .16), transparent 62%),
    rgba(255, 255, 255, .04);
  color: #fff;
  text-decoration: none;
  transition: border-color .2s ease, background-color .2s ease, transform .2s ease;
}

.precision-game-link:hover,
.precision-game-link:focus-visible {
  border-color: #ffd217;
  background-color: rgba(255, 210, 23, .1);
  transform: translateY(-2px);
}

.precision-game-link-number {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: #ffd217;
  color: #111;
  font-size: .82rem;
  font-weight: 900;
}

.precision-game-link strong,
.precision-game-link small {
  display: block;
}

.precision-game-link strong {
  font-size: .98rem;
  font-weight: 900;
}

.precision-game-link small {
  margin-top: 2px;
  color: rgba(255, 255, 255, .72);
  font-size: .72rem;
  font-weight: 700;
}

.precision-game-link b {
  color: #ffd217;
  font-size: 1.4rem;
  line-height: 1;
}

body[data-page="precision-timer"] {
  background: #050505;
}

body[data-page="precision-timer"] .internal-main.precision-main {
  width: min(100% - 48px, 1180px);
  min-height: calc(100svh - 76px);
  margin: 0 auto;
  padding: 32px 0 48px;
}

.precision-game {
  position: relative;
  overflow: hidden;
  padding: clamp(18px, 3vw, 32px);
  border: 1px solid rgba(255, 210, 23, .32);
  border-radius: 12px;
  background:
    radial-gradient(circle at 7px 7px, rgba(220, 7, 24, .58) 0 2px, transparent 2.8px) 0 0 / 20px 20px,
    #060606;
}

.precision-game::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(115deg, rgba(220, 7, 24, .1), transparent 38%, rgba(255, 205, 0, .07));
}

.precision-game > * {
  position: relative;
  z-index: 1;
}

.precision-game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(270px, .75fr);
  align-items: stretch;
  gap: 18px;
  max-width: 920px;
  margin: 0 auto;
}

.precision-clock-card,
.precision-side-card {
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 12px;
  background: rgba(9, 9, 10, .9);
}

.precision-clock-card {
  display: flex;
  min-height: 390px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  text-align: center;
}

.precision-clock-target {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 13px;
  border: 1px solid rgba(255, 210, 23, .64);
  border-radius: 999px;
  color: #ffd217;
  font-size: .78rem;
  font-weight: 900;
}

.precision-clock-display {
  margin: 18px 0 13px;
  color: #fff;
  direction: ltr;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: clamp(4rem, 9vw, 7rem);
  font-weight: 900;
  letter-spacing: -.08em;
  line-height: .88;
  text-shadow: 0 0 26px rgba(255, 210, 23, .14);
}

.precision-progress {
  width: min(100%, 390px);
  height: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}

.precision-progress span {
  display: block;
  width: var(--precision-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e20b1d, #ffd217);
  transition: width .05s linear;
}

.precision-clock-card .precision-timer-result {
  min-height: 1.6em;
  margin: 18px 0;
  font-size: .94rem;
}

.precision-clock-button {
  position: relative;
  isolation: isolate;
  display: grid;
  width: 148px;
  min-width: 148px;
  min-height: 148px;
  aspect-ratio: 1;
  place-items: center;
  padding: 30px 20px 22px;
  border: 5px solid #ffd217;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, .72) 0 4%, rgba(255, 255, 255, .2) 5% 12%, transparent 13%),
    radial-gradient(circle at 50% 42%, #ff4c26 0 25%, #ef101d 58%, #aa0010 100%);
  box-shadow:
    inset 0 -13px 18px rgba(91, 0, 8, .42),
    inset 0 5px 10px rgba(255, 255, 255, .28),
    0 8px 0 #73000b,
    0 13px 0 #222,
    0 15px 0 #ffd217,
    0 23px 34px rgba(226, 11, 29, .32);
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1.2;
  text-align: center;
  text-shadow: 0 2px 2px rgba(0, 0, 0, .45);
  touch-action: manipulation;
  transform: translateY(0);
  transition: transform .16s ease, box-shadow .16s ease, filter .2s ease;
  animation: precision-buzzer-ready 2.2s ease-in-out infinite;
}

.precision-clock-button::before {
  position: absolute;
  inset: 9px;
  z-index: 0;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 50%;
  box-shadow: inset 0 0 0 5px rgba(108, 0, 10, .18);
  content: "";
  pointer-events: none;
}

.precision-clock-button::after {
  position: absolute;
  inset-block-start: 18px;
  inset-inline-end: 27px;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, .72);
  border-radius: 50%;
  background: #fff59a;
  box-shadow: 0 0 12px #ffd217;
  content: "";
  pointer-events: none;
}

.precision-clock-button:hover {
  filter: brightness(1.08) saturate(1.08);
  transform: translateY(-2px) scale(1.035);
}

.precision-clock-button:active {
  box-shadow:
    inset 0 -6px 13px rgba(91, 0, 8, .48),
    inset 0 5px 10px rgba(255, 255, 255, .2),
    0 2px 0 #73000b,
    0 5px 0 #222,
    0 7px 0 #ffd217,
    0 12px 20px rgba(226, 11, 29, .24);
  transform: translateY(7px) scale(.98);
}

.precision-clock-button.is-running {
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, .64) 0 4%, rgba(255, 255, 255, .16) 5% 12%, transparent 13%),
    radial-gradient(circle at 50% 42%, #ff1b2d 0 24%, #c90017 60%, #72000b 100%);
  box-shadow:
    inset 0 -13px 18px rgba(62, 0, 6, .55),
    inset 0 5px 10px rgba(255, 255, 255, .23),
    0 8px 0 #5f0009,
    0 13px 0 #222,
    0 15px 0 #ffd217,
    0 0 34px rgba(255, 24, 44, .58);
  color: #fff;
  animation: precision-buzzer-running .9s ease-in-out infinite;
}

.precision-clock-button.is-running::after {
  background: #ffd217;
  box-shadow: 0 0 18px #ffd217, 0 0 28px rgba(255, 210, 23, .72);
}

@keyframes precision-buzzer-ready {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(255, 210, 23, 0)); }
  50% { filter: drop-shadow(0 0 9px rgba(255, 210, 23, .28)); }
}

@keyframes precision-buzzer-running {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.14); }
}

.precision-side-card {
  padding: 20px;
}

.precision-side-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 900;
}

.precision-side-title > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: #ffd217;
  color: #111;
  font-size: .85rem;
}

.precision-steps {
  display: grid;
  gap: 9px;
  margin: 19px 0 24px;
  padding: 0;
  list-style-position: inside;
  color: rgba(255, 255, 255, .78);
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.45;
}

.precision-leaderboard {
  padding: 16px;
  border: 1px solid rgba(255, 210, 23, .82);
  border-radius: 10px;
  background: #f7f4ec;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .28);
}

.precision-board-heading strong,
.precision-board-heading small {
  display: block;
}

.precision-board-heading strong {
  color: #111;
  font-size: 0;
  font-weight: 900;
}

.precision-board-heading small {
  margin-top: 2px;
  color: rgba(17, 17, 17, .62);
  font-size: 0;
  font-weight: 700;
}

.precision-leaderboard ol {
  display: grid;
  gap: 7px;
  margin: 13px 0 0;
  padding: 0;
  list-style: none;
}

.precision-leaderboard li {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  border: 1px solid rgba(17, 17, 17, .12);
  border-radius: 7px;
  background: #fff;
  color: rgba(17, 17, 17, .76);
  font-size: .78rem;
  font-weight: 700;
}

.precision-leaderboard li strong {
  color: #ffd217;
  direction: ltr;
}

@media (max-width: 1199px) {
  body[data-page="precision-timer"] .internal-main.precision-main {
    width: min(100% - 20px, 600px);
    position: relative;
    inset-block-start: 64px;
    margin-block-end: 64px;
    padding: 18px 0 32px;
  }

  .precision-game {
    padding: 12px;
  }

  .race-mode-switch {
    margin-top: 10px;
  }

  .race-mode-chip {
    min-height: 32px;
    padding: 6px 11px;
    font-size: .72rem;
  }

  .precision-game-layout {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .precision-clock-card {
    min-height: 330px;
    padding: 22px 14px;
  }

  .precision-clock-display {
    font-size: clamp(3.3rem, 18vw, 5.4rem);
  }

  .precision-clock-button {
    width: 132px;
    min-width: 132px;
    min-height: 132px;
    padding: 27px 17px 20px;
    font-size: .9rem;
  }

  .precision-side-card {
    padding: 16px;
  }

  .precision-game-link {
    min-height: 70px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .precision-clock-button,
  .precision-clock-button.is-running {
    animation: none;
  }
}

