.tetris-app {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
  height: 100%;
  min-height: 0;
  padding: clamp(8px, 1vw, 14px);
  border-radius: 22px;
  color: #f8f6ef;
  background:
    radial-gradient(circle at top left, rgba(255, 206, 109, 0.34), transparent 26%),
    radial-gradient(circle at bottom right, rgba(76, 191, 255, 0.24), transparent 30%),
    linear-gradient(180deg, #232238 0%, #151f31 100%);
}

.tetris-app__topbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.tetris-app__topbar-main {
  display: grid;
  gap: 2px;
}

.tetris-app__topbar-side {
  display: flex;
  flex: 1 1 360px;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tetris-app__info-cards {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-right: auto;
}

.tetris-app__settings-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.tetris-app__icon-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tetris-app__back.ant-btn {
  width: fit-content;
  padding-inline: 0;
  height: auto;
  color: rgba(248, 244, 235, 0.78);
}

.tetris-app__exit.ant-btn {
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  color: rgba(248, 244, 235, 0.88);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tetris-app__topbar-main h2 {
  margin: 0;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1;
}

.tetris-app__settings-trigger.ant-btn {
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 999px;
  color: rgba(248, 244, 235, 0.84);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tetris-app__icon-button.ant-btn {
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 999px;
  color: rgba(248, 244, 235, 0.84);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tetris-app__icon-button.ant-btn:hover,
.tetris-app__icon-button.ant-btn:focus-visible,
.tetris-app__icon-button.ant-btn.is-active {
  color: #fff6dc;
  background: rgba(255, 214, 121, 0.16);
  border-color: rgba(255, 214, 121, 0.32);
}

.tetris-app__icon-button--rotate.ant-btn.is-active {
  box-shadow: 0 0 0 1px rgba(255, 214, 121, 0.16), 0 10px 24px rgba(255, 195, 88, 0.16);
}

.tetris-app__settings-trigger.ant-btn.is-active,
.tetris-app__settings-trigger.ant-btn:hover,
.tetris-app__settings-trigger.ant-btn:focus-visible {
  color: #fff6dc;
  background: rgba(255, 214, 121, 0.16);
  border-color: rgba(255, 214, 121, 0.32);
}

.tetris-app__settings-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 142px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(35, 45, 66, 0.98), rgba(20, 29, 46, 0.98));
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  z-index: 3;
}

.tetris-app__settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tetris-app__settings-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(248, 244, 235, 0.9);
}

.tetris-app__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  min-width: 196px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03)),
    rgba(15, 22, 36, 0.24);
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.tetris-app__stat {
  display: grid;
  gap: 4px;
  padding: 9px 12px;
  min-width: 0;
  background: rgba(255, 255, 255, 0.03);
}

.tetris-app__stat + .tetris-app__stat {
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.tetris-app__stat span {
  font-size: 11px;
  line-height: 1;
  color: rgba(248, 244, 235, 0.72);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tetris-app__stat strong {
  font-size: 16px;
  line-height: 1;
}

.tetris-app__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 152px;
  gap: 8px;
  min-height: 0;
}

.tetris-app__board-shell {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  height: 100%;
  padding: clamp(8px, 1vw, 14px);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05)),
    rgba(27, 38, 58, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.tetris-app__board {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  align-self: stretch;
  height: 100%;
  width: auto;
  max-width: min(100%, 430px);
  aspect-ratio: 1 / 2;
  gap: 3px;
  padding: 9px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(32, 45, 70, 0.96), rgba(22, 34, 54, 0.98));
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.tetris-app__cell,
.tetris-app__next-cell {
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.tetris-app__cell[class*='tetris-app__cell--'],
.tetris-app__next-cell--active {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--tetris-cell-color) 92%, white), var(--tetris-cell-color));
  box-shadow:
    0 0 16px color-mix(in srgb, var(--tetris-cell-color) 34%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.tetris-app__overlay {
  position: absolute;
  inset: 18px 18px auto 18px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
}

.tetris-app__banner {
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(15, 22, 36, 0.72);
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.tetris-app__banner--danger {
  border-color: rgba(255, 117, 104, 0.32);
  color: #ffb2a9;
}

.tetris-app__sidebar {
  display: grid;
  align-content: start;
  gap: 8px;
}

.tetris-app__next-preview {
  display: grid;
  gap: 8px;
  min-width: 112px;
  padding: 10px 12px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03)),
    rgba(15, 22, 36, 0.24);
  backdrop-filter: blur(12px);
}

