/* ============================================================
   KIDCHAT GLOBAL RESET + THEME FOUNDATION
=========================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #0d0f1a;
  color: #ffffff;
  font-family: 'Nunito', system-ui, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:root {
  --kc-bg-dark: #0d0f1a;
  --kc-bg-panel: #141726;
  --kc-bg-sub: #1f2336;

  --kc-accent-blue: #4fc3f7;
  --kc-accent-cyan: #00e5ff;
  --kc-accent-red: #ff5252;

  --kc-text-main: #ffffff;
  --kc-text-soft: rgba(255,255,255,0.7);

  --kc-radius: 12px;
  --kc-shadow: 0 0 20px rgba(0,0,0,0.4);
}

/* ============================================================
   KIDCHAT APP WRAPPER
=========================================================== */

.kc-app {
  width: min(100% - 32px, 1120px);
  margin: 0 auto;
  padding: 24px 0 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.kc-app > * {
  width: 100%;
}

/* ============================================================
   TOP BAR
=========================================================== */

.kc-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: var(--kc-bg-panel);
  padding: 16px 20px;
  border-radius: var(--kc-radius);
  box-shadow: var(--kc-shadow);
}

.kc-logo-orb {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: radial-gradient(circle at top, var(--kc-accent-blue), var(--kc-bg-sub));
  box-shadow: 0 0 20px rgba(79,195,247,0.6);
}

.kc-title {
  font-size: 1.8rem;
  font-weight: 800;
}

.kc-subtitle {
  font-size: 0.9rem;
  opacity: 0.7;
}

/* ============================================================
   UNIVERSAL PANELS
=========================================================== */

.kc-panel {
  background: var(--kc-bg-panel);
  padding: 20px;
  border-radius: var(--kc-radius);
  box-shadow: var(--kc-shadow);
  animation: panelSlide 0.4s ease-out;
}

.kc-panel > * + *,
.kc-story-panel > * + *,
.kc-worldmap-panel > * + * {
  margin-top: 16px;
}

/* ============================================================
   AVATAR
=========================================================== */

.kc-avatar-ui {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.kc-avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle at top, #60a5fa, #1f2937);
  position: relative;
  box-shadow: 0 10px 25px rgba(0,0,0,0.6);
  animation: avatarFloat 3s ease-in-out infinite;
}

.kc-eyes {
  position: absolute;
  top: 35%;
  left: 50%;
  width: 60%;
  height: 18px;
  transform: translateX(-50%);
  display: flex;
  justify-content: space-between;
}

.kc-eyes::before,
.kc-eyes::after {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  animation: blink 4s infinite;
}

.kc-mouth {
  position: absolute;
  bottom: 25%;
  left: 50%;
  width: 40px;
  height: 20px;
  transform: translateX(-50%);
  border-radius: 50%;
  border: 3px solid #f9fafb;
}

/* ============================================================
   XP BAR + STATS
=========================================================== */

.kc-xp-bar {
  width: 100%;
  height: 10px;
  background: #374151;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.kc-xp-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #a3e635);
  transition: width 0.4s ease-in-out;
}

.kc-level,
.kc-balance {
  font-size: 0.9rem;
  color: #d1d5db;
}

/* ============================================================
   CHAT WINDOW
=========================================================== */

.kc-chat-window {
  background: #030712;
  padding: 12px;
  border-radius: var(--kc-radius);
  height: 240px;
  overflow-y: auto;
  border: 1px solid #1f2937;
}

.kc-message {
  padding: 8px 10px;
  margin-bottom: 6px;
  background: #111827;
  border-radius: 8px;
  font-size: 0.9rem;
  animation: messageFade 0.3s ease-out;
}

/* ============================================================
   INPUT AREA
=========================================================== */

.kc-input-area {
  display: flex;
  gap: 8px;
  align-items: center;
}

.kc-input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #4b5563;
  background: #030712;
  color: #f9fafb;
}

.kc-input::placeholder {
  color: #6b7280;
}

/* ============================================================
   BUTTONS
=========================================================== */

.kc-btn {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.9rem;
  background: #2563eb;
  color: #f9fafb;
  transition: background 0.2s ease, transform 0.1s ease;
}

.kc-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 0 10px rgba(37,99,235,0.6);
}

.kc-btn:active {
  transform: translateY(0);
}

