* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top, rgba(160, 160, 180, 0.18), transparent 34%),
    linear-gradient(135deg, #050505 0%, #111116 48%, #050505 100%);
  color: #f2f2f2;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  touch-action: manipulation;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  user-select: none;
  -webkit-user-select: none;
}

.app {
  width: min(430px, 100%);
  background: rgba(18, 18, 22, 0.92);
  border: 1px solid rgba(210, 210, 220, 0.18);
  border-radius: 24px;
  padding: 26px 18px 22px;
  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.header {
  text-align: center;
  margin-bottom: 28px;
}

.title {
  margin: 0 0 10px;
  font-size: clamp(24px, 7vw, 32px);
  line-height: 1.25;
  letter-spacing: 0.04em;
  font-weight: 800;
  color: #f7f7f7;
  text-shadow: 0 0 18px rgba(230, 230, 240, 0.18);
}

.meta {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
  color: #aaaab5;
  letter-spacing: 0.03em;
}

.top-area {
  margin-bottom: 28px;
  text-align: center;
}

.circle-row {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.circle {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(225, 225, 235, 0.9);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.02);
  box-shadow:
    inset 0 0 8px rgba(255, 255, 255, 0.08),
    0 0 10px rgba(255, 255, 255, 0.08);
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    opacity 0.18s ease,
    box-shadow 0.18s ease;
}

.circle.is-used {
  border-color: rgba(120, 120, 128, 0.55);
  background: rgba(115, 115, 125, 0.72);
  box-shadow: none;
  opacity: 0.72;
}

.bottom-area {
  text-align: center;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

button {
  border: 1px solid rgba(230, 230, 240, 0.14);
  border-radius: 16px;
  padding: 16px 6px;
  font-size: 22px;
  font-weight: 800;
  background:
    linear-gradient(180deg, rgba(245, 245, 250, 0.12), rgba(245, 245, 250, 0.045));
  color: #f0f0f3;
  cursor: pointer;
  transition:
    transform 0.06s ease,
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease,
    opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 18px rgba(0, 0, 0, 0.25);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

button:active {
  transform: scale(0.96);
  background:
    linear-gradient(180deg, rgba(245, 245, 250, 0.18), rgba(245, 245, 250, 0.07));
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
}

.number-key {
  height: 62px;
  font-size: 0;
  color: transparent;
}

.number-key.is-lit {
  background:
    radial-gradient(circle at 32% 22%, #ffffff 0%, #f4f4f4 18%, #cfcfd4 45%, #8c8c94 100%);
  color: transparent;
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.22),
    0 0 18px rgba(235, 235, 245, 0.82),
    0 0 34px rgba(180, 180, 195, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  opacity: 1;
}

.zero-btn {
  grid-column: 2 / 3;
}

.control-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.clear-btn {
  background:
    linear-gradient(180deg, rgba(150, 150, 160, 0.18), rgba(95, 95, 105, 0.12));
  color: #d9d9df;
}

.enter-btn {
  background:
    linear-gradient(180deg, rgba(235, 235, 245, 0.24), rgba(150, 150, 165, 0.14));
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow:
    0 0 18px rgba(210, 210, 225, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.enter-btn:active {
  background:
    linear-gradient(180deg, rgba(245, 245, 255, 0.32), rgba(170, 170, 185, 0.18));
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
  z-index: 100;
}

.modal-overlay.is-open {
  display: flex;
}

.modal {
  position: relative;
  width: min(360px, 100%);
  padding: 34px 22px 26px;
  border-radius: 22px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.16), transparent 38%),
    linear-gradient(145deg, #1c1c22, #0d0d11);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow:
    0 0 36px rgba(225, 225, 240, 0.18),
    0 22px 58px rgba(0, 0, 0, 0.68),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  text-align: center;
  animation: modalPop 0.22s ease-out;
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  background: rgba(255, 255, 255, 0.08);
  color: #f2f2f2;
  box-shadow: none;
}

.modal-clear {
  margin: 0 0 12px;
  font-size: 42px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #ffffff;
  text-shadow:
    0 0 14px rgba(255, 255, 255, 0.55),
    0 0 32px rgba(200, 200, 220, 0.32);
}

.modal-title {
  margin: 0 0 22px;
  font-size: 18px;
  line-height: 1.5;
  font-weight: 700;
  color: #dcdce4;
}

.post-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  padding: 14px 20px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 18px;
  font-weight: 900;
  color: #111116;
  background:
    radial-gradient(circle at 30% 20%, #ffffff 0%, #f0f0f4 28%, #c7c7d0 100%);
  box-shadow:
    0 0 20px rgba(235, 235, 245, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition:
    transform 0.08s ease,
    box-shadow 0.15s ease;
}

.post-button:active {
  transform: scale(0.96);
}