/* Party Game - Modern Responsive Web Styling */
:root {
  --primary: #6C5CE7;
  --primary-light: #A29BFE;
  --secondary: #FF7675;
  --accent: #00CEC9;
  --warning: #FDCB6E;
  --danger: #D63031;
  --success: #00B894;
  --bg: #F8F9FE;
  --card-bg: #FFFFFF;
  --text-main: #2D3436;
  --text-muted: #636E72;
  --border: #DFE6E9;
  --shadow: 0 4px 14px rgba(108, 92, 231, 0.08);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.5;
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

#app-container {
  width: 100%;
  max-width: 600px;
  background: #FFF;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 30px rgba(0,0,0,0.05);
}

/* Header */
header {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  z-index: 50;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.lang-btn {
  background: #F1F2F6;
  border: none;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Main Content Area */
main {
  flex: 1;
  padding: 16px;
  padding-bottom: 90px;
  overflow-y: auto;
}

.tab-pane {
  display: none;
}
.tab-pane.active {
  display: block;
}

/* Bottom Navigation */
nav.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  height: 64px;
  background: #FFFFFF;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 60;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #B2BEC3;
  font-size: 11px;
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  transition: all 0.2s;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  margin-bottom: 3px;
}

.nav-item.active {
  color: var(--primary);
  font-weight: 700;
}

/* Cards & Badges */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.badge-primary { background: rgba(108, 92, 231, 0.12); color: var(--primary); }
.badge-secondary { background: rgba(255, 118, 117, 0.12); color: var(--secondary); }
.badge-success { background: rgba(0, 184, 148, 0.12); color: var(--success); }
.badge-warning { background: rgba(253, 203, 110, 0.25); color: #D63031; }

/* Hero Banner */
.hero-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #FFF;
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 8px 20px rgba(108, 92, 231, 0.25);
}

.hero-banner h2 { font-size: 20px; margin-bottom: 6px; }
.hero-banner p { font-size: 13px; opacity: 0.9; }

/* Section Header */
.section-title {
  font-size: 16px;
  font-weight: 700;
  margin: 18px 0 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Tools Carousel Horizontal */
.horizontal-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.horizontal-scroll::-webkit-scrollbar { display: none; }

.tool-chip {
  min-width: 90px;
  background: #FFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.tool-chip .icon-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin: 0 auto 8px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.tool-chip span { font-size: 12px; font-weight: 600; }

/* Scenarios Grid */
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.scenario-item {
  background: #FFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 4px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.scenario-item.selected {
  border-color: var(--primary);
  background: rgba(108, 92, 231, 0.06);
}

.scenario-item img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 6px;
}

.scenario-item span {
  font-size: 11px;
  font-weight: 600;
  display: block;
}

/* Modals & Overlays */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 100;
  justify-content: center;
  align-items: flex-end;
}

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

.modal-content {
  background: #FFF;
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  border-radius: 24px 24px 0 0;
  padding: 20px;
  overflow-y: auto;
  animation: slideUp 0.25s ease-out;
  position: relative;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-handle {
  width: 40px;
  height: 4px;
  background: #DFE6E9;
  border-radius: 2px;
  margin: 0 auto 16px auto;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn:hover { opacity: 0.9; }
.btn-primary { background: var(--primary); color: #FFF; }
.btn-secondary { background: var(--secondary); color: #FFF; }
.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-block { width: 100%; }

/* Search & Inputs */
.search-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: #F1F2F6;
  font-size: 13px;
  outline: none;
}

/* Tools Interactive Styles & Dynamic Animations */
.dice-container {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 20px 0;
  perspective: 600px;
}
.dice-face {
  width: 72px;
  height: 72px;
  background: linear-gradient(145deg, #FFFFFF, #F1F2F6);
  border-radius: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  align-items: center;
  justify-items: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12), inset 0 2px 4px #FFF, inset 0 -3px 6px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0,0,0,0.06);
  padding: 8px;
  box-sizing: border-box;
  transition: transform 0.2s ease;
  user-select: none;
}
.dice-pip {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2D3436;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.6), 0 1px 1px rgba(255,255,255,0.8);
}
.dice-pip.pip-center-red {
  background: #E84118;
  width: 16px;
  height: 16px;
}

@keyframes diceTumble {
  0% { transform: rotate(0deg) scale(0.85); }
  25% { transform: rotate(180deg) scale(1.18) translateY(-14px); }
  50% { transform: rotate(360deg) scale(0.9) translateY(0); }
  75% { transform: rotate(540deg) scale(1.12) translateY(-8px); }
  100% { transform: rotate(720deg) scale(1) translateY(0); }
}
.dice-face.rolling {
  animation: diceTumble 0.65s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.coin-container {
  perspective: 800px;
  margin: 16px auto;
}
.coin-circle {
  width: 124px;
  height: 124px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FFF8B5, #F9CA24 55%, #D48806 100%);
  margin: 16px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(212, 136, 6, 0.35), inset 0 3px 6px rgba(255,255,255,0.7), inset 0 -4px 8px rgba(115, 65, 0, 0.5);
  border: 4px solid #F6CF57;
  transition: transform 0.3s ease;
  user-select: none;
  cursor: pointer;
}
.coin-inner-ring {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  border: 1.5px dashed rgba(167, 102, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-shadow: 0 1px 2px rgba(255,255,255,0.8);
}

@keyframes coinFlip3D {
  0% { transform: translateY(0) rotateY(0deg) scale(1); }
  35% { transform: translateY(-80px) rotateY(900deg) scale(1.3); box-shadow: 0 30px 40px rgba(225, 112, 85, 0.45); }
  70% { transform: translateY(-20px) rotateY(1800deg) scale(1.1); }
  100% { transform: translateY(0) rotateY(2520deg) scale(1); }
}
.coin-circle.flipping {
  animation: coinFlip3D 0.85s cubic-bezier(0.25, 1, 0.5, 1);
}

.playing-card {
  width: 130px;
  height: 185px;
  border-radius: 16px;
  background: #FFF;
  margin: 16px auto;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.08);
  position: relative;
  padding: 10px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  user-select: none;
  transition: transform 0.2s ease;
}
.card-corner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
}
.card-corner-bottom {
  transform: rotate(180deg);
}
.card-center-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 56px;
  pointer-events: none;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.12));
}

