:root {
  --bg: #f0f5fb;
  --bg-elev: #ffffff;
  --text: #1a2335;
  --muted: #62728a;
  --accent: #107a8c;
  --accent-strong: #0b5f6d;
  --accent-glow: rgba(16, 122, 140, 0.22);
  --danger: #ba2518;
  --border: #dae0ec;
  --shadow: 0 4px 16px rgba(14, 25, 40, 0.08), 0 1px 4px rgba(14, 25, 40, 0.05);
  --shadow-hover: 0 16px 48px rgba(16, 122, 140, 0.16), 0 4px 12px rgba(14, 25, 40, 0.1);
}

:root[data-theme='dark'] {
  --bg: #0d1520;
  --bg-elev: #192336;
  --text: #e8f1fc;
  --muted: #90a4bc;
  --accent: #3bb8cc;
  --accent-strong: #28919f;
  --accent-glow: rgba(59, 184, 204, 0.2);
  --danger: #f27060;
  --border: #253650;
  --shadow: 0 4px 16px rgba(0, 5, 15, 0.4), 0 1px 4px rgba(0, 5, 15, 0.3);
  --shadow-hover: 0 16px 48px rgba(59, 184, 204, 0.15), 0 4px 12px rgba(0, 5, 15, 0.45);
}

/* ── Cookie banner ──────────────────────────────────────────── */
.cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  width: min(620px, calc(100vw - 32px));
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-hover);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  animation: slideUpIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.cookie-banner.hidden {
  animation: slideDownOut 0.3s ease forwards;
}

@keyframes slideUpIn {
  from { opacity: 0; transform: translateX(-50%) translateY(24px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes slideDownOut {
  to { opacity: 0; transform: translateX(-50%) translateY(24px); }
}

.cookie-text {
  flex: 1;
  min-width: 0;
}

.cookie-text strong {
  display: block;
  margin-bottom: 3px;
  font-size: 0.9rem;
}

.cookie-text p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
}

.cookie-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex-shrink: 0;
}

.cookie-actions .btn {
  padding: 9px 18px;
  font-size: 0.85rem;
  white-space: nowrap;
}

@media (max-width: 540px) {
  .cookie-banner {
    flex-direction: column;
    align-items: stretch;
    bottom: 12px;
    padding: 16px;
  }

  .cookie-actions {
    flex-direction: row;
  }

  .cookie-actions .btn {
    flex: 1;
  }
}

/* existing rules below */
* {
  box-sizing: border-box;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: inherit;
}

:focus:not(:focus-visible) {
  outline: none;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  overscroll-behavior: none;
}

body {
  font-family: 'Manrope', sans-serif;
  color: var(--text);
  overflow-y: auto;
  background:
    radial-gradient(circle at 10% 15%, rgba(21, 97, 109, 0.14), transparent 35%),
    radial-gradient(circle at 90% 80%, rgba(243, 166, 25, 0.14), transparent 32%),
    var(--bg);
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.swiping {
  overflow: hidden;
}

body.swipe-animating {
  overflow: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: calc(var(--swipe-progress, 0) * 0.55);
  transition: opacity 0.22s ease;
}

body.swipe-like::before {
  background: radial-gradient(circle at 50% 50%, rgba(34, 197, 94, 0.42), rgba(34, 197, 94, 0));
}

body.swipe-dislike::before {
  background: radial-gradient(circle at 50% 50%, rgba(239, 68, 68, 0.42), rgba(239, 68, 68, 0));
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  filter: blur(50px);
  pointer-events: none;
  opacity: 0.45;
  z-index: 0;
}

.bg-a {
  width: 360px;
  height: 360px;
  top: -100px;
  right: -100px;
  background: radial-gradient(circle, #ffca6a, #f59e0b);
}

.bg-b {
  width: 380px;
  height: 380px;
  left: -110px;
  bottom: -120px;
  background: radial-gradient(circle, #6ee7dd, #0e9aa6);
}

.app {
  position: relative;
  z-index: 1;
  width: min(980px, 94vw);
  margin: 18px auto;
  display: grid;
  gap: 12px;
}

.topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

.seo-heading {
  margin: 0 auto 0 0;
  font-size: clamp(1rem, 2.1vw, 1.35rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.history-btn {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  height: 40px;
  padding: 0 14px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
  background: var(--bg-elev);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.history-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-elev));
  transform: translateY(-1px);
}

.history-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

/* ── Menu button ───────────────────────────────────────────── */
.menu-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elev);
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.menu-btn span {
  display: block;
  width: 100%;
  min-width: 100%;
  height: 2px;
  flex-shrink: 0;
  border-radius: 2px;
  background-color: currentColor;
  transition: background 0.2s ease;
}

.menu-btn:hover {
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-elev));
  border-color: var(--accent);
}

/* ── Sidebar overlay ───────────────────────────────────────── */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* ── Sidebar drawer ────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 101;
  width: min(320px, 90vw);
  height: 100%;
  background: var(--bg-elev);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  gap: 0;
  transform: translateX(110%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-title {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.sidebar-close {
  background: transparent;
  border: 0;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
  padding: 4px 6px;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
}

.sidebar-close:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--text) 8%, transparent);
}

