/* ODALAR: oda tarayıcısı, oda chat'i, harita editörü. Sistemi kaldırınca bu dosya da gider. */

#rooms-btn {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(90, 170, 255, 0.4);
  background: rgba(90, 170, 255, 0.1);
  color: #9fd0ff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  cursor: pointer;
}
#rooms-btn:hover { filter: brightness(1.2); }

/* --- Oda tarayıcısı (menüde Topluluk sekmesinin içinde) --- */
.rooms-panel { display: flex; flex-direction: column; text-align: left; }
.rp-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.rp-head h2 { font-size: 22px; letter-spacing: 0.08em; color: var(--text); }
.rp-tabs { display: flex; gap: 4px; flex: 1; }
.rp-tab, .rp-close {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--dim);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.rp-tab.active { color: var(--text); background: rgba(255, 255, 255, 0.1); }
.rp-close { padding: 7px 10px; }
.rp-body { overflow-y: auto; min-height: 0; }

.rp-create {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 1.2fr auto;
  gap: 6px;
}
.rp-create input, .rp-create select, .rr-pass input {
  min-width: 0;
  padding: 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(5, 10, 20, 0.8);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}
.rp-primary, .rr-join, .rr-pass button {
  padding: 10px 14px;
  border: none;
  border-radius: 9px;
  background: #4cae4f;
  color: #fff;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  cursor: pointer;
  white-space: nowrap;
}
.rp-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0 8px;
  font-size: 12px;
  color: var(--dim);
}
.rp-link {
  border: none;
  background: none;
  color: #9fd0ff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 0;
}
.rp-link:hover { text-decoration: underline; }
.rp-list { display: flex; flex-direction: column; gap: 6px; }
.rp-room {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(5, 10, 20, 0.45);
}
.rp-room.full { opacity: 0.55; }
.rr-main { display: flex; flex-direction: column; min-width: 0; }
.rr-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rr-map { font-size: 11.5px; color: var(--dim); margin-top: 2px; }
.rr-count { font-variant-numeric: tabular-nums; font-weight: 700; color: #7cffbe; font-size: 13px; }
.rr-pass { grid-column: 1 / -1; display: flex; gap: 6px; }
.rr-pass input { flex: 1; }
.rp-empty, .rp-hint { color: var(--dim); font-size: 13px; line-height: 1.5; padding: 10px 2px; }
.rp-err { color: var(--danger); font-size: 12.5px; margin-top: 10px; }

.rp-maps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.rp-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: rgba(5, 10, 20, 0.45);
}
.rp-card canvas { width: 100%; height: 100px; display: block; border-radius: 6px; }
.rc-name { font-weight: 700; font-size: 13px; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-author { font-size: 11.5px; color: var(--dim); }

@media (max-width: 560px) {
  .rp-create { grid-template-columns: 1fr 1fr; }
  .rp-create .rp-primary { grid-column: 1 / -1; }
  .rp-head { flex-wrap: wrap; }
}

/* --- Oda içi: skor çubuğu --- */
.roundbar.room-mode .bar { display: none; }
.roundbar.room-mode .timer { color: #fff; letter-spacing: 0.06em; }

/* --- Oda chat'i --- */
#room-chat {
  position: fixed;
  left: 18px;
  bottom: 58px;
  z-index: 15;
  width: min(360px, calc(100vw - 36px));
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}
.rc-log {
  max-height: 190px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  line-height: 1.35;
  scrollbar-width: thin;
}
#room-chat.typing .rc-log { pointer-events: auto; background: rgba(10, 12, 16, 0.6); border-radius: 10px; padding: 6px 8px; }
/* Chat kapalıyken kaydırma çubuğu görünmesin (yalnızca yazarken kaydırılabilir) */
#room-chat:not(.typing) .rc-log { overflow-y: hidden; scrollbar-width: none; }
#room-chat:not(.typing) .rc-log::-webkit-scrollbar { display: none; }
.rc-line {
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(10, 12, 16, 0.55);
  color: var(--text);
  align-self: flex-start;
  max-width: 100%;
  word-break: break-word;
  transition: opacity 0.6s ease;
}
.rc-line.sys { color: #ffd98a; font-style: italic; }
.rc-line.old { opacity: 0; }
#room-chat.typing .rc-line.old { opacity: 0.85; }
.rc-form { pointer-events: auto; }
.rc-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(120, 255, 190, 0.45);
  background: rgba(10, 14, 20, 0.92);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
}
.rc-bar { display: flex; gap: 6px; pointer-events: auto; }
.rc-btn {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(20, 24, 32, 0.85);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.rc-btn kbd {
  font-family: inherit;
  font-size: 10px;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 4px;
  margin-left: 4px;
}
.rc-edit { border-color: rgba(90, 170, 255, 0.5); color: #9fd0ff; }
body.touch #room-chat { bottom: 150px; left: 10px; width: min(300px, calc(100vw - 20px)); }
body.touch .rc-btn kbd { display: none; }

/* --- Harita editörü --- */
#room-editor {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  outline: none;
  user-select: none;
}
.re-top, .re-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.re-bottom { border-bottom: none; border-top: 1px solid var(--line); }
.re-tools { display: flex; gap: 4px; flex-wrap: wrap; }
.re-tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 56px;
  padding: 5px 6px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--dim);
  font-family: inherit;
  cursor: pointer;
}
.re-tool span { font-size: 18px; line-height: 1.1; }
.re-tool em { font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: 0.03em; }
.re-tool.active { border-color: rgba(120, 255, 190, 0.6); background: rgba(120, 255, 190, 0.12); color: var(--text); }
.re-opts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.re-team { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.re-team button {
  border: none;
  background: transparent;
  color: var(--dim);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 9px;
  cursor: pointer;
}
.re-team button.active { background: rgba(255, 255, 255, 0.12); color: var(--text); }
.re-team button.red.active { background: hsla(355, 70%, 50%, 0.35); }
.re-team button.blue.active { background: hsla(212, 70%, 50%, 0.35); }
.re-team button:disabled { opacity: 0.3; cursor: default; }
.dim { opacity: 0.35; }
.re-width, .re-check { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--dim); }
.re-width input { width: 90px; }
.re-btn {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.re-btn:hover { background: rgba(255, 255, 255, 0.1); }
.re-main { flex: 1; display: flex; min-height: 0; }
.re-canvas { flex: 1; min-width: 0; display: block; touch-action: none; cursor: crosshair; }
.re-side {
  width: 250px;
  padding: 12px 14px;
  background: var(--panel);
  border-left: 1px solid var(--line);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.re-side h3 { font-size: 10px; letter-spacing: 0.16em; color: var(--dim); margin-top: 8px; }
.re-side label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--dim); }
.re-side label.re-check { flex-direction: row; }
.re-side input:not([type=checkbox]), .re-side select {
  padding: 7px 8px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(5, 10, 20, 0.8);
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
}
.re-side input[type=range] { padding: 0; }
.re-row { display: flex; gap: 5px; flex-wrap: wrap; }
.re-row .re-btn { flex: 1; }
.re-submit { border-color: rgba(90, 170, 255, 0.5); color: #9fd0ff; }
.re-picker {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
}
.re-picker button {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  padding: 6px 8px;
  cursor: pointer;
  text-align: left;
}
.re-picker button span { color: var(--dim); }
.re-picker p { font-size: 12px; color: var(--dim); padding: 6px; }
.re-counts { font-size: 11px; color: var(--dim); line-height: 1.5; margin-top: 4px; }
.re-hint { font-size: 12.5px; color: var(--dim); }
.re-status { font-size: 12.5px; flex: 1; text-align: right; }
.re-status.ok { color: #7cffbe; }
.re-status.err { color: var(--danger); }
.re-actions { display: flex; gap: 8px; }
.re-close, .re-apply {
  padding: 9px 16px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.re-apply { background: #4cae4f; border-color: #4cae4f; }

.re-settings { display: none; }
@media (max-width: 760px) {
  .re-settings { display: inline-block; }
  .re-side { position: absolute; right: 0; top: 0; bottom: 0; transform: translateX(100%); transition: transform 0.2s ease; z-index: 2; }
  .re-side.open { transform: none; }
  .re-main { position: relative; }
  .re-tool { min-width: 42px; }
  .re-tool em { display: none; }
  .re-opts { margin-left: 0; }
  .re-hint { display: none; }
}

/* --- Mini oyunlar listesi (Topluluk) --- */
.rp-games { display: grid; gap: 8px; max-height: 52vh; overflow-y: auto; padding-right: 4px; }
.rp-game { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); }
.rg-dot { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 800 14px system-ui, sans-serif; color: #10131a; }
.rg-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rg-text b { font-size: 14px; letter-spacing: 0.04em; }
.rg-text span { font-size: 12px; opacity: 0.7; line-height: 1.35; }
.rg-play { flex: none; padding: 8px 14px; }


/* Editör: mekanizma araçları ikinci sırada + seçili aracın ayarları */
.re-tools-mech { border-top: 1px solid rgba(255,255,255,0.07); padding-top: 4px; margin-top: 2px; width: 100%; }
.re-tools-mech .re-tool { min-width: 50px; }
.re-tools-mech .re-tool em { font-size: 10px; }
.re-mopts { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; width: 100%; font-size: 12px; color: var(--dim, #9aa6b8); padding: 2px 2px 0; }
.re-mopts.hidden { display: none; }
.re-mopts label { display: flex; align-items: center; gap: 5px; }
.re-mopts input[type=number] { width: 58px; }
.re-mopts input, .re-mopts select { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14); color: inherit; border-radius: 6px; padding: 3px 5px; font: inherit; }
.rp-playmap { margin-top: 4px; padding: 5px 10px; font-size: 12px; }

/* --- 7/24 oda oylamaları --- */
.rc-vmenu {
  pointer-events: auto;
  margin-top: 6px;
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(14, 17, 24, 0.94);
}
.rc-vmenu.hidden { display: none; }
.vm-head { font-size: 11px; font-weight: 800; letter-spacing: 0.06em; color: var(--dim); margin: 6px 2px 2px; text-transform: uppercase; }
.vm-item {
  text-align: left;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(30, 36, 48, 0.9);
  color: var(--text);
  font: 700 12.5px inherit;
  font-family: inherit;
  cursor: pointer;
}
.vm-item:hover { background: rgba(60, 70, 92, 0.9); }
.vm-empty { font-size: 12px; color: var(--dim); padding: 4px 2px; }

#vote-bar {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 24px);
  padding: 8px 10px 8px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 209, 102, 0.5);
  background: rgba(14, 17, 24, 0.94);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  pointer-events: auto;
}
#vote-bar.hidden { display: none; }
.vb-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.vb-btns { display: flex; gap: 6px; flex: none; }
.vb-btns.hidden { display: none; }
.vb-btns button {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(30, 36, 48, 0.95);
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
}
.vb-yes.on { background: #2e7d4f; border-color: #58d68d; }
.vb-no.on { background: #8a2f2f; border-color: #ff7b7b; }
@media (max-width: 560px) {
  #vote-bar { flex-direction: column; align-items: stretch; gap: 6px; top: 56px; }
  .vb-text { white-space: normal; text-align: center; }
  .vb-btns button { flex: 1; }
}
