* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 30%, #2a1a5e 0%, #120a2b 70%);
  font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  color: #fff;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#game {
  position: fixed;
  inset: 0;
  display: block;
  touch-action: none;
}

#hud {
  position: fixed;
  top: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  z-index: 5;
}

.pill {
  background: rgba(10, 6, 30, 0.75);
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 6px 18px;
  font-size: 20px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.pill span {
  color: #ffd84d;
  font-weight: 900;
}

#timePill.warn span {
  color: #ff4d6a;
}

#timePill.warn {
  border-color: #ff4d6a;
  animation: pulse 0.6s ease-in-out infinite alternate;
}

@keyframes pulse {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

.icon-btn {
  pointer-events: auto;
  cursor: pointer;
  color: #fff;
  font-family: inherit;
  padding: 6px 12px;
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 4, 24, 0.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 10;
  padding: 16px;
}

.overlay.hidden,
.hidden {
  display: none !important;
}

.card {
  background: linear-gradient(160deg, #2d1f6b 0%, #1a1240 100%);
  border: 3px solid #ffcc00;
  border-radius: 24px;
  padding: 26px 28px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 0 6px rgba(232, 38, 63, 0.35);
  max-height: 100%;
  overflow-y: auto;
}

.emoji {
  font-size: 40px;
  margin-bottom: 4px;
}

h1, h2 {
  font-weight: 900;
  color: #ffd84d;
  text-shadow: 0 3px 0 #e8263f;
  margin-bottom: 8px;
}

h1 { font-size: 38px; }
h2 { font-size: 32px; }

.lead {
  font-size: 18px;
  margin-bottom: 12px;
  opacity: 0.95;
}

.howto {
  list-style: none;
  text-align: right;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 15px;
  line-height: 1.8;
}

.howto b {
  color: #7fd4ff;
}

.big-btn {
  font-family: inherit;
  font-size: 22px;
  font-weight: 900;
  color: #1a1240;
  background: linear-gradient(180deg, #ffe066 0%, #ffb300 100%);
  border: none;
  border-radius: 16px;
  padding: 12px 36px;
  cursor: pointer;
  box-shadow: 0 5px 0 #b37800, 0 8px 18px rgba(0, 0, 0, 0.4);
  transition: transform 0.08s;
}

.big-btn:hover {
  transform: translateY(-2px);
}

.big-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #b37800;
}

.hint {
  margin-top: 10px;
  font-size: 13px;
  opacity: 0.6;
}

.final {
  font-size: 72px;
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
  text-shadow: 0 4px 0 #e8263f;
}

.rating {
  font-size: 20px;
  font-weight: 700;
  color: #7fd4ff;
  margin: 6px 0 10px;
}

.best-line {
  font-size: 17px;
  margin-bottom: 8px;
}

.best-line span {
  color: #ffd84d;
  font-weight: 900;
}

.new-best {
  font-size: 18px;
  font-weight: 900;
  color: #5ce68a;
  margin-bottom: 12px;
}

@media (max-width: 480px) {
  h1 { font-size: 30px; }
  .pill { font-size: 16px; padding: 5px 12px; }
  .card { padding: 20px 18px; }
  .howto { font-size: 14px; }
}
/* PureQ English layout */
html[dir=ltr] .howto{text-align:left}
html[dir=ltr] .howto li{padding-left:0;padding-right:0}
