/* =========================================================
   CỜ CÁ NGỰA ONLINE - VIETNAMESE HORSE CHESS (LUDO) STYLES
   Modern Glassmorphism, 3D Dice, Responsive Board & Neon FX
   ========================================================= */

:root {
  --bg-primary: #070a13;
  --bg-card: rgba(15, 23, 42, 0.75);
  --border-card: rgba(255, 255, 255, 0.1);
  --border-card-hover: rgba(255, 255, 255, 0.2);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --color-red: #ef4444;
  --color-red-glow: rgba(239, 68, 68, 0.4);
  --color-blue: #0284c7;
  --color-blue-glow: rgba(2, 132, 199, 0.4);
  --color-yellow: #eab308;
  --color-yellow-glow: rgba(234, 179, 8, 0.4);
  --color-green: #10b981;
  --color-green-glow: rgba(16, 185, 129, 0.4);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Bungee', cursive;
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  position: relative;
  padding-bottom: 2rem;
}

/* Background Ambient Glows */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.25;
}
.glow-1 { top: -10%; left: -10%; width: 50vw; height: 50vw; background: radial-gradient(circle, #ef4444, transparent 70%); }
.glow-2 { top: 30%; right: -10%; width: 45vw; height: 45vw; background: radial-gradient(circle, #0284c7, transparent 70%); }
.glow-3 { bottom: -10%; left: 20%; width: 40vw; height: 40vw; background: radial-gradient(circle, #10b981, transparent 70%); }

#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

/* Main Container */
.cangua-app-container {
  width: 100%;
  max-width: 680px;
  padding: 0.75rem 0.85rem;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* Portal Navigation Bar */
.portal-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.35rem 0.45rem;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.portal-nav::-webkit-scrollbar { display: none; }

.portal-tab {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: var(--transition);
  position: relative;
  white-space: nowrap;
}
.portal-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.portal-tab.active {
  color: #fff;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.4);
}
.active-dot {
  width: 5px;
  height: 5px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 6px #fff;
}

/* Top Header */
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.2rem 0;
}
.header-titles {
  display: flex;
  flex-direction: column;
}
.header-badge-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 2px;
}
.badge-tag {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-tag.orange {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #f59e0b;
}
.badge-tag.serverless {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}
.game-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #fcd34d, #f59e0b, #ef4444);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.header-actions {
  display: flex;
  gap: 0.4rem;
}
.btn-tool {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: var(--transition);
}
.btn-tool:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.btn-tool.active {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
}

/* =========================================================
   LOBBY / ROOM CREATION PANEL
   ========================================================= */
.lobby-panel {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.lobby-panel.hidden { display: none; }

.mode-selector-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.mode-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.6rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}
.mode-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: #f59e0b;
  transform: translateY(-2px);
}
.mode-card.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: #f59e0b;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.25);
}
.mode-icon { font-size: 1.6rem; }
.mode-title { font-size: 0.82rem; font-weight: 800; color: #fff; }
.mode-desc { font-size: 0.68rem; color: var(--text-dim); }

.box-card {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.box-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.box-icon {
  font-size: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.4rem;
  border-radius: var(--radius-sm);
}
.box-info h3 { font-size: 0.95rem; font-weight: 800; color: #fff; }
.box-info p { font-size: 0.73rem; color: var(--text-muted); }

/* Room Capacity Picker (2/2, 3/3, 4/4) */
.capacity-picker-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.picker-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
}
.capacity-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
}
.btn-cap-opt, .btn-cap-bot {
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.4rem;
  color: #fff;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  text-align: center;
}
.btn-cap-opt:hover, .btn-cap-bot:hover {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}
.btn-cap-opt.active, .btn-cap-bot.active {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
}
.cap-num {
  font-size: 0.92rem;
  font-weight: 900;
  color: #fcd34d;
}
.cap-desc {
  font-size: 0.65rem;
  color: var(--text-dim);
  font-weight: 700;
}

.input-row {
  display: flex;
  gap: 0.5rem;
}
.input-code {
  flex: 1;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.input-code:focus {
  outline: none;
  border-color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.btn-action-main {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.2rem;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}
.btn-action-main:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
}
.btn-action-sec {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.btn-action-sec:hover { background: rgba(255, 255, 255, 0.15); }

/* Live Rooms Discovery Section */
.live-rooms-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  margin-top: 0.2rem;
}
.live-rooms-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.live-rooms-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: #38bdf8;
}
.live-badge {
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}
.btn-mini-refresh {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}
.btn-mini-refresh:hover { color: #fff; background: rgba(255, 255, 255, 0.14); }

.live-rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.45rem;
  margin-top: 0.2rem;
}
.no-rooms-msg {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 0.73rem;
  color: var(--text-dim);
  padding: 0.6rem 0.4rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
}

.live-room-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.6rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: left;
}
.live-room-card:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.25);
}
.live-room-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.live-room-code {
  font-size: 0.8rem;
  font-weight: 900;
  color: #fff;
}
.live-room-capacity {
  font-size: 0.68rem;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  padding: 1px 5px;
  border-radius: 4px;
}
.live-room-status-txt {
  font-size: 0.68rem;
  font-weight: 700;
}
.live-room-status-txt.waiting { color: #4ade80; }
.live-room-status-txt.playing { color: #fbbf24; }

/* =========================================================
   IN-GAME PANEL & BOARD LAYOUT
   ========================================================= */
.game-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.game-panel.hidden { display: none; }

/* Status Bar */
.game-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.85rem;
}
.room-badge-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.badge-code {
  font-size: 0.85rem;
  font-weight: 900;
  color: #f59e0b;
  letter-spacing: 0.5px;
}
.btn-mini-tool {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.btn-mini-tool:hover { color: #fff; background: rgba(255, 255, 255, 0.14); }

.server-badge {
  font-size: 0.68rem;
  font-weight: 800;
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

/* MY PLAYER IDENTITY BANNER */
.my-player-banner {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.my-identity-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.my-badge-tag {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
}
.my-color-display {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.my-color-circle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}
.my-color-name {
  font-size: 0.95rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.5px;
}
.my-horses-count {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 700;
}
.btn-change-color {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fcd34d;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}
.btn-change-color:hover {
  background: rgba(252, 211, 77, 0.2);
  border-color: #fcd34d;
}

/* EXCLUSIVE COLOR PICKER BOX */
.color-picker-box {
  background: rgba(15, 23, 42, 0.95);
  border: 1.5px solid #f59e0b;
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.25);
  animation: slideDown 0.25s ease-out;
}
.color-picker-box.hidden { display: none; }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.color-picker-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 800;
  color: #fcd34d;
}
.btn-close-picker {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 4px;
}
.btn-close-picker:hover { color: #fff; }

.color-options-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.45rem;
}
.color-option-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}
.color-option-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.1);
}
.color-option-btn.selected {
  border-color: #fff;
  box-shadow: 0 0 14px currentColor;
}
.color-option-btn:disabled, .color-option-btn.taken {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.6);
  transform: none;
}
.color-opt-name {
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
}
.color-opt-status {
  font-size: 0.6rem;
  font-weight: 700;
}

