:root {
  color-scheme: dark;
  font-family: "Segoe UI", "Yu Gothic UI", Meiryo, sans-serif;
  background: #0c0d12;
  color: #f5f1e8;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  background:
    linear-gradient(90deg, rgba(245, 193, 95, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(80, 178, 167, 0.07) 1px, transparent 1px),
    linear-gradient(145deg, #0c0d12 0%, #15131b 52%, #111822 100%);
  background-size: 34px 34px, 34px 34px, auto;
}

.shell {
  width: min(1180px, calc(100vw - 28px));
  display: grid;
  grid-template-columns: minmax(0, 960px) 180px;
  gap: 18px;
  align-items: start;
}

.game-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid rgba(245, 241, 232, 0.18);
  border-radius: 8px;
  background: #090a0d;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.overlay {
  position: absolute;
  inset: 0;
  display: block;
  padding: 0;
  overflow: hidden;
  background: #090a0d;
}

.overlay.hidden {
  display: none;
}

h1 {
  margin: 0;
  font-size: clamp(40px, 7vw, 84px);
  line-height: 0.95;
  letter-spacing: 0;
}

.title-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 45%;
}

.title-actions {
  position: absolute;
  left: 50%;
  bottom: clamp(28px, 7%, 56px);
  display: grid;
  gap: 10px;
  justify-items: center;
  transform: translateX(-50%);
  padding: 14px 30px;
}

p {
  max-width: 520px;
  margin: 0;
  color: #d8d0c0;
  font-size: 16px;
  line-height: 1.55;
}

button {
  min-width: 124px;
  height: 42px;
  border: 0;
  border-radius: 6px;
  background: rgba(9, 10, 13, 0.58);
  color: #f5f1e8;
  font-weight: 800;
  cursor: pointer;
}

.rules-link {
  display: inline-grid;
  place-items: center;
  text-decoration: none;
}

.menu-item {
  position: relative;
  width: 164px;
  min-width: 124px;
  height: 42px;
  border: 1px solid rgba(245, 241, 232, 0.24);
  border-radius: 6px;
  background: rgba(9, 10, 13, 0.58);
  color: #f5f1e8;
  font-weight: 800;
  text-align: center;
}

.menu-item.selected {
  color: #fff4c6;
  border-color: rgba(245, 193, 95, 0.82);
  background: rgba(245, 193, 95, 0.16);
  text-shadow: 0 0 10px rgba(245, 193, 95, 0.5);
}

.menu-item.selected::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 50%;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 12px solid #f5c15f;
  filter: drop-shadow(0 0 5px rgba(245, 193, 95, 0.85));
  transform: translateY(-50%);
}

.menu-help {
  max-width: none;
  margin-top: 2px;
  color: #fff4c6;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.75);
}

.test-stage {
  width: 156px;
  display: grid;
  gap: 5px;
  color: #d8d0c0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.test-stage.hidden {
  display: none;
}

.test-stage select {
  height: 34px;
  border: 1px solid rgba(245, 241, 232, 0.26);
  border-radius: 6px;
  background: rgba(12, 18, 17, 0.82);
  color: #f5f1e8;
  font-weight: 700;
}

.panel {
  display: grid;
  gap: 12px;
  justify-items: center;
}

.panel > div {
  position: relative;
  width: 132px;
  min-height: 76px;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 14px 12px 11px;
  border: 2px solid #d4a64d;
  border-radius: 7px;
  overflow: hidden;
  clip-path: polygon(9px 0, calc(100% - 9px) 0, 100% 9px, 100% calc(100% - 9px), calc(100% - 9px) 100%, 9px 100%, 0 calc(100% - 9px), 0 9px);
  background:
    linear-gradient(135deg, rgba(255, 247, 183, 0.72), transparent 18%),
    linear-gradient(315deg, rgba(91, 45, 18, 0.78), transparent 22%),
    linear-gradient(180deg, #f0d386 0%, #a96c27 12%, #5f3519 22%, #17131e 23%, #11101a 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 243, 183, 0.6),
    inset 0 0 0 5px rgba(48, 29, 18, 0.86),
    inset 0 14px 18px rgba(255, 239, 173, 0.08),
    inset 0 -14px 18px rgba(0, 0, 0, 0.36),
    0 9px 18px rgba(0, 0, 0, 0.34);
}

.panel > div::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(234, 193, 101, 0.6);
  border-radius: 4px;
  clip-path: polygon(7px 0, calc(100% - 7px) 0, 100% 7px, 100% calc(100% - 7px), calc(100% - 7px) 100%, 7px 100%, 0 calc(100% - 7px), 0 7px);
  background:
    radial-gradient(circle at 50% 8%, rgba(81, 219, 199, 0.2), transparent 44%),
    linear-gradient(180deg, rgba(34, 35, 54, 0.95), rgba(19, 21, 34, 0.95));
  box-shadow:
    inset 0 0 0 1px rgba(255, 246, 197, 0.14),
    inset 0 -10px 18px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.panel > div::after {
  content: "";
  position: absolute;
  bottom: 10px;
  left: 50%;
  width: 70px;
  height: 1px;
  background:
    linear-gradient(90deg, transparent, rgba(255, 232, 143, 0.95), transparent);
  transform: translateX(-50%);
  pointer-events: none;
}

.label {
  display: block;
  position: relative;
  z-index: 1;
  margin-bottom: 7px;
  color: #e7c77a;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

strong {
  position: relative;
  z-index: 1;
  top: -3px;
  color: #f8f0c8;
  font-size: 29px;
  line-height: 1;
  font-weight: 900;
  text-shadow:
    0 2px 0 rgba(55, 33, 16, 0.9),
    0 0 10px rgba(245, 193, 95, 0.3);
}

@media (max-width: 860px) {
  body {
    align-content: start;
    padding-top: 14px;
  }

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

  .panel {
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: 8px;
    justify-items: center;
  }

  .panel > div {
    width: min(132px, 100%);
  }
}