.tetris-app__panel-label {
  font-size: 11px;
  line-height: 1.1;
  color: rgba(248, 244, 235, 0.76);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tetris-app__next-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  width: 72px;
}

.tetris-app__next-cell {
  aspect-ratio: 1;
}

.tetris-app__touch-layer {
  display: none;
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.tetris-app__touch-layer *,
.tetris-app__settings-panel,
.tetris-app__settings-panel * {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.tetris-app__mobile-control-deck {
  position: absolute;
  pointer-events: none;
  z-index: 5;
  border: 1px solid rgba(255, 255, 255, 0.016);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.007), rgba(255, 255, 255, 0.001)),
    rgba(4, 7, 14, 0.01);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.008),
    inset 0 -10px 18px rgba(0, 0, 0, 0.02);
  opacity: 0.07;
}

.tetris-app__mobile-control-deck--joystick {
  left: 10px;
  bottom: 12px;
  width: min(46vw, 218px);
  height: min(42vw, 196px);
  border-radius: 40px 56px 34px 28px;
  background:
    radial-gradient(circle at 28% 68%, rgba(255, 214, 121, 0.028), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.014), rgba(255, 255, 255, 0.002)),
    rgba(8, 14, 24, 0.024);
}

.tetris-app__mobile-control-deck--actions {
  right: 10px;
  bottom: 78px;
  width: min(42vw, 194px);
  height: min(46vw, 222px);
  border-radius: 44px 44px 28px 28px;
  background:
    radial-gradient(circle at 42% 28%, rgba(95, 221, 255, 0.02), transparent 26%),
    radial-gradient(circle at 62% 68%, rgba(255, 144, 96, 0.018), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.01), rgba(255, 255, 255, 0.001)),
    rgba(8, 14, 24, 0.015);
}

.tetris-app__joystick-touch-zone {
  position: absolute;
  inset: 96px 232px 14px 0;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.tetris-app__joystick-touch-zone-glow {
  position: absolute;
  inset: 18% 34% 4% 2%;
  border-radius: 38px 78px 28px 24px;
  background:
    radial-gradient(circle at 18% 74%, rgba(255, 210, 112, 0.045), transparent 30%),
    radial-gradient(circle at 52% 62%, rgba(255, 255, 255, 0.01), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.01), rgba(255, 255, 255, 0.002)),
    rgba(56, 76, 118, 0.016);
  border: 1px solid rgba(255, 255, 255, 0.016);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.016),
    inset 0 -18px 32px rgba(3, 6, 14, 0.08);
}

.tetris-app__joystick-wrap {
  position: absolute;
  display: grid;
  place-items: center;
  width: 144px;
  height: 144px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.035), transparent 66%),
    rgba(14, 22, 38, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 18px 36px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(14px);
  transform: translate(-50%, -50%) scale(0.92);
  opacity: 0;
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

.tetris-app__joystick-wrap.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.tetris-app__mobile-utility-actions {
  display: none;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  flex-wrap: nowrap;
  margin-left: auto;
  z-index: 7;
}

.tetris-app__mobile-utility-actions > * {
  flex: 0 0 auto;
}

.tetris-app__mobile-main-buttons {
  display: none;
  position: absolute;
  right: 18px;
  bottom: 90px;
  grid-template-columns: repeat(2, minmax(0, 90px));
  grid-template-rows: repeat(2, 90px);
  grid-template-areas:
    "rotate hard-drop"
    "soft-drop hard-drop";
  align-items: end;
  justify-items: end;
  gap: 12px;
  pointer-events: none;
  z-index: 6;
}

.tetris-app__settings-wrap--mobile {
  display: none;
}

.tetris-app__utility-action.ant-btn,
.tetris-app__audio-cta.ant-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 999px;
  color: rgba(248, 246, 239, 0.88);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.026), rgba(255, 255, 255, 0.005)),
    rgba(9, 15, 28, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(18px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 8px 16px rgba(0, 0, 0, 0.03);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.tetris-app__audio-cta.ant-btn {
  color: #fff6dc;
  background:
    linear-gradient(180deg, rgba(255, 231, 168, 0.045), rgba(255, 170, 58, 0.018)),
    rgba(12, 18, 30, 0.05);
  border: 1px solid rgba(255, 225, 161, 0.08);
}

.tetris-app__utility-action--meta.ant-btn,
.tetris-app__settings-wrap--mobile .tetris-app__settings-trigger.ant-btn {
  width: 36px;
  min-width: 36px;
  height: 36px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.09), transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.008)),
    rgba(18, 18, 22, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.055),
    inset 0 -5px 10px rgba(0, 0, 0, 0.1),
    0 6px 12px rgba(0, 0, 0, 0.06);
}

