@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg-deep: #06090e;
  --bg-table-outer: #0b121c;
  --felt-green-dark: #0a2618;
  --felt-green: #0f3824;
  --felt-green-light: #164e33;
  --felt-glow: rgba(26, 163, 102, 0.25);

  --gold-primary: #f5c542;
  --gold-light: #fbe398;
  --gold-dark: #b8860b;
  --gold-glow: rgba(245, 197, 66, 0.35);

  --accent-cyan: #00f2fe;
  --accent-red: #ff4b5c;
  --team-a-color: #00d2ff;
  --team-b-color: #ff5e62;

  --text-main: #f0f6fc;
  --text-muted: #8b949e;
  --text-gold: #fbe398;

  --glass-bg: rgba(13, 21, 32, 0.75);
  --glass-border: rgba(255, 255, 255, 0.12);

  --card-width: 80px;
  --card-height: 114px;
  --card-radius: 9px;
  --card-shadow: 0 8px 20px rgba(0, 0, 0, 0.55);

  --font-main: 'Outfit', sans-serif;
  --font-mono: 'Plus Jakarta Sans', monospace;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-deep);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
.top-header {
  height: 52px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(11, 18, 28, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--glass-border);
  z-index: 200;
  flex-shrink: 0;
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-width: 0;
}

.brand-badge {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
  color: #000;
  font-weight: 800;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.brand-title {
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(90deg, #fff, var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  overflow: hidden;
}

/* Icon Button — shows icon + label on desktop, icon-only on mobile */
.icon-btn {
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 12px;
  padding: 5px 9px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  white-space: nowrap;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.icon-btn.btn-gold {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
  border-color: var(--gold-light);
  color: #000;
  font-weight: 700;
}

.icon-btn .icon {
  font-size: 15px;
  line-height: 1;
}

.icon-btn .btn-label {
  font-size: 11px;
}

.res-badge {
  background: rgba(0,242,254,0.15);
  border: 1px solid var(--accent-cyan);
  padding: 3px 7px;
  border-radius: 10px;
  font-size: 10px;
  color: var(--accent-cyan);
  font-weight: 700;
  white-space: nowrap;
}

.player-badge {
  background: #1b263b;
  border: 1px solid var(--gold-primary);
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 11px;
  color: var(--gold-primary);
  font-weight: 700;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Keep old .btn for modals */
.btn {
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
  border-color: var(--gold-light);
  color: #000;
  font-weight: 700;
}

/* Sidebar header */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--glass-border);
}

/* Sidebar backdrop (darkens game on mobile when drawer open) */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 498;
  backdrop-filter: blur(2px);
}

.sidebar-backdrop.active {
  display: block;
}

/* Arena Layout */
.arena-wrapper {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 340px;
  height: calc(100vh - 52px);
  overflow: hidden;
  position: relative;
}

/* Poker Table Stage */
.table-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.table-stage-scaler {
  transform-origin: center center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 1040px;
  height: 770px;
  flex-shrink: 0;
  transition: transform 0.15s ease-out;
}

.poker-felt {
  position: relative;
  width: 100%;
  max-width: 1040px;
  height: 630px;
  background: radial-gradient(ellipse at center, var(--felt-green-light) 0%, var(--felt-green) 55%, var(--felt-green-dark) 100%);
  border-radius: 180px;
  border: 14px solid #1a2332;
  box-shadow: inset 0 0 80px rgba(0,0,0,0.65), 0 25px 60px rgba(0,0,0,0.8);
  display: grid;
  grid-template-rows: 95px 1fr 135px;
  grid-template-columns: 180px 1fr 180px;
  padding: 14px;
}

.felt-ring {
  position: absolute;
  inset: 18px;
  border-radius: 160px;
  border: 1px dashed rgba(245, 197, 66, 0.25);
  pointer-events: none;
}

/* Seats */
.player-seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.seat-top { grid-row: 1; grid-column: 2; }
.seat-left { grid-row: 2; grid-column: 1; }
.seat-right { grid-row: 2; grid-column: 3; }
.seat-bottom { grid-row: 3; grid-column: 2; }

.player-pod {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
  border-radius: 14px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
  min-width: 190px;
}

.player-pod.active-turn {
  border-color: var(--gold-primary);
  box-shadow: 0 0 25px var(--gold-glow);
  transform: scale(1.04);
}

.player-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
}