@keyframes cardDealFlip {
  0% { transform: translateY(80px) rotateY(90deg) scale(0.65); opacity: 0; }
  60% { transform: translateY(-12px) rotateY(0deg) scale(1.08); opacity: 1; }
  85% { transform: translateY(4px) scale(0.98); }
  100% { transform: translateY(0) scale(1); }
}
.playing-card.dealing {
  animation: cardDealFlip 0.55s ease-out;
}

/* Metronome Modern Visualizer */
.metronome-visualizer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin: 16px 0 10px 0;
}
.metro-beat-pip {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #DFE6E9;
  border: 2px solid #FFF;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: all 0.08s ease;
}
.metro-beat-pip.active-accent {
  background: #FF7675;
  transform: scale(1.4);
  box-shadow: 0 0 14px rgba(255, 118, 117, 0.9);
}
.metro-beat-pip.active-regular {
  background: #00CEC9;
  transform: scale(1.3);
  box-shadow: 0 0 12px rgba(0, 206, 201, 0.8);
}
.metronome-pendulum-box {
  margin: 10px auto;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.15), rgba(162, 155, 254, 0.25));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(108, 92, 231, 0.2);
}
.metro-bpm-slider {
  flex: 1;
  max-width: 200px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Wheel Modern Styles */
.wheel-wrapper {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 16px auto;
}
.wheel-disc {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 4px solid #FFF;
  box-shadow: 0 8px 24px rgba(108, 92, 231, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: transform 3.6s cubic-bezier(0.12, 0.82, 0.26, 1.02);
}
.wheel-center-hub {
  position: absolute;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #FFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
  z-index: 5;
  text-align: center;
  padding: 4px;
  pointer-events: none;
}
.wheel-pointer {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 20px solid #D63031;
  z-index: 10;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
}
.wheel-pointer.bumping {
  animation: pointerBump 0.1s ease infinite alternate;
}
@keyframes pointerBump {
  0% { transform: translateX(-50%) rotate(0deg); }
  100% { transform: translateX(-50%) rotate(-7deg); }
}

/* Random Number Display Animation */
.number-display {
  font-size: 64px;
  font-weight: 900;
  color: var(--primary);
  margin: 14px 0;
  transition: all 0.2s ease;
  user-select: none;
}
@keyframes numberPopAnim {
  0% { transform: scale(0.6); opacity: 0.3; }
  60% { transform: scale(1.22); color: var(--accent); }
  100% { transform: scale(1); color: var(--primary); opacity: 1; }
}
.number-display.popping {
  animation: numberPopAnim 0.45s cubic-bezier(0.17, 0.89, 0.32, 1.28);
}

/* Metronome Pulse Animation */
@keyframes metronomePulseAnim {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(108, 92, 231, 0.6); }
  50% { transform: scale(1.15); box-shadow: 0 0 0 14px rgba(108, 92, 231, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(108, 92, 231, 0); }
}
.metronome-pulse {
  animation: metronomePulseAnim 0.3s ease-out;
}

/* Audio Waveform Ripple Animation */
.audio-wave-bars {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  height: 48px;
  margin: 14px 0;
}
.wave-bar {
  width: 6px;
  height: 12px;
  background: var(--primary);
  border-radius: 4px;
  animation: waveDanceAnim 0.7s ease-in-out infinite alternate;
}
.wave-bar:nth-child(2) { animation-delay: 0.15s; }
.wave-bar:nth-child(3) { animation-delay: 0.3s; }
.wave-bar:nth-child(4) { animation-delay: 0.45s; }
.wave-bar:nth-child(5) { animation-delay: 0.2s; }
@keyframes waveDanceAnim {
  0% { height: 10px; background: var(--primary); }
  50% { height: 42px; background: var(--accent); }
  100% { height: 18px; background: var(--secondary); }
}

/* Play Arena (Game Stage) Styles */
.arena-card {
  background: #FFF;
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: 0 6px 20px rgba(108, 92, 231, 0.08);
  margin-bottom: 14px;
  border: 1px solid var(--border);
}
.arena-header-banner {
  background: linear-gradient(135deg, #6C5CE7 0%, #A29BFE 100%);
  color: #FFF;
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(108, 92, 231, 0.25);
  position: relative;
  overflow: hidden;
}
.arena-tools-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 2px;
  margin: 12px 0;
  scrollbar-width: none;
}
.arena-tools-nav::-webkit-scrollbar { display: none; }
.arena-tool-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border: 1.5px solid var(--border);
  background: #FFF;
  cursor: pointer;
  transition: all 0.2s ease;
}
.arena-tool-pill.active {
  background: var(--primary);
  color: #FFF;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.arena-workspace {
  background: var(--bg);
  border-radius: 16px;
  padding: 16px;
  margin-top: 10px;
  border: 1.5px dashed rgba(108, 92, 231, 0.3);
  min-height: 220px;
}

/* Community Post Category Badges */
.post-cat-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.post-cat-tips { background: rgba(0, 206, 201, 0.15); color: #008f8c; }
.post-cat-rules { background: rgba(108, 92, 231, 0.15); color: #6C5CE7; }
.post-cat-fun { background: rgba(255, 118, 117, 0.15); color: #d63031; }
.post-cat-jokes { background: rgba(253, 121, 168, 0.2); color: #d63384; }
.post-cat-meetup { background: rgba(253, 203, 110, 0.3); color: #b7791f; }
.post-tag {
  font-size: 11px;
  color: var(--primary);
  background: rgba(108, 92, 231, 0.08);
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 500;
  display: inline-block;
  margin-right: 4px;
  margin-top: 4px;
}

.card-draw-box {
  background: #FFF;
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 16px 0;
  box-shadow: 0 6px 20px rgba(108, 92, 231, 0.08);
}