.kc-btn-mic {
  background: #10b981;
  animation: lumPulse 2.5s infinite;
}

.kc-btn-mic:hover {
  background: #059669;
}

/* ============================================================
   STORY MODE
=========================================================== */

.kc-story-panel {
  background: var(--kc-bg-panel);
  padding: 20px;
  border-radius: var(--kc-radius);
  animation: panelSlide 0.4s ease-out;
}

.kc-story-text {
  background: #030712;
  padding: 12px;
  border-radius: var(--kc-radius);
  margin-bottom: 12px;
  min-height: 120px;
  border: 1px solid #374151;
}

.kc-story-line {
  animation: storyFade 0.4s ease-out;
  margin-bottom: 8px;
}

/* ============================================================
   COMBAT UI
=========================================================== */

.kc-combat-ui {
  background: #030712;
  padding: 12px;
  border-radius: var(--kc-radius);
  border: 1px solid #374151;
  margin-bottom: 12px;
}

.kc-combat-name {
  font-size: 0.9rem;
  color: #e5e7eb;
  margin-bottom: 4px;
}

.kc-combat-hp-bar {
  width: 100%;
  height: 12px;
  background: #1f2937;
  border-radius: 999px;
  overflow: hidden;
}

.kc-hp-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #22c55e, #4ade80);
  transition: width 0.3s ease;
}

.kc-damage {
  color: #f87171;
  font-weight: bold;
  animation: damagePop 0.4s ease-out;
  text-align: center;
}

/* ============================================================
   WORLD MAP
=========================================================== */

.kc-worldmap-panel {
  background: var(--kc-bg-panel);
  padding: 20px;
  border-radius: var(--kc-radius);
  animation: panelSlide 0.4s ease-out;
}

.kc-worldmap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.kc-region {
  flex: 1;
  min-width: 120px;
  padding: 12px;
  background: #030712;
  border: 1px solid #374151;
  border-radius: var(--kc-radius);
  color: #e5e7eb;
  transition: all 0.3s ease;
}

.kc-region:hover {
  background: #1e3a8a;
  box-shadow: 0 0 12px rgba(59,130,246,0.7);
}

.kc-region.unlocked {
  border-color: #22c55e;
  box-shadow: 0 0 12px rgba(34,197,94,0.7);
}

.kc-region-info {
  background: #030712;
  padding: 12px;
  border-radius: var(--kc-radius);
  border: 1px solid #374151;
  min-height: 120px;
}

@media (max-width: 640px) {
  .kc-app {
    width: min(100% - 20px, 1120px);
    padding-top: 12px;
  }

  .kc-topbar,
  .kc-input-area {
    align-items: stretch;
    flex-direction: column;
  }

  .kc-panel,
  .kc-story-panel,
  .kc-worldmap-panel {
    padding: 16px;
  }

  .kc-input-area .kc-btn {
    width: 100%;
  }
}

/* ============================================================
   ANIMATIONS
=========================================================== */

@keyframes lumPulse {
  0% { box-shadow: 0 0 10px rgba(255,255,255,0.2); }
  50% { box-shadow: 0 0 20px rgba(255,255,255,0.5); }
  100% { box-shadow: 0 0 10px rgba(255,255,255,0.2); }
}

@keyframes avatarFloat {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-4px); }
  100% { transform: translateY(0px); }
}

@keyframes blink {
  0%, 90%, 100% { height: 16px; }
  95% { height: 2px; }
}

@keyframes messageFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes panelSlide {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes damagePop {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes storyFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.kc-bubble{
    max-width:75%;
    padding:12px 16px;
    margin:10px 0;
    border-radius:18px;
    animation:kidchatPop .25s ease-out;
    box-shadow:0 4px 12px rgba(0,0,0,.25);
    word-wrap:break-word;
}

.kc-bubble-player{
    background:#2563eb;
    color:#fff;
    margin-left:auto;
    border-bottom-right-radius:4px;
}

.kc-bubble-system{
    background:#374151;
    color:#fff;
    margin-right:auto;
    border-bottom-left-radius:4px;
}

@keyframes kidchatPop{

    from{
        opacity:0;
        transform:translateY(15px) scale(.95);
    }

    to{
        opacity:1;
        transform:translateY(0) scale(1);
    }
}

.kidchat-boss-portrait {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid #66ff66;
    display: block;
}



