/* Ludo King - Enhanced Styles */
:root {
  --bg: #0a0a14;
  --panel: #1a1a2e;
  --border: #2a2a4a;
  --text: #f0f0f5;
  --muted: #8888aa;
  --accent: #b7ff3c;
  --red: #ff6b6b;
  --blue: #54a0ff;
  --green: #1dd1a1;
  --yellow: #feca57;
}

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

body {
  background: linear-gradient(180deg, #0a0a14 0%, #1a1a2e 100%);
  color: var(--text);
  font-family: 'Chivo', system-ui, sans-serif;
  min-height: 100vh;
}

/* Breadcrumb Navigation */
.breadcrumb-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.back-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.breadcrumb {
  display: flex;
  list-style: none;
  gap: 8px;
}

.breadcrumb li::after {
  content: '›';
  margin-left: 8px;
  color: var(--muted);
}

.breadcrumb li:last-child::after {
  display: none;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.more-link {
  color: var(--muted);
  text-decoration: none;
}

@media (max-width: 500px) {
  .breadcrumb { display: none; }
}

/* Game Container */
.game-container {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  margin-bottom: 8px;
}

.game-title {
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--red), var(--yellow), var(--green), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 300% 300%;
  animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.game-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

#current-player {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--red);
}

.header-btns {
  display: flex;
  gap: 6px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--accent);
}

/* Board */
.board-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

#board-canvas {
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  max-width: 100%;
  height: auto;
  touch-action: manipulation;
}

/* Dice Area */
.dice-area {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: var(--panel);
  border-radius: 16px;
  border: 1px solid var(--border);
}

.dice-box {
  width: 64px;
  height: 64px;
  background: linear-gradient(145deg, #fff, #e8e8e8);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3), inset 0 2px 4px rgba(255,255,255,0.5);
}

#dice-value {
  font-size: 2.5rem;
}

#roll-btn {
  padding: 16px 28px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#roll-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 20px rgba(183,255,60,0.4);
}

#roll-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.kill-counter {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(255,107,107,0.2);
  border-radius: 8px;
  font-weight: 700;
}

#kill-count {
  color: var(--red);
  font-size: 1.2rem;
}

/* Game Message */
#game-message {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  padding: 12px 24px;
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-weight: 600;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 50;
  white-space: nowrap;
}

#game-message.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Player Select Modal */
#player-select {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 100;
}

#player-select.show {
  opacity: 1;
  visibility: visible;
}

.select-content {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.select-content h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--red), var(--yellow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.select-content p {
  color: var(--muted);
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.select-content h3 {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 20px 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Difficulty Select */
.difficulty-select {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}

.diff-btn {
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.diff-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.diff-btn.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* Player Options */
.player-options {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.player-btn {
  padding: 16px 20px;
  border: 2px solid var(--border);
  border-radius: 16px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  min-width: 90px;
}

.player-btn:hover {
  border-color: var(--accent);
  background: rgba(183,255,60,0.1);
}

.player-btn.local {
  border-color: var(--blue);
}

.player-btn.local:hover {
  border-color: var(--blue);
  background: rgba(84,160,255,0.1);
}

.player-btn .num {
  font-size: 1.8rem;
  font-weight: 800;
  display: block;
  margin-bottom: 4px;
}

.player-btn .label {
  font-size: 0.7rem;
  color: var(--muted);
}

.player-colors {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.color-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  cursor: help;
}

.color-dot.red { background: var(--red); }
.color-dot.blue { background: var(--blue); }
.color-dot.green { background: var(--green); }
.color-dot.yellow { background: var(--yellow); }

/* Win Screen */
#win-screen {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 100;
}

#win-screen.show {
  opacity: 1;
  visibility: visible;
}

.win-content {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px;
  text-align: center;
  max-width: 340px;
}

.win-trophy {
  font-size: 4rem;
  margin-bottom: 16px;
  animation: bounce 0.5s ease infinite alternate;
}

@keyframes bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-10px); }
}

#winner-name {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--accent);
}

.win-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 24px;
}

.win-stat {
  color: var(--muted);
  font-size: 0.9rem;
}

.win-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.share-btn {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.share-btn:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--accent);
}

#play-again-btn {
  padding: 16px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

#play-again-btn:hover {
  transform: scale(1.03);
}

/* Game Content */
.game-content {
  max-width: 560px;
  margin: 32px auto;
  padding: 0 16px;
}

.game-content section {
  margin-bottom: 32px;
}

.game-content h2 {
  color: var(--text);
  font-size: 1.2rem;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.game-content p {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.game-content ol,
.game-content ul {
  color: var(--muted);
  line-height: 1.8;
  padding-left: 24px;
  font-size: 0.9rem;
}

.game-content li {
  margin-bottom: 8px;
}

.game-content strong {
  color: var(--text);
}

/* Footer */
.bp-footer {
  margin-top: 32px;
  border-top: 1px solid var(--border);
  padding: 24px 16px;
}

.bp-footer__inner {
  max-width: 560px;
  margin: 0 auto;
}

.bp-footer__social {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}

.bp-footer__social-link {
  padding: 8px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
}

.bp-footer__social-link.instagram {
  background: rgba(225,48,108,0.2);
  color: #e1306c;
}

.bp-footer__social-link.twitter {
  background: rgba(29,161,242,0.2);
  color: #1da1f2;
}

.bp-footer__social-link.feedback {
  background: rgba(183,255,60,0.2);
  color: var(--accent);
}

.bp-footer__social-link:hover {
  transform: translateY(-2px);
}

.bp-footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--muted);
}

.bp-footer__bottom nav {
  display: flex;
  gap: 16px;
}

.bp-footer__bottom a {
  color: var(--muted);
  text-decoration: none;
}

.bp-footer__bottom a:hover {
  color: var(--accent);
}

/* Responsive */
@media (max-width: 520px) {
  #board-canvas {
    width: 320px !important;
    height: 320px !important;
  }

  .game-title { font-size: 1.3rem; }

  .dice-area {
    padding: 12px 16px;
    gap: 12px;
  }

  .dice-box {
    width: 52px;
    height: 52px;
  }

  #dice-value { font-size: 2rem; }

  #roll-btn {
    padding: 12px 20px;
    font-size: 0.9rem;
  }

  .select-content {
    padding: 24px 16px;
  }
}
