/* Tüm renkler tema değişkenlerinden gelir. Burada sabit renk yazma. */
:root {
  --bg:#1F130C; --panel:#2A1A10; --panel-2:#241810; --border:#4B3322; --border-strong:#6B4A2E;
  --text:#F3E7D0; --text-muted:#C9B79A; --accent:#D9A441; --accent-text:#2A1A0E; --accent-ink:#F0C66B;
  --btn-bg:#3A2517; --danger:#C4553C; --danger-ink:#F4A08A; --ok:#7FB77E; --ok-bg:#2F4A2E;
  --font-heading:Georgia,serif; --font-body:system-ui,sans-serif; --radius:12px;
}
* { box-sizing: border-box; }
html, body { margin:0; height:100%; background:var(--bg); color:var(--text); font-family:var(--font-body); font-size:15px; }
button { font:inherit; }
h1,h2,h3 { font-family:var(--font-heading); margin:0; }
a { color:var(--accent-ink); }
#app { min-height:100%; display:flex; flex-direction:column; }
.hidden { display:none !important; }

.btn { height:44px; padding:0 16px; border-radius:var(--radius); border:1px solid var(--border-strong); background:var(--btn-bg); color:var(--text); font-weight:700; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; gap:8px; }
.btn:hover { border-color:var(--accent); }
.btn:disabled { opacity:.45; cursor:not-allowed; }
.btn.primary { background:var(--accent); color:var(--accent-text); border-color:var(--accent); font-family:var(--font-heading); }
.btn.danger { background:transparent; color:var(--danger-ink); border-color:var(--danger); }
.btn.small { height:36px; padding:0 12px; font-size:13px; }
.btn.icon { width:44px; padding:0; }
.chip { padding:6px 12px; border-radius:999px; border:1px solid var(--border-strong); font-size:13px; font-weight:600; color:var(--text); white-space:nowrap; }
.chip.accent { border-color:var(--accent); color:var(--accent-ink); font-weight:700; }
.muted { color:var(--text-muted); }
.card { background:var(--panel); border:1px solid var(--border); border-radius:calc(var(--radius) + 4px); padding:16px; }
label.field { display:flex; flex-direction:column; gap:6px; font-weight:700; font-size:14px; margin-bottom:14px; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  height:46px; padding:0 14px; border-radius:var(--radius); border:1px solid var(--border-strong); background:var(--bg); color:var(--text); font:inherit; font-weight:400; width:100%;
}
textarea { height:auto; padding:10px 14px; font-family:ui-monospace,monospace; font-size:13px; }
input[type=checkbox] { width:22px; height:22px; accent-color:var(--accent); flex:none; margin:0; }
.check { display:flex; gap:12px; align-items:flex-start; margin-bottom:12px; line-height:1.4; cursor:pointer; }
.error { color:var(--danger-ink); font-size:14px; min-height:20px; margin:8px 0; }

.topbar { height:60px; flex:none; display:flex; align-items:center; gap:14px; padding:0 20px; background:var(--panel); border-bottom:1px solid var(--border); }
.topbar h1 { font-size:20px; }
.logo { width:36px; height:36px; border-radius:9px; background:var(--tile-bg); display:flex; align-items:center; justify-content:center; flex:none; }
.spacer { flex:1; }

/* Giriş */
.auth { flex:1; display:flex; min-height:100vh; }
.auth .brand { flex:1; padding:56px; display:flex; flex-direction:column; background-color:var(--table-bg); background-image:var(--table-texture); }
.auth .brand h2 { font-size:48px; line-height:1.1; max-width:480px; margin:auto 0 14px; }
.auth .brand p { font-size:18px; max-width:460px; line-height:1.5; margin:0 0 24px; }
.auth .brand .chips { display:flex; gap:8px; flex-wrap:wrap; }
.auth .brand .chip { background:rgba(0,0,0,.45); }
.auth .form { width:520px; flex:none; padding:56px; background:var(--panel); border-left:1px solid var(--border); display:flex; flex-direction:column; justify-content:center; }
.seg { display:flex; border-radius:var(--radius); border:1px solid var(--border-strong); overflow:hidden; margin-bottom:24px; }
.seg button { flex:1; height:46px; border:0; background:var(--btn-bg); color:var(--text-muted); font-weight:700; cursor:pointer; }
.seg button.on { background:var(--accent); color:var(--accent-text); }

/* Lobi */
.lobby { flex:1; display:flex; min-height:0; }
.lobby nav { width:216px; flex:none; padding:20px 16px; background:var(--panel-2); border-right:1px solid var(--border); display:flex; flex-direction:column; gap:6px; }
.lobby nav button { height:48px; padding:0 12px; border-radius:var(--radius); border:1px solid transparent; background:transparent; color:var(--text); font-weight:700; text-align:left; cursor:pointer; display:flex; justify-content:space-between; align-items:center; }
.lobby nav button.on { background:var(--accent); color:var(--accent-text); }
.lobby main { flex:1; min-width:0; padding:20px 24px; display:flex; flex-direction:column; gap:16px; overflow:auto; }
.lobby aside { width:300px; flex:none; padding:20px 20px 20px 0; display:flex; flex-direction:column; gap:16px; }
.tablist { background:var(--panel); border:1px solid var(--border); border-radius:calc(var(--radius) + 4px); overflow:hidden; }
.tablist .row { display:flex; align-items:center; gap:10px; min-height:56px; padding:6px 20px; border-top:1px solid var(--border); }
.tablist .row:first-child { border-top:0; }
.tablist .row .grow { flex:1; min-width:0; }
.tablist .head { font-size:12px; font-weight:700; color:var(--text-muted); }