.sidebar-section {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-label {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* Theme toggle pills */
.theme-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.theme-opt {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 9px 4px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.theme-opt.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 28%, var(--bg-elev));
  color: var(--text);
}

.theme-opt:hover:not(.active) {
  background: color-mix(in srgb, var(--text) 6%, transparent);
}

/* Sidebar nav buttons (About / Legal) */
.sidebar-nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.sidebar-nav-btn:hover {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-color: var(--accent);
}

.snb-icon { font-style: normal; font-size: 1.1em; }
.snb-arrow { margin-left: auto; color: var(--muted); font-size: 1.2em; }

/* ── Modal ─────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-hover);
  width: min(520px, 100%);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.25s ease;
  overflow: hidden;
}

.modal-backdrop.open .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
}

.modal-close {
  background: transparent;
  border: 0;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--muted);
  padding: 4px 6px;
  border-radius: 8px;
  line-height: 1;
  transition: color 0.15s ease, background 0.15s ease;
}

.modal-close:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--text) 8%, transparent);
}

.modal-body {
  padding: 20px 24px 24px;
  overflow-y: auto;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text);
}

.modal-body h3 {
  margin: 18px 0 6px;
  font-size: 0.88rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.modal-body h3:first-child { margin-top: 0; }

.modal-body p {
  margin: 0 0 10px;
}

.modal-body p:last-child { margin-bottom: 0; }

.history-list {
  display: grid;
  gap: 10px;
}

.history-empty {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.history-item {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-elev);
  padding: 10px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.history-item:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, var(--bg-elev));
  transform: translateY(-1px);
}

.history-item.current {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.history-item img {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: contain;
  background: var(--bg);
}

.history-item-content {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.history-item-category {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.history-item-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item-meta {
  font-size: 0.82rem;
  color: var(--muted);
}

.swipe-hint {
  display: none;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg-elev) 92%, var(--accent) 8%);
  box-shadow: var(--shadow);
  padding: 10px 12px;
  align-items: center;
  justify-items: center;
  gap: 6px;
  max-width: 430px;
  margin: 0 auto;
}

.swipe-hint.visible {
  display: grid;
  animation: swipeHintIn 0.28s ease;
}

.swipe-hint-visual {
  position: relative;
  width: 190px;
  height: 56px;
  display: grid;
  place-items: center;
}

.swipe-hint-arrows {
  width: 100%;
  height: 100%;
}

.swipe-hint-arrows path {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.swipe-hint-left {
  stroke: var(--danger);
}

.swipe-hint-right {
  stroke: var(--accent);
}

.swipe-head {
  stroke: color-mix(in srgb, var(--muted) 70%, var(--text));
}

.swipe-finger {
  position: absolute;
  top: 16px;
  left: 50%;
  font-size: 1.42rem;
  transform: translate3d(-50%, 0, 0);
  will-change: transform;
  animation: swipeFingerMove 0.6s linear infinite alternate;
}

.swipe-hint-text {
  margin: 0;
  text-align: center;
  font-size: 0.86rem;
  color: var(--muted);
  font-weight: 700;
}

@keyframes swipeFingerMove {
  0% { transform: translate3d(calc(-50% - 34px), 0, 0); }
  100% { transform: translate3d(calc(-50% + 34px), 0, 0); }
}

@keyframes swipeHintIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── select (keep for JS compat) ───────────────────────────── */
select { display: none; }

.card {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  background: var(--bg-elev);
  box-shadow: var(--shadow);
  height: min(520px, calc(100vh - 90px));
  opacity: 1;
  transform: translateY(0);
  touch-action: pan-y;
  user-select: none;
  will-change: transform, opacity;
  transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.card,
.card * {
  -webkit-user-select: none;
  user-select: none;
}

.card.dragging {
  cursor: grabbing;
  transition: none;
}

.card.swipe-out {
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}

.card.swipe-prep {
  opacity: 0.01;
  transition: none !important;
}

.card.swipe-in {
  opacity: 1;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-hover);
}

.card.loading {
  opacity: 0.65;
  transform: translateY(8px);
}

.card-img-wrap {
  position: relative;
  overflow: hidden;
  height: 100%;
  cursor: pointer;
  touch-action: none;
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: var(--bg);
  -webkit-user-drag: none;
  user-select: none;
  transform-origin: center center;
  transition: opacity 0.3s ease, filter 0.4s ease;
}

.img-hidden {
  opacity: 0 !important;
  transition: opacity 0.25s ease !important;
}

.card-content {
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  touch-action: none;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

.category {
  margin: 0;
  display: inline-flex;
  align-self: start;
  background: color-mix(in srgb, var(--accent) 20%, var(--bg-elev));
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 20px;
  padding: 3px 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 0.72rem;
}

.card-content h2 {
  margin: 0;
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  line-height: 1.35;
  font-weight: 700;
}

.guide-page {
  position: relative;
  z-index: 1;
  width: min(900px, 94vw);
  margin: 20px auto;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--bg-elev);
  box-shadow: var(--shadow);
  padding: 24px;
}

.guide-page h1 {
  margin: 0 0 10px;
  font-size: clamp(1.25rem, 2.7vw, 1.9rem);
  line-height: 1.2;
}

.guide-page h2 {
  margin: 20px 0 8px;
  font-size: 1.08rem;
}

.guide-page h3 {
  margin: 14px 0 6px;
  font-size: 0.95rem;
}

.guide-page p,
.guide-page li {
  font-size: 0.94rem;
  line-height: 1.65;
  color: var(--text);
}

.guide-page ul {
  margin: 0;
  padding-left: 20px;
}

.guide-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.guide-nav a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--accent-strong);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: 10px;
  padding: 7px 12px;
}

