/* fonts */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;500;700&family=Quicksand:wght@300;400;600;700&family=Roboto+Condensed:ital,wght@0,300;0,700;1,300;1,700&family=Roboto:ital,wght@0,300;0,400;0,700;1,300;1,700&display=swap');




:root{
  --bg-dark-1: #06150c; /* very dark green */
  --bg-dark-2: #0c3d2a; /* mid */
  --bg-dark-3: #0f5f41;
  --accent-turq: #20e7c12e; /* turquoise gentle glows */
  --accent-turq-strong: #20e7c1d9;
  --card-bg: #060a08b8;
  --text: #f0f0eb; /* ivory/light color for all text */
}

/* base */
* { box-sizing: border-box; }
html,body {
  color-scheme: dark !important;
  min-height: 100vh;
  margin:0;
  padding:0;
  background: linear-gradient(180deg, var(--bg-dark-1) 0%, var(--bg-dark-2) 45%, var(--bg-dark-3) 100%);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  
}



/* outer container centers content and gives outer glow */
.app-outer {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 2rem;
}

/* foreground app window (wider, centered) */
.app-window {
  width: 100%;
  flex: 1 0 auto;
  max-width: 1280px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(6,10,8,0.86), rgba(8,14,10,0.78));
  border-left: 1px solid #ffffff08;
  border-right: 1px solid #ffffff08;
  box-shadow: 0 10px 30px rgba(2,8,6,0.6), inset 0 1px 0 rgba(255,255,255,0.02);
  overflow: hidden;
  position: relative;
  padding: 0.5rem 0 1.25rem;
  color: white !important; 
  padding-bottom: 2rem;

}

/* top thin integrated bar */
.topbar{
  padding:0.45rem 0.75rem;
  background: linear-gradient(180deg, rgba(6,10,8,0.86), rgba(8,14,10,0.78));
  display:flex;
  justify-content:flex-end;
  align-items:center;
  color: white !important;
  font-family: 'Roboto Condensed', sans-serif !important;

}

.user-jokers{
  font-size: 18px;
  margin-left: -1rem;
  color: #e47200;
}

.user-points{
  font-size: 18px;
  margin-left: -1rem;
  color: #00d800;
}

#avatar-img{
  width: 1.5rem; 
  height: 1.5rem;
  border-radius: 50%;
  margin-right:0.25rem;
}

/* header */
.main-header{
  display:flex;
  align-items:center;
  gap:1rem;
  padding:1.15rem 1.25rem;
  position:relative;
  background: inherit; /* match main container */
}

/* logo */
.logo-wrap { flex: 0 0 auto; }
.site-logo {
  height: auto;
  width: 300px;
  object-fit:fill;
  display: flex;
  align-items: center;
  margin-right: 1rem;
  
}

/* centered nav container */
.nav-wrap { flex: 1 1 auto; display:flex; justify-content:center; max-width: 40rem;}
.nav { --bs-nav-link-padding-x: 1rem; display:flex; gap: 1rem; }
.nav .nav-link{
  color: var(--text);
  padding: 0.45rem 0.85rem;
  font-weight:600;
  letter-spacing:0.2px;
  text-align:center;
  font-family: 'Roboto Condensed', sans-serif !important;
}
.nav .nav-link:hover,
.nav .nav-link:focus {
  color: var(--accent-turq-strong);
  text-decoration:none;
}

/* main content area */
.main-content {
  padding:1.25rem 1.75rem;
  min-height: 52vh;
  color: var(--text); /* light fonts */
  margin-bottom: 1rem !important;
}

/* cards inside content should be slightly translucent */
.card, .content-panel {
  background-color: transparent !important;
  border: none !important;
  color: ivory !important;
  padding: 1rem;
}

/* footer */
.site-footer {
  background: var(--bg-dark-1);
  padding: 0.85rem 1.25rem;
  border-top: 1px solid #ffffff05;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  color: var(--muted);
  text-align: center;
  width: 100% !important;
  margin-top: 2rem;
  color: white;
}

.footer-link-container{
  max-width: 30rem;
  margin-right: 10rem;
  padding: 1rem;
  color: white;
  text-align: center;
}

.footer-link{
  color: white;
}


/* Floating Chat Button */
.chat-floating-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: linear-gradient(180deg,#10b981,#047857);
  color: white;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 26px;
  cursor: pointer;
  z-index: 99999;
  box-shadow: 0 8px 30px rgba(6, 30, 20, 0.55);
  transition: transform .12s ease, box-shadow .12s ease;
}
.chat-floating-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(6,30,20,0.65);
}

