:root {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #0b0b0b;
  color: #fff;
}

.wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px;
  gap: 14px;
}

/* Header */
.top {
  text-align: center;
}

h1 {
  margin: 6px 0 2px;
  font-size: clamp(20px, 3vw, 42px);
}

.sub {
  margin: 0 0 8px;
  opacity: 0.85;
  font-size: clamp(13px, 2vw, 18px);
}

.status {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: #1c1c1c;
  font-size: 14px;
  opacity: 0.9;
}

/* Main grid of buttons */
.grid {
  flex: 1;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

.btn {
  border: 0;
  border-radius: 18px;
  padding: 16px;
  background: #171717;
  color: #fff;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 86px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.btn:active {
  transform: scale(0.99);
}

.left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.emoji {
  font-size: 44px;
  width: 54px;
  text-align: center;
}

.label {
  font-size: clamp(18px, 2.4vw, 34px);
  font-weight: 800;
  line-height: 1.1;
}

.small {
  font-size: 14px;
  opacity: 0.75;
  margin-top: 4px;
}

.chev {
  opacity: 0.35;
  font-size: 28px;
  padding-left: 10px;
}

/* Footer */
.foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  opacity: 0.75;
  flex-wrap: wrap;
}

/* Modal for optional comments */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 999;
}

.modal-card {
  width: min(720px, 94vw);
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 22px;
  padding: 18px;
}

.modal-title {
  font-size: clamp(20px, 2.6vw, 34px);
  font-weight: 900;
  margin-bottom: 6px;
}

.modal-sub {
  opacity: 0.8;
  margin-bottom: 12px;
}

.comment {
  width: 100%;
  border-radius: 14px;
  border: 1px solid #2a2a2a;
  background: #0b0b0b;
  color: #fff;
  padding: 14px;
  font-size: 18px;
  resize: none;
  outline: none;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.action {
  border: 0;
  border-radius: 16px;
  padding: 16px;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
}

.primary {
  background: #2b7cff;
  color: #fff;
}

.secondary {
  background: #1c1c1c;
  color: #fff;
}

.modal-timer {
  margin-top: 10px;
  opacity: 0.7;
  font-size: 14px;
  text-align: right;
}

/* ---------- RESPONSIVE TUNING ---------- */

/* Small screens (phones / 7" tablets portrait) */
@media (max-width: 480px) {
  .wrap {
    padding: 12px;
    gap: 10px;
  }

  .grid {
    gap: 8px;
  }

  .btn {
    min-height: 64px;
    padding: 12px;
    border-radius: 16px;
  }

  .emoji {
    font-size: 32px;
    width: 40px;
  }

  .label {
    font-size: 18px;
  }

  .small {
    display: none;
  }

  .chev {
    font-size: 22px;
  }

  .action {
    font-size: 18px;
    padding: 12px;
  }

  .comment {
    font-size: 16px;
  }
}

/* Medium tablets */
@media (min-width: 481px) and (max-width: 899px) {
  .btn {
    min-height: 78px;
  }
}

/* Large tablets / landscape */
@media (min-width: 900px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }

  .btn {
    min-height: 110px;
  }

  .emoji {
    font-size: 52px;
    width: 60px;
  }
}

/* Short height screens: keep modal usable without overflowing */
@media (max-height: 600px) {
  .modal-card {
    max-height: 90vh;
    overflow-y: auto;
  }

  .comment {
    font-size: 16px;
  }

  .action {
    font-size: 18px;
    padding: 12px;
  }
}

/* Force hidden overlays to truly be hidden (prevents click blocking) */
.modal[hidden],
.thanks[hidden] {
  display: none !important;
}
/* ---------- THANK YOU OVERLAY ---------- */
.thanks {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: grid;
  place-items: center;
  z-index: 9999;
}

.thanks-card {
  background: #111;
  border-radius: 22px;
  padding: 28px 34px;
  text-align: center;
}

.thanks-emoji {
  font-size: 64px;
  margin-bottom: 10px;
}

.thanks-text {
  font-size: 42px;
  font-weight: 900;
}

/* Ensure hidden overlays do not take up space */
.thanks[hidden] {
  display: none !important;
}