.guide-nav a:hover {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-color: var(--accent);
}

.price {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-strong);
  letter-spacing: -0.01em;
}

#sourceLink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 10px;
  padding: 7px 14px;
  width: fit-content;
  background: var(--accent-glow);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

#sourceLink:hover {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-color: var(--accent);
  transform: translateY(-1px);
}

#sourceLink::after {
  content: '↗';
  font-size: 1em;
}

.link-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 10px;
  padding: 7px 12px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.share-btn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.share-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: auto;
  padding-top: 8px;
}

.btn {
  border: 0;
  border-radius: 14px;
  padding: 13px 10px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn:disabled {
  cursor: not-allowed;
  filter: grayscale(0.4) opacity(0.6);
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: 0 4px 18px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 24px var(--accent-glow);
  filter: brightness(1.08);
}

.btn-secondary {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}

.reaction-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.reaction-emoji {
  display: inline-block;
  font-size: 1.08rem;
  line-height: 1;
  transform-origin: center 70%;
  animation: emojiFloat 1.9s ease-in-out infinite;
}

#dislikeBtn .reaction-emoji {
  animation-delay: 0.1s;
}

#likeBtn .reaction-emoji {
  animation-delay: 0.35s;
}

#likeBtn:hover:not(:disabled) .reaction-emoji {
  animation: emojiLikeSpring 0.58s cubic-bezier(0.22, 1, 0.36, 1);
}

#dislikeBtn:hover:not(:disabled) .reaction-emoji {
  animation: emojiDislikeShake 0.48s ease;
}