.tetris-app__mobile-action.ant-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 90px;
  min-width: 90px;
  height: 90px;
  padding: 0;
  border-radius: 50%;
  color: rgba(248, 246, 239, 0.94);
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.01), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.006), rgba(255, 255, 255, 0.001)),
    rgba(17, 24, 38, 0.007);
  border: 1px solid rgba(255, 248, 224, 0.012);
  backdrop-filter: blur(3px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.009),
    inset 0 -3px 6px rgba(0, 0, 0, 0.014),
    0 4px 8px rgba(0, 0, 0, 0.01);
  touch-action: manipulation;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

.tetris-app__utility-action.ant-btn .ant-btn-icon,
.tetris-app__mobile-action.ant-btn .ant-btn-icon,
.tetris-app__audio-cta.ant-btn .ant-btn-icon {
  font-size: 28px;
}

.tetris-app__utility-action.ant-btn .ant-btn-icon,
.tetris-app__mobile-action.ant-btn .ant-btn-icon {
  margin-inline-end: 0;
}

.tetris-app__mobile-action.ant-btn:hover,
.tetris-app__mobile-action.ant-btn:focus-visible,
.tetris-app__mobile-action.ant-btn.is-active {
  color: #fff6dc;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 251, 240, 0.016), transparent 30%),
    linear-gradient(180deg, rgba(255, 220, 141, 0.01), rgba(255, 188, 88, 0.003)),
    rgba(56, 31, 18, 0.013);
  border-color: rgba(255, 226, 161, 0.022);
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 220, 0.015),
    inset 0 -5px 10px rgba(0, 0, 0, 0.02),
    0 5px 10px rgba(0, 0, 0, 0.013);
}

.tetris-app__audio-cta.ant-btn:hover,
.tetris-app__audio-cta.ant-btn:focus-visible {
  color: #fff8e7;
  background:
    linear-gradient(180deg, rgba(255, 234, 176, 0.1), rgba(255, 175, 62, 0.04)),
    rgba(38, 26, 14, 0.12);
  border-color: rgba(255, 214, 121, 0.18);
}

.tetris-app__audio-cta.ant-btn {
  touch-action: manipulation;
}

.tetris-app__utility-action.ant-btn:hover,
.tetris-app__utility-action.ant-btn:focus-visible {
  color: #fff6dc;
  border-color: rgba(255, 214, 121, 0.18);
}

.tetris-app__mobile-action--rotate {
  grid-area: rotate;
  align-self: start;
  justify-self: start;
  width: 74px;
  min-width: 74px;
  height: 74px;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.012), transparent 28%),
    linear-gradient(180deg, rgba(122, 216, 255, 0.01), rgba(74, 115, 255, 0.003)),
    rgba(12, 24, 42, 0.009);
  border-color: rgba(136, 214, 255, 0.018);
}

.tetris-app__mobile-action--drop {
  grid-area: soft-drop;
  align-self: end;
  justify-self: start;
  width: 88px;
  min-width: 88px;
  height: 88px;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.012), transparent 28%),
    linear-gradient(180deg, rgba(255, 166, 112, 0.011), rgba(255, 104, 64, 0.003)),
    rgba(45, 21, 15, 0.01);
  border-color: rgba(255, 170, 130, 0.018);
}

.tetris-app__mobile-action--hard-drop {
  grid-area: hard-drop;
  align-self: center;
  justify-self: end;
  width: 98px;
  min-width: 98px;
  height: 98px;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.012), transparent 28%),
    linear-gradient(180deg, rgba(122, 216, 255, 0.01), rgba(74, 115, 255, 0.003)),
    rgba(12, 24, 42, 0.009);
  border-color: rgba(136, 214, 255, 0.018);
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 214, 0.014),
    inset 0 -5px 10px rgba(0, 0, 0, 0.02),
    0 5px 10px rgba(0, 0, 0, 0.013);
}

