:root {
  --bg: #0f1220;
  --card: #1a1f36;
  --card-hover: #232a4a;
  --accent: #f5b53f;
  --accent-dark: #d99a1f;
  --text: #eef0f7;
  --muted: #8b91ad;
  --danger: #ff6b6b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans Georgian", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ---------- Topbar ---------- */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: var(--card);
}

.logo {
  margin: 0;
  font-size: 1.5rem;
}

.wallet-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#balance {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
  background: rgb(245 181 63 / 0.1);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
}

/* ---------- Buttons ---------- */

button {
  font-family: inherit;
  font-size: 0.95rem;
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

button.primary {
  background: var(--accent);
  color: #1a1405;
  font-weight: 600;
}

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

button.primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button.ghost,
a.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--muted);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  text-decoration: none;
  font-size: 0.9rem;
}

button.ghost:hover,
a.ghost:hover {
  color: var(--text);
  border-color: var(--text);
}

button.big {
  font-size: 1.15rem;
  padding: 0.8rem 2rem;
}

/* ---------- Auth page ---------- */

.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 1rem;
}

.auth-card {
  background: var(--card);
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 12px 40px rgb(0 0 0 / 0.4);
}

.auth-card .logo {
  text-align: center;
  margin-bottom: 1.5rem;
}

.lang-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
}

.lang-row select {
  font-size: 0.85rem;
  padding: 0.3rem 0.5rem;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.tab {
  flex: 1;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--muted);
}

.tab.active {
  background: var(--accent);
  color: #1a1405;
  border-color: var(--accent);
  font-weight: 600;
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--muted);
}

input,
select {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #333a5c;
  background: var(--bg);
  color: var(--text);
}

input:focus,
select:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
}

.error {
  background: rgb(255 107 107 / 0.12);
  color: var(--danger);
  border-radius: 8px;
  padding: 0.7rem 1rem;
  margin: 0 0 1rem;
  font-size: 0.9rem;
  white-space: pre-wrap;
}

main {
  padding: 0 2rem 2rem;
}

main h2 {
  padding-top: 1.5rem;
}

/* ---------- Games grid ---------- */

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  padding: 1rem 0 2rem;
}

.game-card {
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgb(0 0 0 / 0.4);
  background: var(--card-hover);
}

.game-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}

.game-card h3 {
  margin: 0.75rem 1rem 0.25rem;
  font-size: 1rem;
}

.game-card .category {
  display: inline-block;
  margin: 0 1rem 0.9rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.empty {
  color: var(--muted);
}

/* ---------- Deposit modal ---------- */

dialog {
  background: var(--card);
  color: var(--text);
  border: none;
  border-radius: 16px;
  padding: 1.75rem;
  min-width: 320px;
}

dialog::backdrop {
  background: rgb(0 0 0 / 0.6);
}

dialog h3 {
  margin-top: 0;
}

dialog input {
  width: 100%;
  margin-bottom: 1rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

.modal-label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.modal-label select {
  width: 100%;
}

/* ---------- Game page ---------- */

.game-page {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-frame {
  background: var(--card);
  border-radius: 16px;
  padding: 2.5rem 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.slot {
  display: flex;
  gap: 1rem;
}

.reel {
  font-size: 4rem;
  background: var(--bg);
  border-radius: 12px;
  width: 6rem;
  height: 6rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spin-result {
  min-height: 1.5rem;
  margin: 0;
  font-weight: 600;
  color: var(--accent);
}

.demo-note {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0;
}

.back-link {
  white-space: nowrap;
}

/* ---------- Game iframe overlay ---------- */

.game-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.game-overlay[hidden] {
  display: none;
}

.overlay-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1.25rem;
  background: var(--card);
}

.overlay-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent);
}

#game-frame {
  flex: 1;
  width: 100%;
  border: 0;
  background: var(--bg);
}