#likeBtn:active:not(:disabled) .reaction-emoji {
  animation: emojiLikePress 0.25s ease;
}

#dislikeBtn:active:not(:disabled) .reaction-emoji {
  animation: emojiDislikePress 0.25s ease;
}

.btn-secondary:hover:not(:disabled) {
  background: color-mix(in srgb, var(--text) 5%, transparent);
  border-color: color-mix(in srgb, var(--text) 40%, transparent);
}

.btn-secondary.active-like {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.btn-secondary.active-dislike {
  border-color: var(--danger);
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}

@keyframes emojiFloat {
  0%, 100% {
    transform: translateY(0) scale(1) rotate(0deg);
  }

  30% {
    transform: translateY(-1px) scale(1.04) rotate(-2deg);
  }

  70% {
    transform: translateY(1px) scale(0.98) rotate(2deg);
  }
}

@keyframes emojiLikeSpring {
  0% {
    transform: translateY(0) scale(1) rotate(0deg);
  }

  40% {
    transform: translateY(-4px) scale(1.16) rotate(-8deg);
  }

  70% {
    transform: translateY(1px) scale(0.97) rotate(4deg);
  }

  100% {
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

@keyframes emojiDislikeShake {
  0% {
    transform: translateX(0) rotate(0deg) scale(1);
  }

  20% {
    transform: translateX(-2px) rotate(-8deg) scale(1.08);
  }

  40% {
    transform: translateX(2px) rotate(7deg) scale(1.07);
  }

  60% {
    transform: translateX(-1px) rotate(-6deg) scale(1.04);
  }

  100% {
    transform: translateX(0) rotate(0deg) scale(1);
  }
}

@keyframes emojiLikePress {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(0.9) rotate(-4deg);
  }

  100% {
    transform: scale(1.08) rotate(5deg);
  }
}

@keyframes emojiDislikePress {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(0.9) rotate(5deg);
  }

  100% {
    transform: scale(1.06) rotate(-6deg);
  }
}

@keyframes slotReel {
  0%, 100% { opacity: 1; }
}

.slot-spin {
  display: none; /* removed */
}

.card-content.spinning {
  filter: blur(4px);
  opacity: 0.35;
  pointer-events: none;
  user-select: none;
}

@media (max-width: 840px) {
  html, body {
    height: 100%;
  }

  .app {
    height: 100dvh;
    margin: 0 auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    width: min(840px, 100vw);
    box-sizing: border-box;
    gap: 8px;
  }

  .topbar {
    flex-shrink: 0;
  }

  .seo-heading {
    font-size: 1rem;
    max-width: 58vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .card {
    display: flex;
    flex-direction: column;
    grid-template-columns: unset;
    height: auto;
    flex: 1;
    min-height: 0;
    border-radius: 18px;
  }

  .card-img-wrap {
    flex: 0 0 auto;
    min-height: 170px;
    height: clamp(170px, 34vh, 320px);
  }

  .card-content {
    flex: 1;
    min-height: 0;
    padding: 12px;
    gap: 8px;
    overflow: hidden;
  }

  #title {
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .price {
    font-size: 1.25rem;
  }

  .btn {
    padding: 10px 8px;
    font-size: 0.84rem;
  }

  .reaction-btn {
    gap: 6px;
  }

  .actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding-top: 6px;
    margin-top: auto;
  }

  .guide-page {
    width: calc(100vw - 20px);
    margin: 10px auto;
    border-radius: 16px;
    padding: 16px;
  }
}

@media (max-width: 840px) and (max-height: 740px) {
  .app {
    padding: 8px;
    gap: 6px;
  }

  .card {
    border-radius: 14px;
  }

  .card-img-wrap {
    min-height: 140px;
    height: clamp(140px, 30vh, 250px);
  }

  .card-content {
    padding: 10px;
    gap: 6px;
  }

  .category {
    font-size: 0.66rem;
    padding: 2px 8px;
  }

  .price {
    font-size: 1.12rem;
  }

  .actions {
    gap: 6px;
    padding-top: 4px;
  }

  .btn {
    padding: 8px 6px;
    font-size: 0.8rem;
    border-radius: 12px;
  }
}