/* Chat window (default desktop layout) */
.chat-window {
  position: fixed;
  bottom: calc(64px + 16px); /* Always sits above the chat button */
  right: 24px;
  width: 360px;
  max-width: calc(100% - 48px);
  height: 480px;

  display: flex;
  flex-direction: column;

  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(6,12,8,0.95), rgba(8,14,10,0.95));
  border: 1px solid rgba(32,231,193,0.06);
  box-shadow: 0 18px 60px rgba(2,10,6,0.6);

  transform: translateY(12px) scale(.99);
  opacity: 0;
  pointer-events: none;
  transition: all .18s cubic-bezier(.2,.9,.3,1);

  z-index: 99999;
}
.chat-window.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* Enforce readable colors */
.chat-header,
.chat-messages,
.chat-message,
.chat-message-own,
.chat-input-area {
  color: var(--text);
}

/* Chat internal structure */
.chat-header {
  flex: 0 0 auto;
}

.chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 10px;
}

.chat-input-area {
  flex: 0 0 auto;
  padding: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(6,12,8,0.95);
  border-top: 1px solid rgba(255,255,255,0.05);
}









.chat-message {
  margin-bottom: 8px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
}
.chat-message-own { background: linear-gradient(90deg, rgba(13,110,253,0.16), rgba(13,110,253,0.06)); }
.chat-msg-meta { font-size: 0.8rem; color: #cad; display:flex; gap:8px; align-items:center; }
.chat-msg-body { margin-top:4px; white-space:pre-wrap; }
.chat-avatar { width:20px; height:20px; border-radius:50%; object-fit:cover; margin-right:6px; }
.chat-username { margin-right:6px; font-weight:700; }
.chat-ts { margin-left:auto; font-size:0.75rem; opacity:0.7; }
.chat-badge {
  position:absolute;
  top: -6px;
  right: -6px;
  min-width:20px;
  height:20px;
  border-radius:999px;
  background:#dc3545;
  color:#fff;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:0.75rem;
  padding:0 6px;
}

#chat-floating-btn { position:fixed; } 






.emote-wrap {
  position: relative;
  flex: 0 0 auto;
}

.chat-emote-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  width: min(260px, calc(100vw - 32px));
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  background: rgba(6, 12, 8, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  z-index: 100000;
}

.chat-emote-menu[hidden] {
  display: none;
}

.chat-emote-item {
  border: 0;
  background: transparent;
  border-radius: 8px;
  aspect-ratio: 1 / 1;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text);
}

.chat-emote-item:hover,
.chat-emote-item:focus {
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}









/* force white label on the closed button and ensure it looks disabled */
.save-closed-btn,
.save-closed-btn[disabled] {
  background-color: #6c757d !important;
  border-color: #6c757d !important;
  color: #ffffff !important;             
  cursor: not-allowed;
  box-shadow: none !important;
  opacity: 1 !important;                
}

/* disabled prediction display inputs styling (readable) */
.prediction-inputs input[disabled] {
  background-color: #ffffff !important;
  color: #000 !important;
  opacity: 1 !important;
}











/* -----------------------
   Toast styles (bottom-right)
   ----------------------- */

#toast-container {
  position: fixed;
  bottom: 100px;
  right: 18px;
  z-index: 1080;
  display: flex !important;
  flex-direction: column;
  gap: 10px;
  max-width: calc(100vw - 40px);
  pointer-events: none; /* allow clicks to pass through gaps */
}

/* Individual toast */
.toast {
  pointer-events: auto; /* allow clicks on the toast */
  min-width: 220px;
  max-width: 420px;
  padding: 1rem;
  background: rgba(40,40,40,0.95);
  color: #fff;
  font-family: 'Roboto Condensed', sans-serif;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  overflow: hidden;
  transform-origin: top right;
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transition: transform 280ms cubic-bezier(.2,.9,.2,1), opacity 220ms ease;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
}


/* show */
.toast.toast-show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* hide */
.toast.toast-hide {
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
}

/* toast body */
.toast .toast-body {
  padding: 0.6rem 0.9rem;
  font-size: 0.95rem;
  line-height: 1.2;
  flex: 1 1 auto;
}

/* close button */
.toast .toast-close {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.9);
  padding: 0.45rem 0.6rem;
  font-size: 1.05rem;
  cursor: pointer;
  opacity: 0.9;
}