.avatar-a { background: linear-gradient(135deg, #00d2ff, #0077ff); }
.avatar-b { background: linear-gradient(135deg, #ff5e62, #ff9966); }

/* Center Table Layout */
.center-table-area {
  grid-row: 2;
  grid-column: 2;
  display: grid;
  grid-template-columns: 110px 145px 1fr;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  z-index: 2;
}

.center-spot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* Cards UI */
.playing-card {
  width: var(--card-width);
  height: var(--card-height);
  border-radius: var(--card-radius);
  background: #ffffff;
  color: #1a1a1a;
  box-shadow: var(--card-shadow);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px;
  font-family: var(--font-mono);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid rgba(0,0,0,0.15);
}

.playing-card:hover {
  transform: translateY(-6px) scale(1.06);
  z-index: 20;
}

.playing-card.selected {
  outline: 3px solid var(--gold-primary);
  transform: translateY(-12px);
}

.card-red { color: #d91c24; }
.card-black { color: #111827; }
.card-joker {
  background: linear-gradient(135deg, #2b1055, #7597de);
  color: #fff;
}

.card-corner { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.card-val { font-size: 14px; }
.card-suit { font-size: 12px; }
.card-center-art { display: flex; align-items: center; justify-content: center; font-size: 26px; flex: 1; }

.card-penalty-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.85);
  color: var(--gold-primary);
  font-size: 9px;
  font-family: var(--font-main);
  padding: 1px 4px;
  border-radius: 4px;
}

/* LIFO Stack */
.stack-visual {
  position: relative;
  width: var(--card-width);
  height: var(--card-height);
  cursor: pointer;
}

.stack-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--gold-primary);
  color: #000;
  font-size: 11px;
  font-weight: 800;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

/* Bottom Player Hand Section */
.player-hand-section {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 135px;
  background: linear-gradient(0deg, rgba(6, 9, 14, 0.96) 0%, rgba(6, 9, 14, 0.78) 70%, transparent 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 14px;
  z-index: 50;
}

.hand-cards {
  display: flex;
  gap: 12px;
}

/* Sidebar */
.right-sidebar {
  background: #0b121c;
  border-left: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 16px;
}

.score-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
}

.score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.08);
}

/* Valid Action Picker Drawer / Modal */
.action-picker-box {
  background: rgba(0, 242, 254, 0.07);
  border: 1px solid var(--accent-cyan);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
}

.btn-action-move {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  margin-bottom: 6px;
  transition: all 0.2s;
}

.btn-action-move:hover {
  background: rgba(245, 197, 66, 0.2);
  border-color: var(--gold-primary);
}

/* Game Log Box */
.game-log-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 12px;
  max-height: 220px;
  overflow-y: auto;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.log-entry {
  line-height: 1.4;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  padding-bottom: 4px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.open { display: flex; }

.modal-box {
  background: #0d1622;
  border: 1px solid var(--gold-primary);
  border-radius: 18px;
  width: 90%;
  max-width: 520px;
  padding: 24px;
}

/* Flying Card Animation */
.flying-card-anim {
  position: fixed;
  width: var(--card-width);
  height: var(--card-height);
  z-index: 9999;
  pointer-events: none;
  transition: all 0.55s cubic-bezier(0.25, 1, 0.5, 1);
  transform: scale(1.15) rotate(8deg);
  box-shadow: 0 15px 35px rgba(245, 197, 66, 0.6);
}

/* Drag and Drop Zone highlights */
.drag-over-active {
  outline: 3px dashed var(--accent-cyan) !important;
  outline-offset: 4px;
  background: rgba(0, 242, 254, 0.15) !important;
  transform: scale(1.05);
  transition: all 0.2s ease;
}

.playing-card[draggable="true"] {
  cursor: grab;
}
.playing-card[draggable="true"]:active {
  cursor: grabbing;
}

/* KAMİLLER OYUN SALONU — MASA KARTLARI (LOBİ GRID) */
.lobby-table-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 14px;
  text-align: left;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.lobby-table-card:hover {
  border-color: var(--gold-primary);
  box-shadow: 0 4px 20px rgba(245, 197, 66, 0.15);
  transform: translateY(-2px);
}

.lobby-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.lobby-table-title {
  font-weight: 800;
  color: #fff;
  font-size: 14px;
}

.lobby-table-status {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
}

.status-waiting {
  background: rgba(26, 163, 102, 0.2);
  color: #1aa366;
  border: 1px solid #1aa366;
}

.status-started {
  background: rgba(255, 75, 92, 0.2);
  color: #ff4b5c;
  border: 1px solid #ff4b5c;
}

.lobby-seat-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  padding: 3px 0;
}

/* MOBİL & YATAY EKRAN UYUMU (MOBILE LANDSCAPE OPTIMIZATION) */
@media screen and (max-height: 600px) and (orientation: landscape) {
  :root {
    --card-width: 52px;
    --card-height: 74px;
  }

  .top-header {
    height: 40px;
    padding: 0 10px;
  }

  .brand-title {
    font-size: 14px;
  }

  .player-pod {
    padding: 6px 10px;
  }

  .player-hand-section {
    height: 105px;
    padding-bottom: 6px;
  }

  .modal-box {
    max-height: 88vh;
    overflow-y: auto;
    padding: 16px;
  }
}

/* ROTATE DEVICE OVERLAY (PORTRAIT ORIENTATION WARNING) */
.rotate-device-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, #101c2c 0%, #060b12 100%);
  z-index: 999999;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.rotate-device-content {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--gold-primary);
  border-radius: 20px;
  padding: 32px 24px;
  max-width: 360px;
  box-shadow: 0 0 40px rgba(230, 184, 0, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.rotate-phone-anim {
  font-size: 56px;
  animation: rotatePhoneAnim 2.2s infinite ease-in-out;
}

@keyframes rotatePhoneAnim {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(-90deg) scale(1.1); }
  100% { transform: rotate(0deg); }
}

.rotate-device-content h2 {
  color: var(--gold-primary);
  font-size: 20px;
  font-weight: 800;
  margin: 0;
}

.rotate-device-content p {
  color: #ccc;
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
}

.rotate-hint {
  background: rgba(230, 184, 0, 0.12);
  color: var(--gold-primary);
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(230, 184, 0, 0.3);
}

@media screen and (max-width: 1024px) and (orientation: portrait) {
  .rotate-device-overlay {
    display: flex !important;
  }
}

/* ── DRAWER: sidebar slides in from right on all screens < 1150px ── */
@media screen and (max-width: 1150px) {
  .arena-wrapper {
    grid-template-columns: 1fr;
  }

  .right-sidebar {
    position: fixed;
    top: 52px;
    right: -350px;
    width: 320px;
    height: calc(100vh - 52px);
    z-index: 499;
    transition: right 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 32px rgba(0,0,0,0.9);
    overflow-y: auto;
  }

  .right-sidebar.drawer-open {
    right: 0;
  }

  .sidebar-toggle-btn {
    display: flex !important;
  }
}

/* ── COMPACT: hide btn-label text on screens < 900px (icon-only) ── */
@media screen and (max-width: 900px) {
  .icon-btn .btn-label {
    display: none;
  }

  .icon-btn {
    padding: 5px 7px;
  }

  .icon-btn .icon {
    font-size: 16px;
  }

  .res-badge {
    display: none;
  }

  .brand-title {
    display: none;
  }
}

/* ── TINY: extra small phones (< 420px) ── */
@media screen and (max-width: 420px) {
  .player-badge {
    max-width: 70px;
    font-size: 10px;
    padding: 2px 5px;
  }

  .icon-btn {
    padding: 4px 6px;
  }

  .icon-btn .icon {
    font-size: 14px;
  }
}