.tetris-app__sidebar-spacer {
  min-height: 1px;
}

.tetris-app__joystick-pad {
  position: relative;
  display: grid;
  place-items: center;
  width: 128px;
  height: 128px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% 56%, rgba(255, 208, 120, 0.1), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012)),
    rgba(5, 10, 20, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: visible;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -18px 26px rgba(0, 0, 0, 0.24),
    0 14px 24px rgba(0, 0, 0, 0.16);
}

.tetris-app__joystick-pad::before,
.tetris-app__joystick-pad::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.tetris-app__joystick-pad::before {
  width: 34%;
  height: calc(100% - 20px);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.016)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.11) 0 1px, transparent 1px calc(100% - 1px), rgba(255, 255, 255, 0.11) calc(100% - 1px)),
    rgba(8, 12, 24, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 0 18px rgba(255, 204, 112, 0.04),
    0 8px 20px rgba(0, 0, 0, 0.08);
}

.tetris-app__joystick-pad::after {
  width: 58px;
  height: calc(100% - 42px);
  border-radius: 999px;
  background:
    linear-gradient(90deg, transparent 0 18px, rgba(255, 255, 255, 0.12) 18px 20px, transparent 20px 50px, rgba(255, 255, 255, 0.12) 50px 52px, transparent 52px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 214, 121, 0.025));
  opacity: 0.82;
}

.tetris-app__joystick {
  --joystick-size: 112px;
  position: relative;
  display: block;
  width: var(--joystick-size);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 210, 112, 0.2), transparent 30%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.04), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(7, 11, 24, 0.34);
  backdrop-filter: blur(18px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 20px 40px rgba(0, 0, 0, 0.24);
  pointer-events: none;
  transition:
    box-shadow 140ms ease,
    background 140ms ease;
}

.tetris-app__joystick.is-active {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 0 0 1px rgba(255, 214, 121, 0.16),
    0 20px 40px rgba(0, 0, 0, 0.28);
}

.tetris-app__joystick-ring,
.tetris-app__joystick-stem,
.tetris-app__joystick-gate,
.tetris-app__joystick-knob,
.tetris-app__joystick-label {
  position: absolute;
}

.tetris-app__joystick-stem {
  top: 50%;
  left: 50%;
  width: 12%;
  height: 44%;
  margin-top: -22%;
  margin-left: -6%;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 248, 227, 0.56), rgba(255, 201, 106, 0.2)),
    rgba(255, 255, 255, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 8px 22px rgba(0, 0, 0, 0.24);
}

.tetris-app__joystick-ring {
  inset: 16%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.03), transparent 70%);
}

.tetris-app__joystick-gate {
  inset: 20%;
  border-radius: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  clip-path: polygon(24% 0, 76% 0, 100% 24%, 100% 76%, 76% 100%, 24% 100%, 0 76%, 0 24%);
  opacity: 0.78;
}

.tetris-app__joystick-knob {
  top: 50%;
  left: 50%;
  width: 37%;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 244, 214, 0.22);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.3), transparent 28%),
    radial-gradient(circle at 55% 58%, rgba(255, 178, 82, 0.26), transparent 54%),
    linear-gradient(180deg, rgba(255, 235, 189, 0.16), rgba(117, 57, 17, 0.24)),
    rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 2px 6px rgba(255, 255, 255, 0.14),
    inset 0 -8px 16px rgba(0, 0, 0, 0.28),
    0 12px 26px rgba(0, 0, 0, 0.3);
  transform: translate(0, 0);
  margin-top: calc(var(--joystick-size) * -0.175);
  margin-left: calc(var(--joystick-size) * -0.175);
}

.tetris-app__joystick-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgba(248, 244, 235, 0.68);
}

.tetris-app__joystick-label--left {
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
}

.tetris-app__joystick-label--right {
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
}

.tetris-app__joystick-label--down {
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
}

