:root {
  --bg: #0f1420;
  --panel: #1a2233;
  --panel-light: #232d42;
  --text: #eef1f8;
  --muted: #9aa5b8;
  --accent: #4f8cff;
  --danger: #ff5c6c;
  --safe: #35c98f;
  --warn: #ffb347;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #17203a 0%, var(--bg) 60%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  padding: 24px;
}

#app { max-width: 1100px; margin: 0 auto; }

.screen { display: none; flex-direction: column; align-items: center; gap: 16px; }
.screen.active { display: flex; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px);} to { opacity: 1; transform: translateY(0);} }
.screen.active { animation: fadeIn 0.25s ease; }

/* ---------- Start / End screens ---------- */
#start-screen, #end-screen { text-align: center; max-width: 480px; margin: 60px auto; }
.title-art { width: 100%; max-width: 320px; border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,0.5); margin-bottom: 4px; }
.title-art.category-art { margin-top: 20px; max-width: 260px; }
h1 { margin: 0; font-size: 2rem; }
.tagline { color: var(--muted); margin: 0; }
.stat-line { color: var(--muted); font-size: 0.9rem; margin: 0; }
.high-score { color: var(--warn); font-size: 0.9rem; min-height: 1.2em; }

.btn {
  border: none; border-radius: 999px; padding: 14px 28px;
  font-size: 1rem; font-weight: 600; cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: white; }

.card { width: 100%; background: var(--panel); border-radius: var(--radius); padding: 22px; box-shadow: 0 8px 30px rgba(0,0,0,0.35); }
.final-card { text-align: center; }
.final-score { font-size: 1.6rem; font-weight: 700; margin: 4px 0; }
.final-accuracy { color: var(--muted); margin: 4px 0; }
.final-message { margin-top: 12px; }

/* ---------- Game layout ---------- */
.game-layout { width: 100%; align-items: stretch; }

