:root {
  --bg1: #ffecd2;
  --bg2: #fcb69f;
  --card: #ffffff;
  --accent: #ff5a7a;
  --muted: #7b7b7b;
  --glass: rgba(255,255,255,0.22);
  --ig-blue: #4c6ef5;
  --ig-btn-grad-start: #6b7bff;
  --ig-btn-grad-end: #758bff;
}
* { box-sizing: border-box; -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale; }
html,body{height:100%;}
body {
  margin: 0;
  font-family: "Poppins", system-ui, Segoe UI, Roboto, "Helvetica Neue", Arial;
  background: radial-gradient(800px 400px at 10% 10%, #fff3f0 0%, transparent 20%),
              radial-gradient(600px 300px at 90% 90%, #fffaf0 0%, transparent 20%),
              linear-gradient(120deg, var(--bg1), var(--bg2));
  min-height: 100vh;
  color: #222;
  display: flex;
  align-items: center;        /* center on smaller viewports; overridden on desktop */
  justify-content: center;
  padding: 40px;
  -webkit-text-size-adjust: 100%;
}

/* container */
.container {
  width: 100%;
  max-width: 1100px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: start;
}

.left {
  background: linear-gradient(180deg, rgba(255,255,255,0.7), rgba(255,255,255,0.55));
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  backdrop-filter: blur(6px);
  /* allow visible overflow so nothing is clipped on desktop */
  overflow: visible;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

header.app-header { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.logo { width: 64px; height: 64px; border-radius: 12px; background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.6) 40%), conic-gradient(from 180deg at 50% 50%, #ffd3b6, #ffb199, #ff8fa1, #ffd3b6); display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--accent); font-size: 20px; box-shadow: 0 8px 20px rgba(255,90,122,0.12); }
h1 { margin: 0; font-size: 22px; line-height:1.1; }
p.lead { margin: 0; color: var(--muted); font-size: 14px; }

/* menu */
.menu-wrap { margin-left: auto; position: relative; }
.menu-btn { display: inline-flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(0,0,0,0.06); background: rgba(255,255,255,0.85); cursor: pointer; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display:inline-flex; align-items:center; justify-content:center; font-weight:700; background: linear-gradient(90deg,#ffd3b6,#ffb199); color: white; }
.menu-name { font-weight:700; font-size:14px; color:#222; }
.menu-arrow { font-size:12px; color:var(--muted); }
.menu-dropdown { position: absolute; right: 0; top: calc(100% + 8px); background: white; border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,0.12); padding: 8px; min-width: 160px; display: none; z-index: 50; }
.menu-dropdown a, .menu-dropdown button { display: block; width: 100%; text-align: left; padding: 10px; border-radius: 8px; background: transparent; border: none; cursor: pointer; font-weight:600; color:#333; }
.menu-dropdown a:hover, .menu-dropdown button:hover { background: #f9f9f9; }

/* hamburger for mobile */
.hamburger { display: none; background: transparent; border: none; font-size: 20px; }

.cards { margin-top: 18px; display: grid; gap: 14px; }

.card {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 12px;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(11,11,11,0.04);
  transition: transform .18s ease, box-shadow .18s;
  word-break: break-word;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 18px 30px rgba(0,0,0,0.08); }

/* thumbnail */
.thumb {
  width: 84px;
  height: 64px;
  border-radius: 10px;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 -10px 30px rgba(0,0,0,0.06);
}

.meta { flex: 1; min-width: 0; } /* min-width:0 to allow text to truncate/wrap properly in flex */
.meta h3 { margin: 0; font-size: 16px; }
.meta p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height:1.2; word-break:break-word; }

.vote { text-align: center; min-width: 120px; display:flex; flex-direction:column; align-items:center; gap:8px; }
.vote button { background: linear-gradient(135deg, var(--accent), #ff7b9a); border: none; color: white; padding: 8px 12px; border-radius: 10px; font-weight: 700; cursor: pointer; box-shadow: 0 8px 18px rgba(255,90,122,0.18); white-space:nowrap; }
.votes-count { display: block; margin-top: 0; font-weight: 700; color: #333; font-size:13px; }

.leader { margin-top: 18px; }
.leader h4 { margin: 0 0 8px 0; }
.leader ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.leader li { display: flex; justify-content: space-between; padding: 10px; border-radius: 8px; background: var(--glass); font-weight: 700; }

/* overlays / modal */
.overlay { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: linear-gradient(90deg, rgba(15,15,15,0.45), rgba(0,0,0,0.35)); z-index: 40; padding: 20px; }
.modal { width: 420px; max-width: calc(100% - 32px); background: white; border-radius: 12px; padding: 18px; box-shadow: 0 30px 80px rgba(0,0,0,0.35); }

.modal h3 { margin: 0 0 6px 0; }
.modal form { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.modal input { padding: 10px; border-radius: 8px; border: 1px solid #eee; width:100%; box-sizing:border-box; }

.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.btn-ghost { background: transparent; border: 1px solid #ddd; padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.btn-primary { background: linear-gradient(135deg, var(--accent), #ff7b9a); color: white; border: none; padding: 8px 12px; border-radius: 8px; cursor: pointer; }

.choice-btn { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid #eee; border-radius: 8px; margin-top: 8px; cursor: pointer; }
.choice-btn:hover { background: #f9f9f9; }

.ig-login { text-align: center; padding: 14px 10px 4px 10px; }
.ig-logo { font-family: "Pacifico", cursive; font-size: 40px; color: #222; margin-bottom: 14px; }
.ig-form { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.ig-form input { padding: 12px 14px; border-radius: 6px; border: 1px solid #e6e6e6; font-size: 14px; }
.ig-submit { margin-top: 6px; padding: 10px 12px; border-radius: 8px; border: none; color: white; font-weight: 700; cursor: pointer; background: linear-gradient(90deg, var(--ig-btn-grad-start), var(--ig-btn-grad-end)); box-shadow: 0 8px 18px rgba(80,100,255,0.12); }

.tt-login { text-align: center; padding: 12px 16px; }
.tt-header { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 8px; }
.tt-logo { width: 34px; height: 34px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(45deg, #000, #111); color: white; font-weight: 800; font-size: 18px; }
.tt-title { font-weight: 800; font-size: 18px; color: #111; }
.tt-form { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.tt-form input { padding: 10px; border-radius: 8px; border: 1px solid #eee; }
.tt-submit { padding: 10px; border-radius: 8px; border: none; background: #111; color: white; font-weight: 800; cursor: pointer; box-shadow: 0 8px 18px rgba(0,0,0,0.12); }

/* Slider Styles */
.slider-container { position: relative; width: 100%; height: 300px; overflow: hidden; border-radius: 12px; margin-bottom: 20px; flex: 0 0 auto; }
.slider { display: flex; width: 100%; height: 100%; transition: transform 0.5s ease-in-out; }
.slide { min-width: 100%; height: 100%; background-size: cover; background-position: center; display: flex; align-items: flex-end; justify-content: center; }
.slide-caption { background: rgba(0,0,0,0.6); color: white; padding: 10px 20px; border-radius: 8px; margin-bottom: 20px; font-size: 18px; font-weight: 600; max-width: 95%; text-align:center; }
.slider-dots { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.dot { width: 10px; height: 10px; background: rgba(255,255,255,0.5); border-radius: 50%; cursor: pointer; transition: background 0.3s; }
.dot.active { background: var(--accent); }

/* Footer Styles */
.main-footer { background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0.7)); padding: 40px 20px; text-align: center; margin-top: 40px; border-radius: 12px; box-shadow: 0 -10px 30px rgba(0,0,0,0.08); backdrop-filter: blur(6px); }
.main-footer h3 { margin: 0; font-size: 24px; color: var(--accent); font-family: "Pacifico", cursive; }
.main-footer p { margin: 10px 0; color: var(--muted); font-size: 14px; }
.footer-links { display: flex; justify-content: center; gap: 20px; margin-top: 10px; flex-wrap:wrap; }
.footer-links a { color: var(--accent); text-decoration: none; font-weight: 600; transition: color 0.3s; }
.footer-links a:hover { color: #ff7b9a; }
.footer-animation { margin-top: 20px; }
.footer-animation svg { width: 100px; height: 50px; }
.footer-animation path { fill: none; stroke: var(--accent); stroke-width: 4; stroke-dasharray: 100; stroke-dashoffset: 100; animation: drawHeart 2s infinite alternate; }
@keyframes drawHeart { to { stroke-dashoffset: 0; } }

/* responsive tweaks */
@media (max-width: 980px) {
  .container { grid-template-columns: 1fr; padding: 10px; }
}

/* ---- FULLSCREEN MOBILE LAYOUT ----
   make the app occupy the full viewport on narrow screens,
   slider = immersive top area, cards area scrolls, footer pinned */
@media (max-width: 720px) {
  body { padding: 0; align-items: stretch; justify-content: flex-start; }
  .container { grid-template-columns: 1fr; padding: 0; gap: 0; max-width: 100%; height: 100vh; }
  .left {
    border-radius: 0;
    padding: 12px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }

  /* immersive slider height relative to viewport */
  .slider-container { height: 36vh; border-radius: 0; margin-bottom: 12px; }
  .slide-caption { font-size: 16px; padding: 8px 14px; margin-bottom: 12px; }

  /* make cards scrollable area */
  .cards {
    margin-top: 0;
    display: grid;
    gap: 12px;
    flex: 1 1 auto;
    overflow: auto;
    padding-right: 10px; /* room for scrollbar */
  }

  /* stack cards vertically and make images full width */
  .card {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px;
  }
  .thumb { width: 100%; height: 160px; border-radius: 10px; }
  .meta { padding: 0 4px; }
  .meta h3 { font-size: 17px; }
  .vote { min-width: 0; width: 100%; text-align: left; flex-direction:row; justify-content:space-between; align-items:center; padding: 0 4px 4px; }
  .vote button { width: auto; flex-shrink:0; padding: 10px 14px; }
  .votes-count { margin-left: 8px; font-size:13px; }

  /* footer pinned to bottom of .left */
  .main-footer {
    margin-top: 12px;
    padding: 16px;
    border-radius: 0;
    box-shadow: none;
    flex-shrink: 0;
  }

  .logo { width: 56px; height: 56px; font-size: 18px; border-radius: 10px; }

  .hamburger { display: inline-block; }
  .menu-wrap { margin-left: 8px; }
}

@media (max-width: 420px) {
  .slider-container { height: 32vh; }
  .slide-caption { font-size: 14px; padding: 8px 12px; margin-bottom: 10px; }
  .thumb { height: 140px; }
  h1 { font-size: 20px; }
  p.lead { font-size: 13px; }
  .main-footer h3 { font-size: 20px; }
}

/* DESKTOP / LARGE-SCREEN IMPROVEMENTS (do not affect mobile) */
@media (min-width: 981px) {
  /* keep page aligned to top (don't vertically center huge left panel) */
  body { align-items: flex-start; padding: 48px 60px; }

  /* slightly larger slider for desktop */
  .slider-container { height: 360px; }

  /* show cards as two columns on large screens to avoid vertical overflow */
  .cards {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
  }

  .card {
    padding: 14px;
    align-items: center;
  }

  .thumb { width: 160px; height: 112px; border-radius: 12px; }

  /* make vote area a bit narrower on desktop but visible */
  .vote { min-width: 120px; width: 140px; align-items:center; }

  /* ensure cards area scrolls if the content exceeds viewport height */
  .left {
    max-height: calc(100vh - 96px);
    overflow: auto;
  }

  /* ensure footer isn't covering content */
  .main-footer { margin-top: 28px; }
}

/* small accessibility focus states */
button:focus, .choice-btn:focus { outline: 3px solid rgba(255,90,122,0.18); outline-offset:2px; }

/* styles.css */

