/**
 * IDPoker - Texas Hold'em MetaApp - Global Styles
 *
 * Dark casino theme with CSS variables.
 */

:root {
  /* Brand */
  --id-color-primary: #8b5cf6;
  --id-color-primary-hover: #7c3aed;
  --id-color-primary-active: #6d28d9;

  /* Background */
  --id-bg-body: #0a1a12;
  --id-bg-card: #13241b;
  --id-bg-button: var(--id-color-primary);
  --id-bg-button-hover: var(--id-color-primary-hover);
  --id-bg-button-disabled: #3a4a40;

  /* Text */
  --id-text-main: #e6efe8;
  --id-text-secondary: #9fb3a4;
  --id-text-tertiary: #6f8577;
  --id-text-inverse: #ffffff;
  --id-text-title: #f3e6c4;
  --id-text-subtitle: #a8bcae;
  --id-text-error: #fca5a5;

  /* Border */
  --id-border-color: #374151;
  --id-border-color-light: #4b5563;

  /* Shadow */
  --id-shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --id-shadow-md: 0 4px 6px rgba(0,0,0,0.3);
  --id-shadow-lg: 0 10px 15px rgba(0,0,0,0.3);

  /* Radius */
  --id-radius-card: 0.75rem;
  --id-radius-button: 0.5rem;
  --id-radius-small: 0.25rem;

  /* Spacing */
  --id-spacing-xs: 0.25rem;
  --id-spacing-sm: 0.5rem;
  --id-spacing-md: 1rem;
  --id-spacing-lg: 1.5rem;
  --id-spacing-xl: 2rem;

  /* Font */
  --id-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --id-font-size-base: 1rem;
  --id-font-size-sm: 0.875rem;
  --id-font-size-xs: 0.75rem;
  --id-font-size-lg: 1.125rem;
}

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

