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

:root {
  --bg: #1a120b;
  --parchment: #f3e5c8;
  --parchment-dark: #e2cfa5;
  --ink: #2c1f12;
  --gold: #d4a437;
  --gold-bright: #f0c454;
  --red: #8e2323;
  --green: #3e7a3e;
  --card: #241a10;
  --card-edge: #4a3620;
}

body {
  font-family: Georgia, 'Times New Roman', serif;
  background: var(--bg);
  background-image: radial-gradient(ellipse at top, #2c2013 0%, #1a120b 70%);
  color: var(--parchment);
  min-height: 100vh;
}

.screen { display: none; min-height: 100vh; padding: 16px; max-width: 760px; margin: 0 auto; }
.screen.active { display: block; }

/* ---- Seçim ekranı ---- */
.game-title {
  text-align: center; color: var(--gold-bright); font-size: 42px; margin-top: 32px;
  text-shadow: 0 3px 0 #6b4a10, 0 6px 18px rgba(0,0,0,.6); letter-spacing: 3px;
}
.game-subtitle { text-align: center; color: var(--parchment-dark); font-style: italic; font-size: 18px; margin-bottom: 22px; }
.intro-text { text-align: center; max-width: 560px; margin: 0 auto 26px; line-height: 1.6; color: var(--parchment); }
.hint-text { text-align: center; max-width: 520px; margin: 22px auto 0; font-size: 14px; color: var(--parchment-dark); line-height: 1.5; }

.empire-cards { display: flex; flex-direction: column; gap: 14px; }
.empire-card {
  background: linear-gradient(160deg, var(--card) 0%, #1c1309 100%);
  border: 2px solid var(--card-edge); border-radius: 12px; padding: 18px;
  cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .15s;
  display: flex; align-items: center; gap: 16px; text-align: left;
}
.empire-card:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.empire-flag { font-size: 44px; }
.empire-info h3 { color: var(--gold-bright); font-size: 20px; margin-bottom: 4px; }
.empire-info .empire-span { color: var(--parchment-dark); font-size: 13px; margin-bottom: 6px; display: block; }
.empire-info p { font-size: 14px; line-height: 1.45; color: var(--parchment); }
.empire-meta { margin-top: 6px; font-size: 12px; color: var(--gold); }

/* ---- Hükümdar geçişi ---- */
.ruler-card {
  max-width: 480px; margin: 10vh auto 0; text-align: center;
  background: linear-gradient(160deg, var(--card) 0%, #1c1309 100%);
  border: 2px solid var(--gold); border-radius: 16px; padding: 34px 26px;
  box-shadow: 0 12px 40px rgba(0,0,0,.6);
  animation: rise .5s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.ruler-icon { font-size: 64px; margin-bottom: 8px; }
.ruler-label { color: var(--gold); font-size: 13px; letter-spacing: 3px; text-transform: uppercase; margin-bottom: 8px; }
.ruler-card h2 { color: var(--gold-bright); font-size: 28px; margin-bottom: 4px; }
.ruler-years { color: var(--parchment-dark); font-style: italic; margin-bottom: 14px; }
.ruler-card p { line-height: 1.55; margin-bottom: 22px; font-size: 15px; }

/* ---- Butonlar ---- */
.btn {
  font-family: inherit; font-size: 16px; padding: 12px 28px; border-radius: 10px;
  border: 2px solid var(--gold); background: linear-gradient(180deg, #b8892b, #8a6218);
  color: #fff8e6; cursor: pointer; font-weight: bold; letter-spacing: .5px;
  transition: transform .12s, filter .12s;
}
.btn:hover { transform: scale(1.04); filter: brightness(1.15); }

/* ---- Oyun HUD ---- */
.topbar { background: rgba(0,0,0,.35); border: 1px solid var(--card-edge); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; }
.topbar-row { display: flex; justify-content: space-between; align-items: center; }
.hud-empire { color: var(--gold-bright); font-weight: bold; font-size: 15px; }
.hud-score { color: var(--gold); font-weight: bold; }
.hud-ruler { font-size: 13px; color: var(--parchment-dark); }
.hud-year { font-size: 15px; color: var(--parchment); font-weight: bold; }
.timeline { height: 7px; background: #0d0905; border-radius: 4px; margin-top: 8px; overflow: hidden; border: 1px solid var(--card-edge); }
.timeline-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); transition: width .6s ease; }

/* ---- Statlar ---- */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; background: rgba(0,0,0,.35); border: 1px solid var(--card-edge); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; }
.stat { display: flex; align-items: center; gap: 8px; }
.stat-label { font-size: 12px; width: 74px; flex-shrink: 0; }
.stat-val { font-size: 11px; color: var(--parchment-dark); width: 26px; text-align: right; }
.bar { flex: 1; height: 10px; background: #0d0905; border-radius: 5px; overflow: hidden; border: 1px solid var(--card-edge); }
.bar-fill { height: 100%; transition: width .5s ease, background-color .5s; border-radius: 5px; }
.bar-fill.ordu { background: #b03a3a; }
.bar-fill.hazine { background: #c9a227; }
.bar-fill.halk { background: #4e8f4e; }
.bar-fill.otorite { background: #7a5cc0; }
.bar-fill.low { animation: pulse 1s infinite alternate; }
@keyframes pulse { from { opacity: .55; } to { opacity: 1; } }

/* ---- Piksel sahneler ---- */
.scene-wrap {
  border: 2px solid #b09355; border-radius: 14px; overflow: hidden;
  margin-bottom: 12px; line-height: 0; background: #241a10;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
#scene-canvas { width: 100%; display: block; image-rendering: pixelated; }
.ruler-scene { line-height: 0; margin-bottom: 10px; }
#ruler-canvas {
  width: 190px; max-width: 80%; image-rendering: pixelated;
  border: 2px solid var(--card-edge); border-radius: 10px; background: #1c1309;
}
.ruler-icon { display: none; }

/* ---- Olay kartı ---- */
.event-card, .outcome-card {
  background: linear-gradient(170deg, var(--parchment) 0%, var(--parchment-dark) 100%);
  color: var(--ink); border-radius: 14px; padding: 20px 22px;
  border: 2px solid #b09355; box-shadow: 0 10px 30px rgba(0,0,0,.55);
  animation: rise .4s ease-out;
}
.event-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.event-year { background: var(--red); color: #ffe9c9; font-weight: bold; padding: 4px 12px; border-radius: 20px; font-size: 14px; }
.event-tag { font-size: 12px; color: #7a5c2e; font-style: italic; }
.event-card h3 { font-size: 21px; margin-bottom: 8px; color: #4a2c0f; }
.event-card p { line-height: 1.6; font-size: 15px; margin-bottom: 16px; }

.choices { display: flex; flex-direction: column; gap: 10px; }
.choice-btn {
  font-family: inherit; text-align: left; font-size: 14.5px; line-height: 1.45;
  padding: 12px 14px; border-radius: 10px; cursor: pointer;
  background: #fff9ec; border: 2px solid #c8ab72; color: var(--ink);
  transition: transform .12s, border-color .12s, background .12s;
}
.choice-btn:hover { transform: translateX(4px); border-color: var(--red); background: #fff3d9; }

/* ---- Sonuç kartı ---- */
.outcome-card { margin-top: 12px; }
.outcome-card.hidden { display: none; }
.outcome-verdict { font-size: 18px; font-weight: bold; margin-bottom: 8px; }
.outcome-verdict.good { color: var(--green); }
.outcome-verdict.bad { color: var(--red); }
.outcome-card p { line-height: 1.6; font-size: 15px; margin-bottom: 12px; }
.outcome-effects { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.effect-chip { font-size: 13px; font-weight: bold; padding: 4px 10px; border-radius: 14px; background: #fff9ec; border: 1px solid #c8ab72; }
.effect-chip.plus { color: var(--green); }
.effect-chip.minus { color: var(--red); }

/* ---- Son ekranı ---- */
.end-card {
  max-width: 520px; margin: 6vh auto 0; text-align: center;
  background: linear-gradient(160deg, var(--card) 0%, #1c1309 100%);
  border: 2px solid var(--gold); border-radius: 16px; padding: 30px 26px;
  animation: rise .5s ease-out;
}
.end-icon { font-size: 60px; margin-bottom: 10px; }
.end-card h2 { color: var(--gold-bright); font-size: 26px; margin-bottom: 10px; }
.end-card > .end-card p { line-height: 1.55; }
#end-text { line-height: 1.6; margin-bottom: 18px; font-size: 15px; }
.end-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.end-stat { background: rgba(0,0,0,.35); border: 1px solid var(--card-edge); border-radius: 10px; padding: 10px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.end-stat b { color: var(--gold-bright); font-size: 18px; }
.end-rank { font-size: 20px; color: var(--gold-bright); font-weight: bold; margin-bottom: 8px; }
.end-best { font-size: 13px; color: var(--parchment-dark); margin-bottom: 18px; }

@media (max-width: 520px) {
  .game-title { font-size: 30px; }
  .stats { grid-template-columns: 1fr; }
  .stat-label { width: 68px; }
}
