* {
  text-align: center;
}

.navbar a {color: greenyellow;}
.navbar a:visited {color: greenyellow;}

body {
  font-family: sans-serif;
  font-size: small;
  margin: 0;
  padding: 20px;
  background-color: #362700;
  color: #ffffff;
}

small {
  font-size: 14px;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.done {
  animation: hidelol 2.3s forwards;
}

.feedback {
  padding: 15px;
  margin: 20px auto;
  max-width: 600px;
  border-radius: 5px;
  animation: revealInfo 2.3s forwards;
}

.feedback.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.feedback.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.guess-history {
  margin-top: 30px;
}

.guess-item {
  display: flex;
  max-width: 1200px;
  padding: 15px;
  margin: 15px auto;
  border: orange 2px solid;
  border-radius: 8px;
  background-color: rgba(255, 165, 0, 0.05);
  gap: 15px;
  align-items: stretch;
}

.binfo {
  flex: 0 0 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 10px;
  border: 1px dotted orange;
  border-radius: 6px;
  background-color: rgba(0, 0, 0, 0.2);
}

.binfo img {
  width: 100%;
  max-width: 150px;
  margin-bottom: 10px;
}

.binfo h3 {
  margin: 5px 0;
  font-size: 18px;
  color: #ffa500;
}

.charinfo {
  animation: revealInfo 2.3s forwards;
}

.winfo {
  flex: 0 0 200px;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 10px;
  border: 1px dotted orange;
  border-radius: 6px;
  background-color: rgba(0, 0, 0, 0.2);
  max-width: 50%;
  margin: auto;
}

@keyframes spin {
    from {
      transform: rotate(0deg);
    }
    to {
      transform: rotate(360deg);
    }
}

.winfo img {
  width: 100%;
  max-width: 100px;
  margin-bottom: 10px;
  margin-right: 50px;
  animation: spin 1s linear infinite;
}

.winfo h3 {
  margin: 5px 0;
  font-size: 32px;
  color: #ffa500;
}

.attributes {
  flex: 1;
  display: grid;
  align-items: stretch;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  padding: 10px;
  border: 1px dotted orange;
  border-radius: 6px;
  background-color: rgba(0, 0, 0, 0.2);
}

@keyframes revealAttribute {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes revealInfo {
  0% {
    height: 0;
    width: 0;
    opacity: 0;
  }
  80% {
    height: 0;
    width: 0;
    opacity: 0;
  }
  90% {
    opacity: 0;
  }
  100% {
    height: auto;
    width: auto;
    opacity: 1;
  }
}

@keyframes hidelol {
  0% {
    height: auto;
    width: auto;
    opacity: 1;
  }
  80% {
    height: auto;
    width: auto;
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    height: 0;
    width: 0;
    opacity: 0;
  }
}

.attribute {
  padding: 12px 8px;
  border-radius: 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 60px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  opacity: 0;
  animation: revealAttribute 0.2s forwards;
}

.attribute:hover {
  transform: translateY(-2px);
}

/* Staggered animation for individual attributes in the first guess */
.guess-item:first-child .attributes .attribute:nth-child(1) { animation-delay: 0s; }
.guess-item:first-child .attributes .attribute:nth-child(2) { animation-delay: 0.3s; }
.guess-item:first-child .attributes .attribute:nth-child(3) { animation-delay: 0.6s; }
.guess-item:first-child .attributes .attribute:nth-child(4) { animation-delay: 0.9s; }
.guess-item:first-child .attributes .attribute:nth-child(5) { animation-delay: 1.2s; }
.guess-item:first-child .attributes .attribute:nth-child(6) { animation-delay: 1.5s; }
.guess-item:first-child .attributes .attribute:nth-child(7) { animation-delay: 1.8s; }
.guess-item:first-child .attributes .attribute:nth-child(8) { animation-delay: 2.1s; }

/* Older guesses show immediately */
.guess-item:not(:first-child) .attributes .attribute {
  opacity: 1;
  animation: none;
}

.attribute.correct {
  background: #4caf50;
  color: #ffffff;
  border: 2px solid #2e7d32;
}

.attribute.wrong {
  background: #666666;
  color: #ffffff;
  border: 2px solid #333333;
}

.attribute.yellow {
  background: #ffc107;
  color: #000000;
  border: 2px solid #ff9800;
}

.attribute.up {
  position: relative;
  background-color: #666;
  border: 2px solid #333;
  color: white;
  overflow: hidden; /* ensure no weird overflow */
}

/* the arrow */
.attribute.up::before {
  content: "";
  position: absolute;
  inset: 0; /* full area */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23A12000' stroke='darkred' stroke-width='2'><path d='M12 9l-6 6h12z'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 67px; /* make bigger/smaller here */
  opacity: 1;
  z-index: 0;
}

/* ensure text stays above arrow */
.attribute.up * {
  position: relative;
  z-index: 1;
}

.attribute.down {
  position: relative;
  background-color: #666;
  border: 2px solid #333;
  color: white;
  overflow: hidden; /* ensure no weird overflow */
}

/* the arrow */
.attribute.down::before {
  content: "";
  position: absolute;
  inset: 0; /* full area */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23A12000' stroke='darkred' stroke-width='2'><path d='M12 15l6-6H6z'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 67px; /* make bigger/smaller here */
  opacity: 1;
  z-index: 0;
}

/* ensure text stays above arrow */
.attribute.down * {
  position: relative;
  z-index: 1;
}

.attribute-name {
  font-weight: bold;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
  opacity: 0.9;
}

.attribute-value {
  font-size: 15px;
  font-weight: 600;
  margin-top: 3px;
}

form {
  margin: 20px auto;
  max-width: 600px;
}

input[type="text"] {
  padding: 10px;
  font-size: 16px;
  border: 2px solid orange;
  border-radius: 5px;
  background-color: #1a1a1a;
  color: white;
  width: 300px;
  margin: 0 10px;
}

input[type="text"]:focus {
  outline: none;
  border-color: #ffa500;
  box-shadow: 0 0 10px rgba(255, 165, 0, 0.5);
}

input[type="submit"] {
  background: #4CAF50;
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 5px;
  padding: 10px 20px;
  font-size: 16px;
  transition: background 0.3s;
}

input[type="submit"]:hover {
  background: #45a049;
}

.reset-btn {
  background: #f44336;
  color: white;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 5px;
  display: inline-block;
  margin-top: 20px;
  transition: background 0.3s;
}

.reset-btn:hover {
  background: #da190b;
}

.imgdelay {
  animation-duration: 0s;
}

.crop {
    width: 300px;
    height: 200px;
    overflow: hidden;
    margin: auto;
}

.crop img {
    transform: scale(4);
    transform-origin: 80% 30%;
}

/* mobile design */
@media (max-width: 768px) {
  .guess-item {
    flex-direction: column;
    max-width: 95%;
  }
  
  .binfo {
    flex: 0 0 auto;
  }
  
  .attributes {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  }
}

/* =========================================
   INSTAGRAM EXPORT VIEWER — append to styles.css
   ========================================= */

/* ── Login page ── */
.chat-login-wrap {
  max-width: 360px;
  margin: 40px auto;
}
.chat-login-wrap h2 { color: #ffa500; }

/* ── Inbox list ── */
.chat-index-wrap { max-width: 520px; margin: 0 auto; }
.chat-index-wrap h2 { color: #ffa500; }

#convo-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }

.convo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid #5a3a00;
  border-radius: 10px;
  background: rgba(255,165,0,.05);
  text-decoration: none;
  color: #fff;
  transition: background .12s, border-color .12s;
  text-align: left;
}
.convo-item:hover { background: rgba(255,165,0,.12); border-color: orange; }

.convo-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, #f09433, #dc2743);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.1rem; color: #fff; flex-shrink: 0;
}
.convo-name { font-weight: 600; font-size: .95rem; color: #ffa500; }
.convo-folder { font-size: .72rem; color: #666; margin-top: 2px; }

/* ── Chat header ── */
.chat-header {
  display: flex; align-items: center; gap: 10px;
  background: #1a1000;
  border: 1px solid #3a2500;
  border-radius: 10px;
  padding: 8px 14px;
  margin-bottom: 10px;
  max-width: 720px;
  margin-left: auto; margin-right: auto;
}
.chat-back { color: #ffa500; text-decoration: none; font-size: .9rem; margin-right: 4px; }
.chat-back:hover { color: #ffcc66; }
.chat-header-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #f09433, #dc2743);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem; color: #fff; flex-shrink: 0;
}
.chat-header-name { font-weight: 600; font-size: .97rem; color: #fff; }

/* ── Message scroll area ── */
.messages-wrap {
  max-width: 720px;
  margin: 0 auto 8px;
  max-height: 65vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 4px;
  /* subtle scrollbar */
  scrollbar-width: thin;
  scrollbar-color: #3a2500 transparent;
}

/* ── Date divider ── */
.chat-date-divider {
  text-align: center;
  color: #664400;
  font-size: .7rem;
  margin: 12px 0 4px;
  position: relative;
}
.chat-date-divider::before, .chat-date-divider::after {
  content: ""; position: absolute; top: 50%;
  width: 28%; height: 1px; background: #3a2500;
}
.chat-date-divider::before { left: 0; }
.chat-date-divider::after  { right: 0; }

/* ── Reaction note (e.g. "Liked a message") ── */
.reaction-note {
  display: flex; align-items: center; justify-content: center;
  gap: 5px; font-size: .72rem; color: #775500;
  margin: 2px 0; flex-wrap: wrap;
}
.reaction-who  { font-weight: 600; color: #996600; }
.reaction-label { font-style: italic; }
.reaction-ts   { color: #554400; }

/* ── Message row ── */
.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}
.msg-row.me { flex-direction: row-reverse; }

/* Timestamp — shown on hover */
.msg-ts {
  font-size: .65rem; color: #554400;
  white-space: nowrap; opacity: 0;
  transition: opacity .15s; align-self: center;
}
.msg-row:hover .msg-ts { opacity: 1; }

/* Small sender avatar for their side */
.bubble-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: #3a2500;
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem; font-weight: 700; color: #ffa500;
  flex-shrink: 0; margin-bottom: 2px;
}
.bubble-avatar-hidden { visibility: hidden; }

/* ── Bubbles ── */
.bubble {
  max-width: min(70%, 460px);
  padding: 8px 13px;
  border-radius: 20px;
  font-size: .88rem;
  line-height: 1.45;
  word-break: break-word;
  text-align: left;
}
.bubble-them {
  background: #2a1800;
  border: 1px solid #4a2e00;
  color: #f0d090;
  border-bottom-left-radius: 5px;
}
.bubble-me {
  background: #7a4a00;
  border: 1px solid #aa6a00;
  color: #fff8e8;
  border-bottom-right-radius: 5px;
}

/* Media inside bubbles */
.bubble-media {
  max-width: 100%;
  max-height: 320px;
  border-radius: 12px;
  display: block;
  margin-top: 6px;
  border: 1px solid #4a3000;
}

/* Shared link card */
.share-card {
  display: block;
  margin-top: 7px;
  padding: 7px 10px;
  border: 1px solid #5a3a00;
  border-radius: 10px;
  text-decoration: none;
  color: #cc8800;
  font-size: .8rem;
  background: rgba(0,0,0,.2);
  transition: border-color .12s;
}
.share-card:hover { border-color: orange; color: #ffaa00; }
.share-title { font-weight: 600; color: #ffa500; margin-bottom: 2px; }
.share-url   { color: #886600; word-break: break-all; }

/* Inline emoji reactions on a message */
.inline-reactions {
  margin-top: 5px;
  display: flex; gap: 4px; flex-wrap: wrap;
}
.inline-reaction {
  background: rgba(255,165,0,.12);
  border: 1px solid #5a3a00;
  border-radius: 12px;
  padding: 1px 6px;
  font-size: .8rem;
  cursor: default;
}

/* ── Bottom bar (decorative) ── */
.chat-bottom-bar {
  max-width: 720px; margin: 0 auto;
  background: #1a1000;
  border: 1px solid #3a2500;
  border-radius: 10px;
  padding: 8px 14px;
  display: flex; align-items: center; gap: 10px;
}
.fake-input {
  flex: 1;
  background: #2a1800;
  border: 1px solid #4a2e00;
  border-radius: 16px;
  padding: 6px 14px;
  color: #554400;
  font-size: .82rem;
  user-select: none;
}

/* ── Pagination bar ── */
.chat-pagination {
  max-width: 720px; margin: 6px auto 4px;
  display: flex; align-items: center; justify-content: center;
  gap: 8px; flex-wrap: wrap;
  font-size: .82rem;
}
.page-btn {
  padding: 4px 10px;
  border: 1px solid #5a3a00;
  border-radius: 6px;
  background: rgba(255,165,0,.07);
  color: #ffa500;
  text-decoration: none;
  transition: background .12s, border-color .12s;
  white-space: nowrap;
}
.page-btn:hover { background: rgba(255,165,0,.18); border-color: orange; color: #ffcc66; }
.page-btn.disabled { color: #443300; border-color: #2a1800; cursor: default; pointer-events: none; }
.page-info { color: #cc8800; text-align: center; line-height: 1.6; }
.page-sub  { color: #664400; font-size: .75rem; }
.page-jump {
  width: 52px;
  background: #1a1000;
  border: 1px solid #5a3a00;
  border-radius: 5px;
  color: #ffa500;
  padding: 2px 5px;
  font-size: .8rem;
  text-align: center;
}
.page-jump:focus { outline: none; border-color: orange; }
.page-jump-btn {
  background: rgba(255,165,0,.15);
  border: 1px solid #5a3a00;
  border-radius: 5px;
  color: #ffa500;
  padding: 2px 7px;
  font-size: .8rem;
  cursor: pointer;
  transition: background .12s;
}
.page-jump-btn:hover { background: rgba(255,165,0,.28); }

/* ── Scrollbar styling for messages-wrap ── */
.messages-wrap::-webkit-scrollbar { width: 6px; }
.messages-wrap::-webkit-scrollbar-track { background: transparent; }
.messages-wrap::-webkit-scrollbar-thumb { background: #5a3a00; border-radius: 3px; }
.messages-wrap::-webkit-scrollbar-thumb:hover { background: #aa6a00; }


@media (max-width: 600px) {
  .messages-wrap { max-height: 60vh; }
  .bubble { max-width: 85%; }
}

/* ── Search results ── */
.chat-header-search {
  margin-left: auto;
  font-size: 1rem;
  text-decoration: none;
  opacity: .6;
  transition: opacity .15s;
}
.chat-header-search:hover { opacity: 1; }

#results-list { display: flex; flex-direction: column; gap: 6px; }

.search-result {
  display: block;
  padding: 10px 14px;
  border: 1px solid #4a2e00;
  border-radius: 10px;
  background: rgba(255,165,0,.04);
  text-decoration: none;
  color: inherit;
  transition: background .12s, border-color .12s;
  text-align: left;
}
.search-result:hover { background: rgba(255,165,0,.11); border-color: orange; }

.sr-meta {
  display: flex; gap: 10px; align-items: baseline;
  flex-wrap: wrap; margin-bottom: 4px;
}
.sr-name   { font-weight: 700; color: #ffa500; font-size: .88rem; }
.sr-sender { color: #886600; font-size: .78rem; }
.sr-time   { color: #554400; font-size: .73rem; margin-left: auto; white-space: nowrap; }

.sr-snippet {
  font-size: .83rem;
  color: #c8a060;
  line-height: 1.45;
  word-break: break-word;
}