/* success / error variants */
.toast-success { background: linear-gradient(180deg,#087f4a,#076f3f); }
.toast-error { background: linear-gradient(180deg,#b02a37,#941a22); }
.toast-info { background: linear-gradient(180deg,#0d6efd,#0b5ed7); }











/* -----------------------
   Save button flip animation
   ----------------------- */

/* make button visually neutral */
.save-bet-btn.flip-btn {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  perspective: 900px;
  position: relative;
  overflow: visible;
}

/* inner rotating panel */
.save-bet-btn .flip-inner {
  display: block;
  transform-style: preserve-3d;
  transition: transform 560ms cubic-bezier(.2,.9,.2,1);
  transform-origin: center center;
  will-change: transform;
}

/* avoid layout jumps */
.save-bet-btn .face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.375rem 0.75rem;   
  border-radius: 0.25rem;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-sizing: border-box;
  font-weight: 700;
}

/* front (Save) */
.save-bet-btn .face.front {
  transform: rotateX(0deg) translateZ(0);
  background: #0d6efd;
  color: #fff;
}

/* back (Saved) */
.save-bet-btn .face.back {
  transform: rotateX(180deg) translateZ(0);
  background: #198754;
  color: #fff;
}

/* rotate when flipped */
.save-bet-btn.flipped .flip-inner {
  transform: rotateX(180deg);
}

/* small visual press when clicked */
.save-bet-btn.pressed {
  transform: scaleY(0.96);
  transition: transform 90ms ease;
}

/* reduce motion respect */
@media (prefers-reduced-motion: reduce) {
  .save-bet-btn .flip-inner,
  .save-bet-btn.pressed { transition: none !important; transform: none !important; }
}














/* -----------------------------
   RESPONSIVE SCREEN WIDTH RULES
   ----------------------------- */

@media (max-width: 991px) {
  .chat-window {
    right: 14px;
    width: 320px;
    height: 420px;
  }
}



/* Header + Navigation: Mobile layout (800px and below) */
@media (max-width: 800px) {

  /* Stack header vertically */
  .main-header {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 0.85rem;
    text-align: center;
  }

  /* Logo centered and scaled down */
  .site-logo {
    width: 220px;   
    margin: 0 auto;
  }

  /* Full-width navigation container */
  .nav-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  /* Turn nav into vertical stack */
  .nav {
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 0.35rem;
  }

  .nav .nav-link {
    width: 100%;
    text-align: center;
    padding: 0.65rem 0;
  }
}






html.chat-scroll-locked,
body.chat-scroll-locked {
  overflow: hidden;
  height: 100%;
}





/* Mobile chat: full-screen overlay with bottom composer */
@media (max-width: 640px) {
  .chat-floating-btn {
    width: 56px;
    height: 56px;
    right: 16px;
    bottom: 16px;
    font-size: 24px;
  }

  .chat-window {
    position: fixed;
    top: var(--chat-top, 0px);
    left: 0;
    width: 100vw;
    max-width: none;
    height: var(--chat-vh, 100dvh);
    border-radius: 0;
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
    flex-direction: column;
  }

  .chat-window.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .chat-header {
    flex: 0 0 auto;
    padding: 14px 16px;
  }

  .chat-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 14px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .chat-input-area {
    flex: 0 0 auto;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    gap: 8px;
  }

  #chat-input {
    min-width: 0;
    flex: 1 1 auto;
  }

  #chat-send-btn {
    flex: 0 0 auto;
  }
}



/* Compact chat mode for short viewports: always vertical */
@media (max-height: 650px) and (min-width: 641px) {
  .chat-window {
    top: 12px;
    right: 12px;
    bottom: 12px;
    width: min(520px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    height: auto;
    border-radius: 12px;
    flex-direction: column;
  }

  .chat-messages {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .chat-input-area {
    flex: 0 0 auto;
  }
}








/* FINAL KILL OF BOOTSTRAP FOCUS RING ON JOKER BUTTON (mobile + desktop) */
.joker-toggle-btn:focus,
.joker-toggle-btn:focus-visible,
.joker-toggle-btn:active,
.joker-toggle-btn.is-active:focus {
  outline: none !important;
  box-shadow: none !important;
  border-color: inherit !important;
}

/* Make sure the active state never shows the ring */
.joker-toggle-btn.is-active {
  box-shadow: none !important;
}
