/* --- Переменные --- */
:root {
  --bg-page: #e8eae6;
  --bg-main: #fff;
  --bg-header: #1a2f1a;
  --accent: #2d5a27;
  --accent-hover: #3d7a35;
  --text: #1a1a1a;
  --text-muted: #555;
  --border: #ccc;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-strong: 0 4px 20px rgba(0, 0, 0, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --success: #0d6b0d;
  --error: #b91c1c;
  --font: 'Segoe UI', system-ui, sans-serif;
}

/* --- Базовые стили --- */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--font);
  font-size: 1rem;
  background: var(--bg-page);
  color: var(--text);
  margin: 0;
  padding: 0;
  line-height: 1.5;
  min-height: 100vh;
}

/* --- Шапка --- */
header {
  background: var(--bg-header);
  color: #fff;
  padding: 14px 24px;
  box-shadow: var(--shadow-strong);
}

nav {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

nav a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-weight: 500;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  cursor: pointer;
}

nav a:hover {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.5);
}

/* --- Основной контент --- */
main {
  max-width: 900px;
  margin: 32px auto;
  padding: 0 20px 40px;
}

.main-card {
  background: var(--bg-main);
  border-radius: var(--radius);
  padding: 32px 36px;
  box-shadow: var(--shadow);
  font-size: 1rem;
}

main h2 {
  margin: 0 0 24px;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
}

/* --- Мобильная версия --- */
@media (max-width: 600px) {
  body {
    font-size: 18px;
  }

  main {
    margin: 8px auto;
    padding: 0 8px 24px;
  }

  .main-card {
    padding: 16px 10px;
    font-size: 18px;
  }

  main h2 {
    font-size: 1.4rem;
    margin-bottom: 16px;
  }

  .combo-form select {
    font-size: 18px;
    min-width: 100%;
    max-width: 100%;
  }

  .message {
    font-size: 1rem;
  }

  .page-links a {
    font-size: 1rem;
  }

  .combo-buttons {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .btn-combo {
    font-size: 0.9rem;
    padding: 10px 8px;
  }
}

/* --- Карты (рука) --- */
.hand {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-start;
}

.card-img {
  flex: 0 0 auto;
  width: 72px;
  height: auto;
  aspect-ratio: 75 / 110;
  object-fit: contain;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 1px 3px 8px rgba(0, 0, 0, 0.12);
  transition: transform 0.15s ease;
}

.card-img:hover {
  transform: translateY(-2px);
  box-shadow: 2px 6px 12px rgba(0, 0, 0, 0.15);
}

/* 5 карт в ряд на мобильном без прокрутки */
@media (max-width: 600px) {
  .hand {
    gap: 4px;
    justify-content: space-between;
    margin-bottom: 20px;
  }

  .card-img {
    width: calc((100% - 16px) / 5);
  }
}

/* --- Форма (комбо) --- */
.combo-form {
  margin-top: 8px;
}

.combo-form select {
  font-family: var(--font);
  font-size: 1.05rem;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-main);
  color: var(--text);
  min-width: 220px;
  cursor: pointer;
}

.combo-form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 90, 39, 0.15);
}

.combo-form select:disabled {
  opacity: 0.8;
  cursor: default;
}

.combo-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 4px;
}

.btn-combo {
  font-size: 0.95rem;
  padding: 10px 12px;
  background: var(--bg-main);
  color: var(--text);
  border: 1px solid var(--border);
  text-align: center;
}

.btn-combo:hover {
  background: rgba(45, 90, 39, 0.08);
  border-color: var(--accent);
  color: var(--accent);
}

.form-actions {
  margin: 18px 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* --- Кнопки --- */
.btn {
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 500;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

/* --- Сообщение (результат проверки) --- */
.message {
  margin: 18px 0;
  font-size: 1.05rem;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.message.success {
  color: var(--success);
  background: rgba(13, 107, 13, 0.08);
  border: 1px solid rgba(13, 107, 13, 0.25);
}

.message.error {
  color: var(--error);
  background: rgba(185, 28, 28, 0.08);
  border: 1px solid rgba(185, 28, 28, 0.25);
}

/* --- Страница индекса покера --- */
.page-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.page-links a {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  padding: 12px 18px;
  background: rgba(45, 90, 39, 0.08);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(45, 90, 39, 0.2);
  transition: background 0.2s, border-color 0.2s;
  cursor: pointer;
}

.page-links a:hover {
  background: rgba(45, 90, 39, 0.14);
  border-color: var(--accent);
}

/* --- AR заставка --- */
.ar-splash {
  text-align: center;
  padding: 48px 24px 56px;
  margin: -32px -36px 32px -36px;
  background: linear-gradient(160deg, rgba(45, 90, 39, 0.12) 0%, rgba(45, 90, 39, 0.04) 100%);
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 1px solid var(--border);
}

.ar-splash__title {
  margin: 0 0 8px;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.05em;
}

.ar-splash__tagline {
  margin: 0 0 24px;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.ar-splash__btn {
  display: inline-block;
  text-decoration: none;
}

.ar-content {
  padding-top: 0;
}

/* --- AR canvas --- */
.ar-canvas-wrap {
  margin: 16px 0 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: #1a1a1a;
  overflow: hidden;
  width: 100%;
  height: 66vh;
  min-height: 200px;
  max-height: 560px;
}

.ar-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.ar-canvas-hint {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

@media (max-width: 600px) {
  .ar-splash {
    margin: -20px -10px 20px -10px;
    padding: 32px 16px 40px;
  }

  .ar-splash__title {
    font-size: 2rem;
  }
}
