/* ================= RESET & BASE (Tailwind/Livewire compatible) ================= */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Base font and background */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background:
    /* BASE vertical stripes */
    repeating-linear-gradient(
      90deg,
      #d6e4d1 0px, #d6e4d1 140px,
      #c9d9e8 140px, #c9d9e8 280px,
      #e4cfcf 280px, #e4cfcf 420px,
      #e7d6a8 420px, #e7d6a8 560px
    ),
    /* stitch lines */
    repeating-linear-gradient(
      0deg,
      rgba(255,255,255,0.25) 0px,
      rgba(255,255,255,0.25) 2px,
      transparent 2px,
      transparent 40px
    ),
    /* subtle fabric grain */
    repeating-linear-gradient(
      90deg,
      rgba(0,0,0,0.03) 0px,
      rgba(0,0,0,0.03) 2px,
      transparent 2px,
      transparent 6px
    );
  background-blend-mode: multiply, overlay, normal;
}

/* Sun glow overlay (fixed) */
body::before {
  content: "";
  position: fixed;
  top: -120px;
  left: -120px;
  width: 550px;
  height: 900px;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(
      circle,
      rgba(255, 245, 180, 0.95) 0%,
      rgba(255, 230, 150, 0.65) 25%,
      rgba(255, 220, 120, 0.25) 50%,
      transparent 70%
    ),
    repeating-linear-gradient(
      45deg,
      rgba(255,255,255,0.22) 0px,
      rgba(255,255,255,0.22) 50px,
      transparent 50px,
      transparent 140px
    ),
    repeating-linear-gradient(
      45deg,
      rgba(255,255,255,0.12) 20px,
      rgba(255,255,255,0.12) 90px,
      transparent 90px,
      transparent 220px
    ),
    repeating-linear-gradient(
      45deg,
      rgba(255,255,255,0.08) 60px,
      rgba(255,255,255,0.08) 130px,
      transparent 130px,
      transparent 260px
    );
  background-blend-mode: screen;
  filter: blur(10px);
  mask-image: radial-gradient(
    circle at 30% 30%,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,0.9) 30%,
    rgba(0,0,0,0.5) 55%,
    rgba(0,0,0,0.2) 70%,
    transparent 85%
  );
}

/* ================= NAVBAR ================= */
/* Primary navbar block (keeps the richer version) */
.navbar {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 110px;
  padding: 0 180px;
  background: radial-gradient(circle at 30% 50%, rgba(175, 120, 60, 0.4) 0%, rgba(139, 90, 43, 0) 60%), url('fabric-pattern.png'), #8B5A2B;
  background-repeat: repeat;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

/* Stitching line (use stitch-segment.png) */
.navbar::after {
  content: "";
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  height: 4px;
  background-image: url('stitch-segment.png');
  background-repeat: repeat-x;
  pointer-events: none;
  z-index: 0;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  z-index: 5;
}
.logo img {
  height: 65px;
  filter: drop-shadow(0 0 15px rgba(255, 191, 0, 0.6)) drop-shadow(2px 2px 2px rgba(0,0,0,0.5));
  transition: transform 0.3s ease;
}
.logo:hover img { transform: scale(1.05); }

/* Nav links */
.nav-links {
  display: flex;
  list-style: none;
  gap: 20px;
  align-items: center;
  z-index: 5;
}
.nav-links a {
  text-decoration: none;
  color: #f7e6d2;
  font-weight: 500;
  font-size: 19px;
  padding: 10px 15px;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  text-shadow: 0 1px 1px rgba(0,0,0,0.2);
  font-weight: 600;
}
.nav-links a.active {
  background-color: rgba(60, 40, 20, 0.5);
  border-radius: 20px;
  padding: 8px 22px;
  box-shadow: inset 0 3px 5px rgba(0,0,0,0.4), 0 1px 0 rgba(255,255,255,0.15);
  color: #fff;
  font-weight: 600;
}

/* Right side user controls */
.user-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  z-index: 5;
}
.notification-icon { color: #fceee3; font-size: 18px; text-decoration: none; }
.user-menu {
  display: flex;
  align-items: center;
  background-color: #9e8d77;
  border: 1px dashed #5a4b3c;
  border-radius: 16px;
  padding: 12px 20px;
  box-shadow: 0 3px 5px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.2);
  cursor: pointer;
}
.user-dropdown {
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-dropdown .arrow { font-size: 10px; opacity: 0.8; }
.user-menu .divider {
  width: 1px;
  height: 16px;
  background-color: #6d5b4a;
  margin: 0 15px;
  box-shadow: 1px 0 0 rgba(255,255,255,0.1);
}

/* Ensure nav elements sit above decorative leaves */
.logo, .nav-links, .user-controls {
  position: relative;
  z-index: 2;
}

/* ================= DECORATIVE LEAVES ================= */
.left-leaves { left: 0; height: 260px; }
.right-leaves { right: 0; height: 260px; }
.decor-leaves { position: absolute; top: -10px; pointer-events: none; z-index: 1; }

/* On wide screens, push decorative leaves outward so they don't collide visually
   with the logo/user menu blocks. */
@media (min-width: 1200px) {
  /* .left-leaves { left: -40px; } */
  /* .right-leaves { right: -40px; } */
}

/* ================= PILLOWS / ICONS ================= */
.icon-hangers {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 30px;
  z-index: 1;
}

.pillow-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-origin: top;
  animation: sway 3s ease-in-out infinite alternate;
  width: 85px;
}

