* {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --page-bg: #f4f7fb;
  --surface: #ffffff;
  --text: #1f2933;
  --muted: #5f6f82;
  --ball-bg: #ffffff;
  --ball-border: #c9d4e2;
  --button-bg: #2f855a;
  --button-hover: #276749;
  --button-text: #ffffff;
  --toggle-bg: #e3eaf3;
  --toggle-text: #1f2933;
  --input-bg: #ffffff;
  --input-border: #b7c4d4;
  --input-focus: #2f855a;
  --divider: #d9e2ec;
  --shadow: 0 18px 45px rgba(27, 39, 53, 0.12);
}

body.dark-mode {
  color-scheme: dark;
  --page-bg: #111827;
  --surface: #1f2937;
  --text: #f8fafc;
  --muted: #cbd5e1;
  --ball-bg: #273449;
  --ball-border: #53627a;
  --button-bg: #38a169;
  --button-hover: #48bb78;
  --button-text: #07140d;
  --toggle-bg: #334155;
  --toggle-text: #f8fafc;
  --input-bg: #111827;
  --input-border: #53627a;
  --input-focus: #48bb78;
  --divider: #334155;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
}

body {
  font-family: sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  padding: 24px;
  background-color: var(--page-bg);
  color: var(--text);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.app-shell {
  position: relative;
  width: min(100%, 520px);
  padding: 40px 28px 32px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

h1 {
  margin: 0 0 28px;
  color: var(--text);
  font-size: clamp(28px, 6vw, 40px);
  line-height: 1.1;
}

.lotto-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 50px;
  margin-bottom: 24px;
}

.lotto-number {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--ball-bg);
  border: 2px solid var(--ball-border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

button {
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  border: none;
  border-radius: 5px;
  background-color: var(--button-bg);
  color: var(--button-text);
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

button:hover {
  background-color: var(--button-hover);
  transform: translateY(-1px);
}

button:focus-visible {
  outline: 3px solid #f6c453;
  outline-offset: 3px;
}

.contact-section {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--divider);
  text-align: left;
}

.contact-section h2 {
  margin: 0 0 18px;
  color: var(--text);
  font-size: 24px;
  line-height: 1.2;
  text-align: center;
}

.contact-form {
  display: grid;
  gap: 10px;
}

.contact-form label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  padding: 11px 12px;
  background-color: var(--input-bg);
  color: var(--text);
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease, color 0.3s ease;
}

.contact-form textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--input-focus) 22%, transparent);
  outline: none;
}

.contact-form button {
  justify-self: stretch;
  margin-top: 8px;
}

.theme-toggle {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 8px 12px;
  background-color: var(--toggle-bg);
  color: var(--toggle-text);
  font-size: 14px;
}

.theme-toggle:hover {
  background-color: var(--toggle-bg);
}

@media (max-width: 420px) {
  .app-shell {
    padding: 64px 18px 28px;
  }

  .theme-toggle {
    right: 18px;
  }
}
