:root {
  --bg: #0f3d2e;
  --bg2: #124a37;
  --card: #ffffff;
  --card-alt: #f3f6f4;
  --gold: #d4a017;
  --gold-dark: #b3860f;
  --text: #1c1c1c;
  --muted: #6b7a75;
  --danger: #c0392b;
  --okey: #2980b9;
  --normal: #27ae60;
  --kafadan: #8e44ad;
  --ceza: #c0392b;
  --radius: 14px;
  --shadow: 0 4px 14px rgba(0,0,0,.18);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
  background: url('../images/724288.jpg') center center / cover no-repeat fixed,
              linear-gradient(160deg, var(--bg), var(--bg2));
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
}

#app { min-height: 100vh; display: flex; flex-direction: column; }

.screen {
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
  padding: 20px 16px 30px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

h1 {
  color: #fff;
  text-align: center;
  font-size: 1.7rem;
  margin: 10px 0 26px;
  letter-spacing: .5px;
}

h2 {
  color: #fff;
  font-size: 1.15rem;
  margin: 0;
  flex: 1;
  text-align: center;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 18px;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10px;
}

.btn {
  border: none;
  border-radius: var(--radius);
  padding: 16px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  background: radial-gradient(circle,rgba(199, 72, 72, 1) 0%, rgba(163, 10, 33, 1) 50%, rgba(176, 79, 79, 1) 100%);
  color: #fff;
  box-shadow: var(--shadow);
  transition: transform .08s ease;
}
.btn:active { transform: scale(.97); }

.btn.big {
  padding: 20px;
  font-size: 1.05rem;
  text-align: center;
  line-height: 1.4;
}
.btn.big small { color: #fff; font-weight: 400; font-size: .78rem; }

.btn.primary {
  background: radial-gradient(circle,rgba(53, 110, 38, 1) 0%, rgba(10, 163, 74, 1) 50%, rgba(31, 77, 30, 1) 100%);
  color: #fff;
}

.btn.back {
  background: rgba(255,255,255,.12);
  color: #fff;
  padding: 10px 14px;
  font-size: .9rem;
  box-shadow: none;
}

.btn.small {
  padding: 8px 12px;
  font-size: .85rem;
}

.btn.danger {
  background: var(--danger);
  color: #fff;
  box-shadow: none;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--card);
  padding: 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: .85rem;
  color: var(--muted);
  font-weight: 600;
}

.form input {
  border: 1.5px solid #dfe6e2;
  border-radius: 10px;
  padding: 12px;
  font-size: 1rem;
  color: var(--text);
  background: var(--card-alt);
}
.form input:focus {
  outline: none;
  border-color: var(--gold);
}

/* ---- Oyun tahtası ---- */
.game-screen { padding-bottom: 140px; }

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--card);
}

.score-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}

.score-table th, .score-table td {
  padding: 8px 6px;
  text-align: center;
  border-bottom: 1px solid #eef1ef;
  min-width: 78px;
}

.score-table thead th {
  background: var(--bg);
  color: #fff;
  font-size: .82rem;
  position: sticky;
  top: 0;
}

.score-table .round-no {
  font-weight: 700;
  color: var(--muted);
  min-width: 34px;
}

.score-input {
  width: 100%;
  border: 1.5px solid #dfe6e2;
  border-radius: 8px;
  padding: 8px 4px;
  text-align: center;
  font-size: .95rem;
  background: var(--card-alt);
}
.score-input:focus, .score-input.active {
  outline: none;
  border-color: var(--gold);
  background: #fff8e6;
}

.total-row td {
  font-weight: 800;
  background: var(--card-alt);
  font-size: 1rem;
  border-top: 2px solid var(--gold);
}

.hint {
  text-align: center;
  color: #dfe9e4;
  font-size: .8rem;
  margin: 12px 0 4px;
}

.toolbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  background: #0b2e22;
  box-shadow: 0 -4px 14px rgba(0,0,0,.3);
}

.qbtn {
  border: none;
  border-radius: 10px;
  padding: 10px 4px;
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
}
.qbtn span { display: block; font-size: .78rem; font-weight: 800; margin-top: 2px; }
.qbtn.okey { background: var(--okey); }
.qbtn.normal { background: var(--normal); }
.qbtn.kafadan { background: var(--kafadan); }
.qbtn.ceza { background: var(--ceza); }
.qbtn:active { transform: scale(.95); }

/* ---- Eski oyunlar ---- */
.list { display: flex; flex-direction: column; gap: 12px; }

.game-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px;
}

.game-info {
  flex: 1;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}
.game-info strong { font-size: .98rem; }
.game-info span { font-size: .8rem; color: var(--muted); }
.game-info small { font-size: .72rem; color: #9aa8a3; }

.empty {
  color: #dfe9e4;
  text-align: center;
  margin-top: 40px;
}

@media (max-width: 380px) {
  .qbtn { font-size: .65rem; padding: 8px 2px; }
}