.pillow { width: 180px; height: 180px; }
.pillow.purple { width: 210px; height: 210px; }

.pillow-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 15px rgba(0,0,0,0.35));
}

@keyframes sway {
  0% { transform: rotate(-3deg); }
  100% { transform: rotate(3deg); }
}

/* ================= MAIN CONTENT ================= */
.main-content { margin-top: 180px; text-align: center; }

.main-title {
  font-size: 54px;
  font-weight: 600;
  margin-bottom: 10px;
  background: linear-gradient(90deg, #3cc3a0, #f9a825, #ff4081, #7c4dff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.main-subtitle { color: #202020; margin-bottom: 50px; font-weight: 600; font-size: 17px; }

/* ================= CARDS ================= */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 420px);
  gap: 50px;
  justify-content: center;
}

.card {
  position: relative;
  background: #caa472;
  padding: 14px;
  border-radius: 20px;
  box-shadow: 0 14px 25px rgba(0,0,0,0.25);
}

.card-top {
  position: absolute;
  top: -18px;
  left: 20px;
  background: #8b5a2b;
  color: #fff;
  padding: 8px 16px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 4px 0 #5a3b1c;
}

.card-body {
  background: #f3e4cc;
  border-radius: 14px;
  padding: 22px;
  text-align: left;
}
.card-body h3 { margin-bottom: 6px; }

/* ================= BUTTONS ================= */
.btn {
  margin-top: 15px;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  box-shadow: inset 0 -3px rgba(0,0,0,0.2);
}