/* Player Cards Ribbon (Ribbon for Active Players) */
.players-ribbon {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
}
.player-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  position: relative;
  transition: var(--transition);
  text-align: center;
}
.player-card.active-turn {
  border-color: #fff;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}
.player-card.red { border-top: 3px solid var(--color-red); }
.player-card.red.active-turn { box-shadow: 0 0 16px var(--color-red-glow); border-color: var(--color-red); }
.player-card.blue { border-top: 3px solid var(--color-blue); }
.player-card.blue.active-turn { box-shadow: 0 0 16px var(--color-blue-glow); border-color: var(--color-blue); }
.player-card.yellow { border-top: 3px solid var(--color-yellow); }
.player-card.yellow.active-turn { box-shadow: 0 0 16px var(--color-yellow-glow); border-color: var(--color-yellow); }
.player-card.green { border-top: 3px solid var(--color-green); }
.player-card.green.active-turn { box-shadow: 0 0 16px var(--color-green-glow); border-color: var(--color-green); }

.player-avatar {
  font-size: 1.1rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}
.player-name {
  font-size: 0.68rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.player-finished-count {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-dim);
}

/* =========================================================
   BOARD WRAPPER & CỜ CÁ NGỰA 15x15 SVG / CANVAS GRID
   ========================================================= */
.board-container {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 590px;
  margin: 0 auto;
  background: #090e1b;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  touch-action: manipulation;
}

#cangua-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* =========================================================
   CENTER INTERACTIVE 3D DICE STAGE (Ở GIỮA BÀN CỜ)
   ========================================================= */
.center-dice-stage {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  z-index: 10;
  user-select: none;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.center-dice-stage:hover:not(.disabled) {
  transform: translate(-50%, -50%) scale(1.1);
}

.center-dice-stage:active:not(.disabled) {
  transform: translate(-50%, -50%) scale(0.94);
}

.center-dice-stage.disabled {
  cursor: not-allowed;
  opacity: 0.85;
}

.center-dice-glow {
  position: absolute;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.5), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
  z-index: -1;
  animation: pulse-center-glow 1.5s infinite ease-in-out;
}

@keyframes pulse-center-glow {
  0%, 100% { transform: scale(0.92); opacity: 0.6; }
  50% { transform: scale(1.18); opacity: 1; }
}

.center-dice-cube {
  width: 58px;
  height: 58px;
  background: linear-gradient(135deg, #ffffff, #f1f5f9);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6rem;
  font-weight: 900;
  color: #0f172a;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), inset 0 -4px 0 rgba(0, 0, 0, 0.25), 0 0 20px rgba(255, 255, 255, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.95);
  transition: all 0.2s ease;
}

.center-dice-cube.rolling {
  animation: dice-shake-3d 0.6s infinite ease-in-out;
}

@keyframes dice-shake-3d {
  0% { transform: rotate(0deg) scale(1.08); }
  25% { transform: rotate(-22deg) scale(1.18) skewX(4deg); }
  50% { transform: rotate(22deg) scale(0.92) skewY(-4deg); }
  75% { transform: rotate(-16deg) scale(1.12); }
  100% { transform: rotate(0deg) scale(1); }
}

.center-dice-prompt {
  font-size: 0.62rem;
  font-weight: 900;
  color: #fcd34d;
  background: rgba(15, 23, 42, 0.9);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(245, 158, 11, 0.5);
  letter-spacing: 0.5px;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  animation: prompt-bounce 1.5s infinite ease-in-out;
}

@keyframes prompt-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

/* =========================================================
   INTERACTIVE CONTROLS & 3D DICE ROLLER
   ========================================================= */
.game-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.95rem;
}

.turn-banner-msg {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
}
.turn-headline {
  font-size: 0.88rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.turn-subtext {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* 3D Dice Component */
.dice-action-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.dice-box {
  width: 52px;
  height: 52px;
  background: #ffffff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.1rem;
  font-weight: 900;
  color: #0f172a;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), inset 0 -3px 0 rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}
.dice-box.rolling {
  animation: dice-shake 0.6s infinite ease-in-out;
}
.dice-box:active {
  transform: scale(0.92);
}

@keyframes dice-shake {
  0% { transform: rotate(0deg) scale(1.05); }
  25% { transform: rotate(-15deg) scale(1.1); }
  50% { transform: rotate(15deg) scale(0.95); }
  75% { transform: rotate(-10deg) scale(1.08); }
  100% { transform: rotate(0deg) scale(1); }
}

.btn-roll-dice {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.95rem;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}
.btn-roll-dice:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-roll-dice:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.5);
}

/* Chat & Emoji Bar */
.chat-ribbon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0.2rem 0;
}
.chat-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.chat-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.emoji-btn {
  background: none;
  border: none;
  font-size: 1.35rem;
  cursor: pointer;
  transition: transform 0.15s;
  padding: 0.2rem 0.3rem;
}
.emoji-btn:hover { transform: scale(1.3); }

/* Floating Emoji Animation */
.emoji-float {
  position: absolute;
  font-size: 2.5rem;
  pointer-events: none;
  animation: float-up-fade 2s ease-out forwards;
  z-index: 100;
}
@keyframes float-up-fade {
  0% { transform: translateY(0) scale(0.5); opacity: 0; }
  20% { transform: translateY(-20px) scale(1.2); opacity: 1; }
  80% { transform: translateY(-70px) scale(1); opacity: 1; }
  100% { transform: translateY(-110px) scale(0.8); opacity: 0; }
}

/* Toast Notifications */
.toast-bar {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(50px);
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1000;
  white-space: nowrap;
}
.toast-bar.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Victory Modal */
.victory-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 1rem;
}
.victory-modal.active {
  opacity: 1;
  pointer-events: auto;
}
.victory-card {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 2px solid #f59e0b;
  box-shadow: 0 0 40px rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-lg);
  padding: 1.8rem 1.5rem;
  text-align: center;
  max-width: 380px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  transform: scale(0.85);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.victory-modal.active .victory-card {
  transform: scale(1);
}
.victory-trophy { font-size: 3.5rem; animation: bounce-trophy 1.2s infinite ease-in-out; }
@keyframes bounce-trophy {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.victory-title { font-family: var(--font-display); font-size: 1.6rem; color: #fcd34d; }
.victory-subtitle { font-size: 0.85rem; color: var(--text-muted); }

/* Responsive Tweaks */
@media (max-width: 480px) {
  .cangua-app-container { padding: 0.5rem 0.6rem; gap: 0.65rem; }
  .game-title { font-size: 1.25rem; }
  .dice-box { width: 44px; height: 44px; font-size: 1.8rem; }
  .btn-roll-dice { padding: 0.55rem 0.75rem; font-size: 0.78rem; }
  .player-name { font-size: 0.62rem; }
  .capacity-buttons { gap: 0.3rem; }
  .cap-num { font-size: 0.82rem; }
}