body {
  font-family: var(--id-font-family);
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, #1c4d2e 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 12% 82%, rgba(147,51,234,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 88% 18%, rgba(236,72,153,0.10) 0%, transparent 60%),
    #0a1a12;
  color: var(--id-text-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* 氛围装饰层：飞散扑克牌 + 筹码 + 光斑 */
.ambient-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
/* 背景层美女模特（左右各一个，最底层，不挡扑克牌/logo装饰） */
.model-bg {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: -1;
  opacity: 0.5;
  pointer-events: none;
}
.model-bg img {
  width: 240px;
  height: auto;
  display: block;
  border: none;
}
.model-bg-left { left: 0; }
.model-bg-left img {
  -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 100%);
  mask-image: linear-gradient(to right, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 100%);
}
.model-bg-right { right: 0; }
.model-bg-right img {
  -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 100%);
  mask-image: linear-gradient(to left, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 100%);
}
@media (max-width: 900px) {
  .model-bg { opacity: 0.3; }
  .model-bg img { width: 150px; }
}
@media (max-width: 700px) {
  .model-bg { display: none; }
}
/* MVC logo 装饰（飘浮的圆形 logo） */
.ambient-chip {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 35% 30%, #1a2a3a, #0a0a0f 70%);
  box-shadow: 0 2px 10px rgba(0,0,0,.5), 0 0 12px rgba(90,180,230,.25);
  opacity: 0.6;
  animation: chipFloat 16s ease-in-out infinite;
}
.ambient-chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ambient-chip.c1 { top: 14%; left: 8%; }
.ambient-chip.c2 { bottom: 18%; right: 10%; animation-delay: -4s; }
.ambient-chip.c3 { top: 60%; left: 4%; animation-delay: -8s; }
.ambient-chip.c4 { top: 8%; right: 22%; animation-delay: -11s; }
/* 扑克牌装饰（斜着的小牌面） */
.ambient-card {
  position: absolute;
  width: 30px;
  height: 42px;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.45);
  opacity: 0.25;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  animation: cardFloat 20s ease-in-out infinite;
}
.ambient-card.p1 { top: 22%; right: 5%; color: #dc2626; transform: rotate(14deg); }
.ambient-card.p2 { bottom: 30%; left: 3%; color: #1f2937; transform: rotate(-10deg); animation-delay: -6s; }
.ambient-card.p3 { top: 70%; right: 18%; color: #dc2626; transform: rotate(8deg); animation-delay: -12s; }
.ambient-card.p4 { top: 5%; left: 30%; color: #1f2937; transform: rotate(-16deg); animation-delay: -15s; }
/* 花色装饰 */
.ambient-suit {
  position: absolute;
  font-size: 44px;
  opacity: 0.08;
  animation: cardFloat 24s ease-in-out infinite;
}
.ambient-suit.s1 { top: 40%; left: 15%; color: #d4af6a; }
.ambient-suit.s2 { bottom: 12%; right: 30%; color: #cbb9e8; animation-delay: -9s; }
@keyframes chipFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-22px) rotate(12deg); }
}
@keyframes cardFloat {
  0%, 100% { transform: translateY(0) rotate(var(--rot, 12deg)); }
  50% { transform: translateY(-28px) rotate(calc(var(--rot, 12deg) + 10deg)); }
}

/* App Layout */
.app-container {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.app-title {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.app-subtitle {
  font-size: 0.75rem;
  color: var(--id-text-secondary);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem 1.2rem;
}

/* Side panel */
.side-panel {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 12px;
  max-width: 300px;
}

.side-panel-title {
  color: var(--id-text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 768px) {
  .app-container {
    padding: 0.5rem;
  }
  .app-title {
    font-size: 1.2rem;
  }
}

/* ============ 联机模式 ============ */
.mode-switch {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 4px;
}
.mode-btn {
  padding: 8px 20px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  color: var(--id-text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.mode-btn.active {
  background: var(--id-color-primary);
  color: #fff;
  border-color: var(--id-color-primary);
}

.online-root {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}
.ol-wrap {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ol-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ol-header h2 { font-size: 1.15rem; margin: 0; flex: 1; }
.ol-phase { color: #fbbf24; font-size: 0.8rem; }
.ol-create { display: flex; gap: 8px; flex-wrap: wrap; }
.ol-create input {
  flex: 1;
  min-width: 120px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #374151;
  background: #1f2937;
  color: #fff;
  font-size: 0.85rem;
}
.ol-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: #374151;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.ol-btn-p { background: #8b5cf6; }
.ol-btn:hover { filter: brightness(1.15); }
.ol-log { font-size: 0.78rem; color: #9ca3af; min-height: 18px; }
.ol-roomlist { display: flex; flex-direction: column; gap: 8px; }
.ol-empty { color: #6b7280; text-align: center; padding: 20px; }
.ol-room {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}
.ol-room-id { font-weight: 700; font-size: 1rem; }
.ol-room-meta { flex: 1; color: #9ca3af; font-size: 0.8rem; }
.ol-table-mini {
  border-radius: 14px;
  padding: 16px;
  background: radial-gradient(ellipse at center, #0f6a34, #0a4a24);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.ol-seats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; width: 100%; }
.ol-seat {
  padding: 8px;
  border-radius: 8px;
  background: rgba(17,24,39,0.7);
  text-align: center;
  font-size: 0.75rem;
  min-height: 44px;
  border: 1px solid transparent;
}
.ol-seat.me { border-color: #fbbf24; box-shadow: 0 0 12px rgba(251,191,36,.5); }
.ol-seat.empty { opacity: 0.4; color: #9ca3af; }
.ol-pot { color: #fbbf24; font-weight: 700; font-size: 1rem; }
.ol-comm { display: flex; gap: 4px; }
.ol-card {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 46px;
  border-radius: 6px;
  background: #fff;
  color: #1f2937;
  font-weight: 700;
  font-size: 0.8rem;
}
.ol-card.red { color: #dc2626; }
.ol-card.back { background: #1e3a5f; color: transparent; }
.ol-hole { color: #e5e7eb; font-size: 0.85rem; text-align: center; }
.ol-showdown { background: rgba(251,191,36,.12); border: 1px solid rgba(251,191,36,.3); padding: 8px 12px; border-radius: 8px; font-size: 0.82rem; }
.ol-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.ol-wait { color: #9ca3af; text-align: center; font-size: 0.85rem; }