/* Color variants */
.teal   { background: #26a69a; }
.orange { background: #fb8c00; }
.red    { background: #e53935; }

/* ================= FEATURES ================= */
.features {
  margin-top: 50px;
  display: flex;
  justify-content: center;
  gap: 40px;
  font-size: 14px;
}
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.green { background: #4caf50; }
.blue  { background: #42a5f5; }

/* ================= STORE / SPRITE BUTTONS ================= */
.store-buttons {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  gap: 20px;
}
.store-buttons img { height: 52px; transition: transform 0.2s ease; }
.store-buttons img:hover { transform: scale(1.05); }

/* Sprite-based button */
.btn {
  width: clamp(140px, 40vw, 220px);
  aspect-ratio: 260 / 110;
  background-image: url("store_buttons.png");
  background-size: 200% 200%;
  background-repeat: no-repeat;
  border-radius: 14px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  cursor: pointer;
}
.btn-play { background-position: left top; }
.btn-app  { background-position: right top; }
.btn:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 8px 16px rgba(0,0,0,0.25); }
.btn-play:hover { background-position: left bottom; }
.btn-app:hover  { background-position: right bottom; }

/* store-buttons small screens */
@media (max-width: 480px) {
  .store-buttons { flex-direction: column; align-items: center; }
  .btn { width: clamp(140px, 60vw, 200px); }
}

/* ================= HERO IMAGE & OVERLAYS ================= */
.hero-image { display: flex; justify-content: center; margin-bottom: 30px; }
.hero-image img { width: 420px; max-width: 90%; padding: 0 20px; }
.hero-image-wrapper { position: relative; display: inline-block; width: 420px; }
.hero-image-static { width: 100%; display: block; }

.star-overlay {
  position: absolute;
  top: 50px;
  left: 30px;
  width: 30px;
  height: 30px;
  background: radial-gradient(circle, gold, transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.hero-image-wrapper:hover .star-overlay {
  opacity: 1;
  animation: blink 1s infinite;
}
@keyframes blink {
  0%, 100% { transform: scale(0.1); }
  50% { transform: scale(0.2); }
}

/* ================= CAMPAIGN / DISCOVERY CARDS ================= */
.campaign_mode { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.campaign_mode:hover { transform: scale(1.05) rotate(1deg); cursor: pointer; }

.card-container {
  font-family: 'Fredoka', sans-serif;
  position: relative;
  width: 460px;
  max-width: 90vw;
  user-select: none;
}

.card-float-unit { position: relative; animation: mainFloat 4s ease-in-out infinite; }
.discovery-card .card-float-unit { animation-delay: 0.5s; }

.bg-image { width: 100%; height: auto; display: block; }

.header-title {
  font-weight: 600;
  position: absolute;
  top: 6.5%;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  width: 100%;
  text-align: center;
  font-size: 38px;
  color: #F9D949;
  text-shadow: 0px 3px 0px #7A4913, 0px 5px 8px rgba(0,0,0,0.3);
  pointer-events: none;
  white-space: nowrap;
}

.launch-button {
  position: absolute;
  bottom: 4.2%;
  left: 50%;
  transform: translateX(-50%);
  width: 65%;
  height: 8.5%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.button-text { font-size: 22px; font-weight: 600; white-space: nowrap; }

.campaign-card .button-text { color: white; text-shadow: 0px 2px 4px rgba(0,0,0,0.4); padding-right: 17px; }
.discovery-card .button-text { color: #35312f; padding: 0 10px; }
.discovery-card .launch-button { bottom: 6.5%; left: 57%; }

.launch-button:hover { transform: translateX(-50%) scale(1.08); filter: brightness(1.2) contrast(1.1); box-shadow: 0 0 20px rgba(255,255,255,0.4); }
.campaign-card:hover, .discovery-card:hover { transform: translateX(-5%) scale(1.08); filter: brightness(1.2) contrast(1.1); cursor: pointer; }
.discovery-card:hover { transform: translateX(5%) scale(1.08); }
.launch-button:active { transform: translateX(-50%) scale(0.95); filter: brightness(0.9); }

@keyframes mainFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
}

/* ================= PAGE WRAPPER & LAYOUT HELPERS ================= */
.page-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 40px;
  width: 100%;
}

/* ================= GROUP / BOARD STYLES (style_group.css) ================= */
:root {
  --wood-dark: #5a3b1f;
  --wood-medium: #8b5a2b;
  --cork: #a06a3d;
  --paper: #fdf1d6;
  --text-dark: #3e2714;
  --score-blue: #1e4bb5;
  --spacing: .25rem;
  --color-emerald-500: oklch(69.6% .17 162.48);
  --color-blue-500: oklch(62.3% .214 259.815);
  --color-purple-500: oklch(62.7% .265 303.9);
}

/* Group layout */
.flex { display: flex; }
section.flex{margin-top: 44px;}

.outer-frame {
  background: var(--wood-dark);
  padding: 12px;
  border-radius: 20px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.4);
  border: 4px solid #4a2e16;
}

.inner-board {
  display: flex;
  width: 920px;
  height: 500px;
  background: var(--wood-medium);
  border-radius: 12px;
  box-shadow: inset 0 0 50px rgba(0,0,0,0.4);
  position: relative;
  padding: 20px;
  gap: 20px;
  overflow: hidden;
  box-sizing: content-box;
}

/* Noise overlay for inner-board */
.inner-board::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    radial-gradient(rgba(0,0,0,0.05) 1px, transparent 1px);
  background-size: 3px 3px, 4px 4px;
  opacity: 0.25;
  pointer-events: none;
  background: url("noise_bg.png") repeat;
  box-shadow: inset 0 0 50px rgba(0,0,0,0.45), inset 0 0 20px rgba(90, 50, 20, 0.6);
}

.content-panel { flex: 1.2; display: flex; flex-direction: column; position: relative; }

.meta-header { color: #ffcc66; font-weight: 600; font-size: 13px; margin-bottom: 5px; display: flex; align-items: center; gap: 5px; }

.title { color: white; font-size: 42px; margin: 0; text-shadow: 2px 2px 0 rgba(0,0,0,0.2); font-weight: 700;}

.desc { color: #f1e3c5; font-size: 16px; line-height: 1.3; margin: 10px 0 20px; }

.steps-container { display: flex; flex-direction: column; gap: 10px; }

.parchment-step {
  background: var(--paper);
  color: var(--text-dark);
  padding: 10px 15px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 15px;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.15);
  position: relative;
  width: fit-content;
}
.parchment-step::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  background: #ff5e5e;
  border-radius: 50%;
  box-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.footer-btns { margin-top: auto; display: flex; gap: 10px; z-index: 1; }

.tag-pill { background: #ffffff33; color: white; padding: 6px 12px; border-radius: 20px; font-size: 13px; font-weight: 600; }

.browse-btn {
  margin-top: 15px;
  background: #b38b5d;
  border: 3px solid #724721;
  padding: 15px;
  border-radius: 12px;
  color: white;
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  box-shadow: 0 4px 0 #5a3b1f;
  cursor: pointer;
  z-index: 1;
  background: url("butn_brown_bg.png");
}

.fire-bg-image {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 70px;
  height: auto;
  z-index: 0;
  filter: drop-shadow(0 0 10px #ffcc66) brightness(1.1);
}

.scoreboard-panel {
  flex: 1;
  background: rgba(0,0,0,0.2);
  border-radius: 15px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.scoreboard-panel .ls_title {
  text-align: center;
  color: #f1e3c5;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
}

.player-row { display: flex; align-items: center; gap: 10px; }

.mascot-circle {
  width: 44px;
  height: 44px;
  background: #fff;
  border: 3px solid #6d4d2d;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  flex-shrink: 0;
}

.abacus-line { flex-grow: 1; height: 3px; background: #3e2714; display: flex; align-items: center; padding: 0 5px; }

.bead {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-right: 2px;
  background: radial-gradient(circle at 30% 30%, #fff, var(--bead-color));
  box-shadow: inset -2px -2px 4px rgba(0,0,0,0.3), 1px 1px 2px rgba(0,0,0,0.4);
}

.name-tag {
  background: white;
  padding: 6px 12px;
  font-weight: 600;
  font-size: 14px;
  min-width: 110px;
  display: flex;
  justify-content: space-between;
  clip-path: polygon(0% 0%, 92% 0%, 100% 50%, 92% 100%, 0% 100%);
}

.val { color: var(--score-blue); }

.room-code-box {
  margin-top: auto;
  background: #fdf1d6;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 2px;
  color: #3e2714;
  border: 2px dashed #8b5a2b;
}

/* ================= UTILITIES & HELPERS ================= */
.text-gray-500 { color: var(--color-gray-500); }
.gap-8 { gap: calc(var(--spacing) * 8); }
.gap-2 { gap: calc(var(--spacing) * 2); }
.bg-emerald-500 { background-color: var(--color-emerald-500); }
.rounded-full { border-radius: 3.40282e38px; }
.w-2 { width: calc(var(--spacing) * 2); }
.h-2 { height: calc(var(--spacing) * 2); }
.py-16 { padding-bottom: calc(var(--spacing) * 16); }

/* Bush images */
.bush-bg-image {
  position: absolute;
  bottom: 21px;
  right: 20px;
  width: 122px;
  height: auto;
  z-index: 1;
}
.bush-bg-image.bush-bg-image2 {
  right: 33px;
  width: 111px;
  filter: drop-shadow(0 0 10px #3a433b) brightness(1.1);
  opacity: 0.3;
}

/* ================= RESPONSIVE QUERIES ================= */
/* Tablet and below */
@media (max-width: 768px) {
  body { padding: 8px; padding-top: 0; }

  .left-leaves, .right-leaves { height: 180px; }

  .outer-frame { border-radius: 12px; padding: 8px; }

  .inner-board {
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    height: auto;
    padding: 12px;
    gap: 12px;
    display: flex;
    box-sizing: border-box;
  }

  .content-panel, .scoreboard-panel { width: 100%; flex: none; display: flex; box-sizing: border-box; }

  .footer-btns { margin-top: 22px; }

  .title { font-size: 28px; text-align: left; line-height: 1.2; }

  .desc { margin: 8px 0 16px; }

  .parchment-step { font-size: 13px; padding: 6px 10px; max-width: 100%; }

  .tag-pill { font-size: 11px; padding: 4px 8px; }

  .browse-btn { font-size: 16px; padding: 10px; width: 100%; text-align: center; display: block; box-sizing: border-box; }

  .fire-bg-image { width: 95px; bottom: 60px; }

  .scoreboard-panel { padding: 12px; gap: 10px; }

  .scoreboard-panel .ls_title { font-size: 16px; }

  .player-row { flex-wrap: wrap; gap: 6px; }

  .mascot-circle { width: 32px; height: 32px; }

  .bead { width: 10px; height: 10px; }

  .name-tag { font-size: 12px; min-width: 80px; padding: 4px 8px; }

  .room-code-box { font-size: 14px; padding: 8px; letter-spacing: 1px; word-break: break-word; }

  .header-title { font-size: 30px; }
  .button-text { font-size: 18px; }
}

/* Mobile phones */
@media (max-width: 480px) {
  .left-leaves, .right-leaves { height: 120px; }

  .title { font-size: 22px; }

  .room-code-box { font-size: 12px; padding: 6px; letter-spacing: 0.5px; }

  .store-buttons { flex-direction: column; align-items: center; }

  .btn { width: clamp(140px, 60vw, 200px); }
}

@media (max-width: 400px) {

  body::before{
      height: 400px;
  }
  
  .pillow-container{
      width: 50px;
  }
  
  .main-title {
      font-size: 29px;
  }
}