.game-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.game-topbar-right { display: flex; gap: 8px; }
.icon-btn {
  background: var(--panel);
  color: var(--text);
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.icon-btn:hover { background: var(--panel-light); }
.icon-btn.quit { color: var(--danger); }
.icon-btn.quit:hover { background: rgba(255,92,108,0.12); }
.icon-btn.sb-link { color: var(--accent); }

.back-to-site-link {
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: none;
  margin-top: -6px;
}
.back-to-site-link:hover { color: var(--accent); }

.scoreboard {
  width: 100%;
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.score-cell {
  flex: 1;
  background: var(--panel);
  border-radius: 10px;
  padding: 10px 6px;
  text-align: center;
}
.score-cell span { display: block; font-size: 1.4rem; font-weight: 800; }
.score-cell label { font-size: 0.7rem; color: var(--muted); letter-spacing: 0.05em; }
.score-cell.points-cell span { color: var(--warn); }

.game-columns {
  display: grid;
  grid-template-columns: minmax(240px, 340px) 1fr;
  gap: 18px;
  width: 100%;
  align-items: start;
}

@media (max-width: 760px) {
  .game-columns { grid-template-columns: 1fr; }
}

.left-col { display: flex; flex-direction: column; gap: 14px; }

.panel {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.scenario-pill {
  display: inline-block;
  background: var(--panel-light);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.mission-brief h2 { margin: 6px 0 8px; font-size: 1.15rem; }
.mission-brief p { margin: 0; color: var(--muted); line-height: 1.5; font-size: 0.92rem; }

.notepad h3 {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--warn);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
#notepad-body p { margin: 0; line-height: 1.5; font-size: 0.92rem; }
#notepad-body .verdict-line { font-weight: 700; margin-bottom: 4px; }
#notepad-body .verdict-line.correct { color: var(--safe); }
#notepad-body .verdict-line.incorrect { color: var(--danger); }

.notepad-log {
  margin-top: 10px;
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.log-entry {
  font-size: 0.85rem;
  line-height: 1.4;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--panel-light);
  animation: fadeIn 0.2s ease;
}
.log-entry.good { border-left: 3px solid var(--safe); }
.log-entry.bad { border-left: 3px solid var(--danger); }

.next-btn { align-self: flex-start; }

/* ---------- App window (mock Mail/Messages/etc) ---------- */
.right-col { display: flex; }

.app-window {
  width: 100%;
  background: #f4f6fa;
  color: #1c2333;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  position: relative;
  display: flex;
  flex-direction: column;
}

.app-window {
  width: 100%;
  background: #f4f6fa;
  color: #1c2333;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 420px;
}
.app-window.bare {
  background: transparent;
  box-shadow: none;
  min-height: 0;
  border-radius: 0;
}

#skin-mount { flex: 1; display: flex; flex-direction: column; }

/* Shared field label used inside skins */
.field-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8a93a6;
  margin-top: 14px;
}
.field-label:first-child { margin-top: 0; }

/* ---------- Email client skin ---------- */
.email-skin .mail-toolbar {
  background: #fff; border-bottom: 1px solid #e0e3eb;
  padding: 10px 18px; display: flex; align-items: center; gap: 14px;
  font-size: 0.85rem; color: #5a6376; font-weight: 700;
}
.email-skin .mail-toolbar .icon { opacity: 0.55; font-size: 1rem; cursor: default; }
.email-skin .mail-meta { padding: 16px 20px 0; font-size: 0.85rem; color: #5a6376; line-height: 1.7; border-bottom: 1px solid #e0e3eb; padding-bottom: 14px; }
.email-skin .mail-meta b { color: #1c2333; }
.email-skin .mail-subject { font-size: 1.05rem; font-weight: 700; margin: 14px 20px 4px; }
.email-skin .mail-body { padding: 4px 20px 20px; white-space: pre-wrap; line-height: 1.7; font-size: 0.95rem; }

/* ---------- SMS / phone-frame skin ---------- */
.sms-skin { display: flex; justify-content: center; align-items: center; padding: 4px 0 10px; width: 100%; }
.phone-frame {
  width: 230px;
  background: #111; border-radius: 30px; padding: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  position: relative;
}
.phone-frame::before {
  content: '';
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 60px; height: 16px; background: #111; border-radius: 0 0 10px 10px; z-index: 3;
}
.phone-frame::after {
  content: '';
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  width: 70px; height: 4px; background: rgba(255,255,255,0.55); border-radius: 3px; z-index: 3;
}
.phone-frame.wide { width: 300px; }
.phone-frame.dark { background: #000; }
.phone-screen { background: #fff; border-radius: 22px; overflow: hidden; min-height: 340px; display: flex; flex-direction: column; }
.phone-screen.call-screen { background: linear-gradient(180deg, #2b3350 0%, #1c2333 100%); }
.phone-statusbar {
  height: 26px; background: #fff; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; font-size: 0.68rem; font-weight: 700; color: #1c2333;
}
.phone-statusbar.dark { background: transparent; color: #fff; }
.phone-header {
  background: #f7f7f8; padding: 10px 14px 8px; text-align: center;
  border-bottom: 1px solid #e5e5ea; font-size: 0.8rem; font-weight: 700; color: #1c2333;
}
.phone-header .ph-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: #c7cbd6; margin: 0 auto 4px;
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.phone-header .ph-sub { font-weight: 400; color: #8a93a6; font-size: 0.72rem; }
.phone-messages { padding: 14px 12px; flex: 1; }
.phone-messages .sms-time { font-size: 0.68rem; color: #9aa5b8; text-align: center; margin-bottom: 8px; }
.phone-inputbar {
  border-top: 1px solid #e5e5ea; padding: 8px 10px; display: flex; align-items: center; gap: 8px;
}
.phone-inputbar .input-pill {
  flex: 1; background: #f0f0f3; border-radius: 999px; padding: 7px 14px; font-size: 0.78rem; color: #9aa5b8;
}
.phone-inputbar .send-btn {
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 0.85rem; font-weight: 800;
}

/* ---------- Call screen skin ---------- */
.call-skin-wrap { display: flex; justify-content: center; padding: 4px 0; width: 100%; }
.call-skin {
  align-items: center; justify-content: flex-start; padding: 20px 20px 20px;
  display: flex; flex-direction: column; color: #fff;
}
.call-status { font-size: 0.8rem; color: #b8c0d8; letter-spacing: 0.04em; margin-bottom: 18px; }
.call-avatar {
  width: 84px; height: 84px; border-radius: 50%; background: #3d4766;
  display: flex; align-items: center; justify-content: center; font-size: 2rem; margin-bottom: 14px;
}
.call-name { font-size: 1.2rem; font-weight: 700; text-align: center; }
.call-number { color: #b8c0d8; font-size: 0.88rem; margin-top: 2px; margin-bottom: 20px; }
.call-buttons { display: flex; gap: 36px; margin-bottom: 18px; }
.call-btn-circle {
  width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; color: #fff;
}
.call-btn-circle.decline { background: var(--danger); }
.call-btn-circle.accept { background: var(--safe); }
.call-transcript-box {
  background: rgba(255,255,255,0.08); border-radius: 12px; padding: 14px 16px;
  width: 100%; margin-top: 6px; white-space: pre-wrap; line-height: 1.6; font-size: 0.83rem; text-align: left;
  max-height: 220px; overflow-y: auto;
}
.waveform { display: flex; align-items: flex-end; gap: 3px; height: 34px; margin: 4px 0 14px; }
.waveform span { width: 3px; background: #7f8ad1; border-radius: 2px; }
.vm-player { width: 100%; display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.vm-play-btn {
  width: 34px; height: 34px; border-radius: 50%; background: #fff; color: #1c2333;
  display: flex; align-items: center; justify-content: center; font-size: 0.8rem; flex-shrink: 0;
}
.vm-scrub { flex: 1; height: 4px; background: rgba(255,255,255,0.2); border-radius: 2px; position: relative; }
.vm-scrub-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 28%; background: #7f8ad1; border-radius: 2px; }
.vm-scrub-dot { position: absolute; left: 28%; top: 50%; transform: translate(-50%, -50%); width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.vm-time { font-size: 0.68rem; color: #b8c0d8; flex-shrink: 0; }

/* ---------- Browser skin ---------- */
.browser-skin { flex: 1; display: flex; flex-direction: column; }
.browser-tabs { background: #dfe2ea; display: flex; align-items: flex-end; padding: 8px 8px 0; gap: 2px; }
.browser-tab {
  background: #fff; border-radius: 8px 8px 0 0; padding: 7px 10px 7px 16px; font-size: 0.78rem;
  color: #4a5266; font-weight: 600; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: flex; align-items: center; gap: 10px;
}
.browser-tab .tab-x { opacity: 0.4; font-size: 0.7rem; }
.tab-new { color: #6b7284; font-size: 1rem; padding: 6px 10px; }
.browser-navbar { background: #fff; padding: 8px 14px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #e0e3eb; }
.browser-navbar .nav-icon { color: #8a93a6; font-size: 0.9rem; }
.browser-urlbar {
  flex: 1; background: #f0f2f7; border-radius: 999px; padding: 6px 14px; display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem; color: #1c2333;
}
.browser-urlbar .lock { opacity: 0.5; font-size: 0.8rem; }
.browser-urlbar .url-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.browser-page { padding: 22px; white-space: pre-wrap; line-height: 1.7; font-size: 0.95rem; flex: 1; }

/* ---------- Dating skin (Tinder-style) ---------- */
.dating-skin { flex: 1; display: flex; flex-direction: column; }
.dating-photo {
  position: relative; height: 320px; background: linear-gradient(135deg, #6f7bd8, #4f8cff);
  display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; text-align: center; gap: 6px; padding: 10px 20px; overflow: hidden;
}
.dating-photo .photo-icon { font-size: 2.6rem; }
.dating-photo .photo-caption { font-size: 0.72rem; opacity: 0.9; line-height: 1.4; max-width: 220px; }
.dating-photo-gradient {
  position: absolute; left: 0; right: 0; bottom: 0; height: 120px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.65) 100%);
}
.dating-name-overlay { position: absolute; left: 18px; bottom: 16px; text-align: left; }
.dating-name { font-size: 1.3rem; font-weight: 800; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,0.4); }
.dating-distance { font-size: 0.78rem; color: #f0f1f5; margin-top: 2px; }
.dating-bio-box { padding: 14px 18px; font-size: 0.9rem; line-height: 1.55; color: #1c2333; }
.dating-swipe-buttons { display: flex; justify-content: center; gap: 26px; padding: 6px 0 16px; }
.swipe-btn {
  width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; box-shadow: 0 4px 14px rgba(0,0,0,0.15); background: #fff;
}
.swipe-btn.pass { color: var(--danger); }
.swipe-btn.like { color: #ff4d67; }

/* ---------- Profile skin (Instagram-style) ---------- */
.ig-skin { flex: 1; display: flex; flex-direction: column; }
.ig-topbar { padding: 12px 16px; font-weight: 800; font-size: 0.95rem; color: #1c2333; border-bottom: 1px solid #e5e8f0; }
.ig-header { display: flex; align-items: center; gap: 18px; padding: 16px; }
.ig-avatar {
  width: 68px; height: 68px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #6f7bd8, #4f8cff); display: flex; align-items: center; justify-content: center; font-size: 1.6rem; color: #fff;
}
.ig-stats { display: flex; gap: 18px; flex: 1; }
.ig-stats div { text-align: center; font-size: 0.8rem; color: #1c2333; }
.ig-stats b { display: block; font-size: 0.95rem; }
.ig-stats span { color: #8a93a6; font-size: 0.7rem; }
.ig-username { padding: 0 16px; font-weight: 800; font-size: 0.92rem; }
.ig-bio { padding: 4px 16px 0; font-size: 0.88rem; line-height: 1.5; color: #1c2333; }
.ig-pic-caption { padding: 8px 16px 0; font-size: 0.74rem; color: #8a93a6; font-style: italic; }
.ig-actions { display: flex; gap: 10px; padding: 12px 16px 14px; }
.ig-actions button { flex: 1; border: none; border-radius: 8px; padding: 8px; font-weight: 700; font-size: 0.85rem; cursor: default; }
.ig-actions .btn-follow { background: var(--accent); color: #fff; }
.ig-actions .btn-message { background: #eef1f7; color: #1c2333; }

.social-posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 0 3px; }
.social-posts-grid div { aspect-ratio: 1; background: #e4e7ee; }
.social-conversation-label {
  padding: 14px 18px 4px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: #8a93a6; font-weight: 700;
}

/* ---------- Ad card skin ---------- */
.ad-skin { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.ad-card { background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid #e5e8f0; }
.ad-platform-bar { padding: 10px 14px; font-size: 0.82rem; color: #4a5266; border-bottom: 1px solid #f0f2f7; }
.ad-card.fb .ad-platform-bar { background: #f0f4ff; }
.ad-card.ig .ad-platform-bar { background: linear-gradient(90deg, #fce4ec, #fff3e0); }
.ad-card.tw .ad-platform-bar { background: #e8f5ff; }
.ad-sponsored-label { padding: 10px 14px 0; font-size: 0.72rem; color: #8a93a6; font-weight: 700; }
.ad-thumb {
  height: 150px; margin: 10px 14px 0; border-radius: 8px;
  background: linear-gradient(135deg, #ffd166, #ef476f); display: flex; align-items: center; justify-content: center; font-size: 2.8rem;
}
.ad-headline { padding: 12px 14px 2px; font-weight: 800; font-size: 1rem; }
.ad-copy { padding: 4px 14px 14px; font-size: 0.9rem; line-height: 1.6; white-space: pre-wrap; }
.ad-cta { margin: 0 14px 16px; }
.ad-cta button {
  width: 100%; background: var(--accent); color: #fff; border: none; border-radius: 8px;
  padding: 10px; font-weight: 700; font-size: 0.88rem; cursor: default;
}

/* Clickable flag zones */
.flag-zone {
  cursor: pointer;
  border-radius: 4px;
  padding: 0 2px;
  transition: background 0.15s ease;
}
.flag-zone:hover { background: rgba(79,140,255,0.15); }

.flag-zone.found {
  background: rgba(255,92,108,0.14);
  outline: 2px solid var(--danger);
  outline-offset: 1px;
  cursor: default;
}
.flag-zone.found:hover { background: rgba(255,92,108,0.14); }

.flag-zone.shake { animation: shake 0.3s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

.decision-buttons {
  position: absolute;
  bottom: 18px;
  right: 18px;
  display: flex;
  gap: 8px;
}
.decision-btn {
  width: 44px; height: 44px;
  border-radius: 10px;
  border: none;
  font-size: 1.2rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.decision-btn.real { background: var(--safe); color: #063823; }
.decision-btn.fake { background: var(--danger); color: #3a0509; }
.decision-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.end-buttons { display: flex; gap: 12px; }

/* ---------- Category select ---------- */
.category-select { max-width: 640px; margin: 60px auto; text-align: center; }
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  width: 100%;
  margin-top: 10px;
}
.category-card {
  background: var(--panel);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 18px 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s ease;
  text-align: center;
}
.category-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.category-card .cat-icon { font-size: 1.8rem; display: block; margin-bottom: 6px; }
.category-card .cat-name { font-weight: 700; font-size: 0.95rem; }
.category-card .cat-count { color: var(--muted); font-size: 0.78rem; margin-top: 2px; }
.category-card.all-card { grid-column: 1 / -1; background: var(--panel-light); }

/* ---------- Chat conversation bubbles ---------- */
.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.chat-bubble-row { display: flex; }
.chat-bubble-row.them { justify-content: flex-start; }
.chat-bubble-row.you { justify-content: flex-end; }

.chat-bubble {
  max-width: 78%;
  padding: 9px 13px;
  border-radius: 16px;
  font-size: 0.92rem;
  line-height: 1.4;
}
.chat-bubble-row.them .chat-bubble { background: #e7e9ee; color: #1c2333; border-bottom-left-radius: 4px; }
.chat-bubble-row.you .chat-bubble { background: var(--accent); color: white; border-bottom-right-radius: 4px; }

.chat-bubble .flag-zone.plain { cursor: pointer; }
.chat-bubble-row.you .flag-zone.found { outline-color: #ffd9dc; }