/* Modal */
.modal-bg { position:fixed; inset:0; background:rgba(0,0,0,.65); display:flex; align-items:center; justify-content:center; z-index:50; padding:16px; }
.modal { width:min(720px,100%); max-height:92vh; overflow:auto; background:var(--panel); border:1px solid var(--border-strong); border-radius:20px; padding:24px; }
.modal h2 { margin-bottom:16px; }
.pillrow { display:flex; flex-wrap:wrap; gap:6px; }
.pill { height:40px; padding:0 14px; border-radius:999px; border:1px solid var(--border-strong); background:var(--btn-bg); color:var(--text); font-weight:700; cursor:pointer; }
.pill.on { background:var(--accent); color:var(--accent-text); border-color:var(--accent); }

/* Oda */
.room { flex:1; display:flex; flex-direction:column; min-height:0; }
.room-body { flex:1; min-height:0; display:flex; }
.room-main { flex:1; min-width:0; padding:12px; display:flex; flex-direction:column; overflow:auto; }
.room-side { width:320px; flex:none; display:flex; flex-direction:column; background:var(--panel); border-left:1px solid var(--border); min-height:0; }
.room-side section { padding:12px 16px; border-bottom:1px solid var(--border); }
.room-side h3 { font-size:15px; margin-bottom:8px; }
.chatbox { flex:1; min-height:120px; overflow:auto; display:flex; flex-direction:column; gap:6px; font-size:13px; padding:10px 16px; }
.chatbox .sys { font-size:12px; color:var(--text-muted); font-style:italic; }
.chatform { display:flex; gap:8px; padding:0 16px 12px; }
.waiting { max-width:620px; margin:40px auto; width:100%; }
.seatrow { display:flex; align-items:center; gap:12px; padding:10px 12px; border:1px solid var(--border); border-radius:var(--radius); margin-bottom:8px; background:var(--panel-2); }
.avatar { width:38px; height:38px; border-radius:50%; background:var(--accent); color:var(--accent-text); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:13px; flex:none; }
.avatar.bot { background:var(--border-strong); color:var(--text); }
.revealbar { display:flex; border-radius:10px; border:1px solid var(--border-strong); overflow:hidden; margin-top:8px; }
.revealbar button { flex:1; height:36px; border:0; background:var(--btn-bg); color:var(--text-muted); font-size:13px; font-weight:700; cursor:pointer; }
.revealbar button.on { background:var(--accent); color:var(--accent-text); }

#toasts { position:fixed; right:16px; bottom:16px; display:flex; flex-direction:column; gap:8px; z-index:99; }
.toast { background:var(--panel); border:1px solid var(--accent); color:var(--text); padding:10px 16px; border-radius:var(--radius); max-width:360px; box-shadow:0 6px 20px rgba(0,0,0,.4); }
.toast.err { border-color:var(--danger); }

/* Yönetim */
.admin { flex:1; padding:20px 24px; max-width:1100px; width:100%; margin:0 auto; }
.admin .tabs { display:flex; gap:6px; margin-bottom:16px; }
.tokgrid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:10px; }
.tok { display:flex; align-items:center; gap:8px; font-size:12px; }
.tok input[type=color] { width:44px; height:36px; padding:0; border:1px solid var(--border-strong); border-radius:8px; background:none; flex:none; }
.tok input[type=text] { height:36px; font-size:12px; }
table.t { width:100%; border-collapse:collapse; font-size:14px; }
table.t th { text-align:left; font-size:12px; color:var(--text-muted); padding:8px; }
table.t td { padding:8px; border-top:1px solid var(--border); vertical-align:middle; }
.rules { max-width:760px; line-height:1.6; }
.rules table { border-collapse:collapse; margin:10px 0; } .rules td, .rules th { border:1px solid var(--border); padding:6px 12px; }

@media (max-width: 900px) {
  .auth { flex-direction:column; } .auth .form { width:100%; border-left:0; } .auth .brand { padding:24px; } .auth .brand h2 { font-size:32px; }
  .lobby { flex-direction:column; } .lobby nav { width:100%; flex-direction:row; overflow:auto; } .lobby aside { width:100%; padding:0 24px 20px; }
  .room-body { flex-direction:column; } .room-side { width:100%; }
}

/* Oda yan paneli: dar ekranda ve telefon yatayda çekmece olur */
.room-side section[hidden] { display:none; }
#sideToggle { display:none; }
@media (max-width: 900px), (max-height: 520px) {
  #sideToggle { display:inline-flex; }
  .room-body { flex-direction:row; }
  .room-side { position:fixed; right:0; top:56px; bottom:0; width:min(320px,86vw); transform:translateX(100%); transition:transform .2s; z-index:20; box-shadow:-8px 0 24px rgba(0,0,0,.45); overflow:auto; }
  .room-side.open { transform:none; }
  .room-main { padding:6px; }
}
@media (max-height: 520px) {
  .topbar { height:46px; padding:0 10px; gap:8px; } .topbar h1 { display:none; } .topbar .btn { height:34px; padding:0 10px; font-size:13px; }
  .room-side { top:46px; }
}