@media (max-width: 920px) {
  .tetris-app__body {
    grid-template-columns: minmax(0, 1fr);
  }

  .tetris-app__sidebar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .tetris-app {
    --tetris-mobile-shell-height: calc(100svh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 12px);
    gap: 6px;
    height: min(100%, var(--tetris-mobile-shell-height));
    max-height: var(--tetris-mobile-shell-height);
    padding: 8px;
    border-radius: 16px;
  }

  .tetris-app__topbar {
    display: grid;
    gap: 6px;
  }

  .tetris-app__topbar-main {
    gap: 1px;
  }

  .tetris-app__topbar-main h2 {
    font-size: 24px;
  }

  .tetris-app__topbar-side {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-content: initial;
    align-items: start;
    column-gap: 8px;
    row-gap: 6px;
    position: relative;
    padding-right: 162px;
    min-height: 78px;
  }

  .tetris-app__info-cards {
    flex: 1 1 auto;
    min-width: 0;
    margin-right: 0;
    gap: 6px;
    max-width: 100%;
  }

  .tetris-app__stats {
    min-width: 0;
    min-height: 72px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
      rgba(7, 11, 20, 0.22);
  }

  .tetris-app__icon-actions {
    margin-left: auto;
    display: none;
  }

  .tetris-app__settings-wrap--desktop {
    display: none;
  }

  .tetris-app__next-preview {
    min-width: 98px;
    padding: 8px 10px 10px;
    gap: 6px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
      rgba(7, 11, 20, 0.22);
  }

  .tetris-app__next-grid {
    width: 60px;
    gap: 2px;
  }

  .tetris-app__panel-label {
    font-size: 10px;
    letter-spacing: 0.12em;
  }

  .tetris-app__stat {
    padding: 8px 10px;
    gap: 3px;
  }

  .tetris-app__stat span {
    font-size: 10px;
  }

  .tetris-app__stat strong {
    font-size: 14px;
  }

  .tetris-app__board-shell {
    min-height: min(62svh, 560px);
    padding: 8px;
  }

  .tetris-app__board {
    max-width: min(100%, 348px);
    gap: 2px;
    padding: 7px;
    border-radius: 14px;
  }

  .tetris-app__overlay {
    inset: 12px 12px auto 12px;
  }

  .tetris-app__sidebar {
    grid-template-columns: 1fr;
  }

  .tetris-app__touch-layer {
    display: block;
  }

  .tetris-app__mobile-utility-actions,
  .tetris-app__settings-wrap--mobile {
    display: flex;
  }

  .tetris-app__mobile-utility-actions {
    position: absolute;
    top: 2px;
    right: -2px;
    margin-left: 0;
  }

  .tetris-app__utility-action.ant-btn,
  .tetris-app__audio-cta.ant-btn,
  .tetris-app__mobile-main-buttons {
    display: grid;
  }

  .tetris-app__utility-action.ant-btn,
  .tetris-app__audio-cta.ant-btn {
    color: rgba(247, 242, 230, 0.92);
  }

  .tetris-app__settings-wrap--mobile .tetris-app__settings-panel {
    top: calc(100% + 6px);
    right: 0;
  }

  .tetris-app__mobile-action.ant-btn {
    border-radius: 50%;
  }
}

