:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: #121418;
  color: #f5f7fb;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 18% 8%, rgba(68, 146, 255, 0.16), transparent 28rem),
    linear-gradient(135deg, #101218 0%, #1d2028 52%, #101218 100%);
}

.game-shell {
  width: min(96vw, 969px);
  display: grid;
  gap: 14px;
}

.play-area {
  display: grid;
  grid-template-columns: minmax(0, 675px) 280px;
  gap: 14px;
  align-items: stretch;
  justify-content: center;
}

.topbar,
.status,
.ranking {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(22, 25, 32, 0.82);
  backdrop-filter: blur(12px);
  border-radius: 8px;
}

.topbar > div {
  display: grid;
  gap: 2px;
  min-width: 76px;
}

.label {
  color: #9ca8bc;
  font-size: 12px;
}

strong {
  font-size: 22px;
  line-height: 1;
}

button {
  height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: #f5f7fb;
  color: #121418;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: #dce8ff;
}

canvas {
  width: 100%;
  aspect-ratio: 900 / 620;
  display: block;
  border-radius: 8px;
  background: #0b0d12;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.36);
}

.status {
  justify-content: center;
  color: #c8d0dd;
  text-align: center;
}

.ranking {
  display: grid;
  align-items: stretch;
  align-content: start;
  gap: 12px;
  min-height: 100%;
}

.ranking-header {
  display: grid;
  gap: 12px;
}

h1 {
  margin: 0;
  font-size: 18px;
}

label {
  display: grid;
  gap: 8px;
  color: #9ca8bc;
  font-size: 12px;
}

input {
  width: 100%;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #f5f7fb;
  padding: 0 10px;
  font: inherit;
  font-size: 14px;
  text-transform: uppercase;
}

.ranking-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0;
  padding-left: 24px;
}

.ranking-list li {
  color: #dce4f2;
  font-variant-numeric: tabular-nums;
}

.ranking-entry {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.ranking-entry span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-state {
  margin: 0;
  color: #9ca8bc;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .game-shell {
    width: min(94vw, 960px);
  }

  .play-area {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar {
    flex-wrap: wrap;
  }

  button {
    width: 100%;
  }

}