@media (max-width: 520px) {
  .tetris-app__topbar-side {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    column-gap: 6px;
    padding-right: 136px;
    min-height: 72px;
  }

  .tetris-app__info-cards {
    width: 100%;
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: stretch;
    max-width: 100%;
  }

  .tetris-app__icon-actions {
    margin-left: 0;
    justify-content: flex-end;
  }

  .tetris-app__mobile-utility-actions {
    justify-content: flex-end;
    gap: 2px;
    top: 2px;
    right: -3px;
  }

  .tetris-app__settings-wrap {
    align-self: auto;
  }

  .tetris-app__next-preview {
    min-width: 92px;
    padding: 7px 8px 8px;
    border-radius: 10px;
  }

  .tetris-app__next-grid {
    width: 52px;
  }

  .tetris-app__stats {
    border-radius: 10px;
    min-height: 64px;
  }

  .tetris-app__stat {
    padding: 7px 8px;
  }

  .tetris-app__stat strong {
    font-size: 13px;
  }

  .tetris-app__touch-layer {
    inset: 0;
  }

  .tetris-app__joystick-touch-zone {
    inset: 80px 186px 12px 0;
  }

  .tetris-app__overlay {
    inset: 10px 10px auto 10px;
  }

  .tetris-app__joystick-wrap {
    width: 132px;
    height: 132px;
  }

  .tetris-app__utility-action.ant-btn,
  .tetris-app__audio-cta.ant-btn {
    width: 34px;
    min-width: 34px;
    height: 34px;
  }

  .tetris-app__utility-action.ant-btn .ant-btn-icon,
  .tetris-app__audio-cta.ant-btn .ant-btn-icon {
    font-size: 18px;
  }

  .tetris-app__mobile-main-buttons {
    right: 12px;
    bottom: 74px;
    grid-template-columns: repeat(2, minmax(0, 74px));
    grid-template-rows: repeat(2, 74px);
    gap: 10px;
  }

  .tetris-app__mobile-action.ant-btn {
    width: 74px;
    min-width: 74px;
    height: 74px;
  }

  .tetris-app__mobile-control-deck--joystick {
    left: 8px;
    bottom: 10px;
    width: min(48vw, 192px);
    height: min(40vw, 164px);
  }

  .tetris-app__mobile-control-deck--actions {
    right: 8px;
    bottom: 66px;
    width: min(41vw, 164px);
    height: min(43vw, 180px);
  }

  .tetris-app__mobile-action--rotate {
    width: 62px;
    min-width: 62px;
    height: 62px;
  }

  .tetris-app__mobile-action--drop {
    width: 74px;
    min-width: 74px;
    height: 74px;
  }

  .tetris-app__mobile-action--hard-drop {
    width: 82px;
    min-width: 82px;
    height: 82px;
  }
}

@media (max-width: 420px) {
  .tetris-app__topbar-side {
    padding-right: 128px;
    min-height: 68px;
  }

  .tetris-app__info-cards {
    grid-template-columns: 78px minmax(0, 1fr);
    display: grid;
    gap: 4px;
    max-width: 100%;
  }

  .tetris-app__stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-height: 60px;
  }

  .tetris-app__touch-layer {
    inset: 0;
  }

  .tetris-app__joystick-touch-zone {
    inset: 74px 160px 10px 0;
  }

  .tetris-app__next-preview {
    min-width: 84px;
    padding: 6px 7px 7px;
  }

  .tetris-app__next-grid {
    width: 48px;
  }

  .tetris-app__panel-label,
  .tetris-app__stat span {
    font-size: 9px;
  }

  .tetris-app__stat {
    padding: 6px 7px;
  }

  .tetris-app__stat strong {
    font-size: 12px;
  }

  .tetris-app__utility-action.ant-btn,
  .tetris-app__audio-cta.ant-btn {
    width: 32px;
    min-width: 32px;
    height: 32px;
  }

  .tetris-app__utility-action.ant-btn .ant-btn-icon,
  .tetris-app__audio-cta.ant-btn .ant-btn-icon {
    font-size: 16px;
  }

  .tetris-app__overlay {
    inset: 10px 10px auto 10px;
  }

  .tetris-app__joystick-wrap {
    width: 118px;
    height: 118px;
  }

  .tetris-app__joystick-pad {
    width: 112px;
    height: 112px;
  }

  .tetris-app__joystick {
    --joystick-size: 96px;
  }

  .tetris-app__mobile-main-buttons {
    right: 10px;
    bottom: 64px;
    grid-template-columns: repeat(2, minmax(0, 64px));
    grid-template-rows: repeat(2, 64px);
    gap: 8px;
  }

  .tetris-app__mobile-action.ant-btn {
    width: 64px;
    min-width: 64px;
    height: 64px;
  }

  .tetris-app__mobile-control-deck--joystick {
    left: 6px;
    bottom: 8px;
    width: min(50vw, 170px);
    height: min(42vw, 142px);
    border-radius: 34px 44px 26px 22px;
  }

  .tetris-app__mobile-control-deck--actions {
    right: 8px;
    bottom: 56px;
    width: min(40vw, 146px);
    height: min(42vw, 156px);
    border-radius: 34px 34px 22px 22px;
  }

  .tetris-app__mobile-action--rotate {
    width: 54px;
    min-width: 54px;
    height: 54px;
  }

  .tetris-app__mobile-action--drop {
    width: 64px;
    min-width: 64px;
    height: 64px;
  }

  .tetris-app__mobile-action--hard-drop {
    width: 72px;
    min-width: 72px;
    height: 72px;
  }
}
