/* photos.hiwkaolaewpee.com — สไตล์สติกเกอร์การ์ตูน (ชุดเดียวกับ stats.hiwkaolaewpee.com) */
:root {
  --paper: #fff8e7; --dot: #ead9b5; --card: #ffffff; --ink: #2b2118; --muted: #7a6a58;
  --line: #2b2118; --shadow: #2b2118;
  --primary: #ff8a1f; --secondary: #3bb273; --accent: #ffd23f;
  --r: 18px; --bw: 3px; --sh: 5px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1b1814; --dot: #2d2821; --card: #27221c; --ink: #f6ecd9; --muted: #b6a68f;
    --line: #0a0806; --shadow: #000;
  }
}
:root[data-theme="dark"] {
  --paper: #1b1814; --dot: #2d2821; --card: #27221c; --ink: #f6ecd9; --muted: #b6a68f;
  --line: #0a0806; --shadow: #000;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: 'Sarabun', system-ui, sans-serif; font-size: 16px; color: var(--ink); line-height: 1.55;
  background-color: var(--paper);
  background-image: radial-gradient(var(--dot) 1.4px, transparent 1.5px);
  background-size: 18px 18px;
  min-height: 100vh;
}
.bg-media { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; background-size: cover; background-position: center; opacity: .18; pointer-events: none; }
h1, h2, h3, .brand, .btn, .chip, .section-title { font-family: 'Mali', 'Sarabun', sans-serif; }
a { color: inherit; }

.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: var(--card); border-bottom: var(--bw) solid var(--line); }
.brand { font-weight: 700; font-size: 1.15rem; text-decoration: none; }
.theme-btn { font-size: 1.2rem; width: 42px; height: 42px; border-radius: 50%; border: var(--bw) solid var(--line); background: var(--accent);
  box-shadow: 3px 3px 0 var(--shadow); cursor: pointer; }
.theme-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow); }

.wrap { max-width: 1100px; margin: 0 auto; padding: 18px 14px 40px; }
.card { background: var(--card); border: var(--bw) solid var(--line); border-radius: var(--r); box-shadow: var(--sh) var(--sh) 0 var(--shadow); padding: 18px; }
.muted { color: var(--muted); margin: 4px 0; }
.empty { text-align: center; padding: 40px 18px; font-size: 1.1rem; }
.back { display: inline-block; margin: 0 0 12px; text-decoration: none; font-weight: 700; }

.hero { text-align: center; margin-bottom: 22px; background: var(--accent); color: #2b2118; }
.hero h1 { font-size: clamp(1.7rem, 6vw, 2.6rem); margin: 4px 0 8px; line-height: 1.25; }
.hero .hl { background: var(--card); color: var(--ink); padding: 0 10px; border: var(--bw) solid var(--line); border-radius: 12px; display: inline-block; transform: rotate(-2deg); }
.hero.small { background: var(--card); color: var(--ink); text-align: left; }
.hero.small h1 { font-size: clamp(1.4rem, 5vw, 2rem); }

.section-title { font-size: 1.3rem; margin: 28px 0 12px; display: flex; align-items: center; gap: 10px; }

.chip { display: inline-block; padding: 2px 12px; border: 2px solid var(--line); border-radius: 999px; background: var(--secondary); color: #fff; font-size: .9rem; font-weight: 600; }
.chip.warn { background: #ff5a5f; }

.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.event-card { padding: 0; overflow: hidden; text-decoration: none; transition: transform .12s, box-shadow .12s; }
.event-card:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--shadow); }
.event-cover { aspect-ratio: 16/10; background: var(--accent) center/cover no-repeat; border-bottom: var(--bw) solid var(--line);
  display: grid; place-items: center; font-size: 3rem; }
.event-body { padding: 12px 14px 16px; }
.event-body h3 { margin: 0 0 2px; font-size: 1.15rem; }

.finder h2 { margin-top: 0; }
.consent { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 2px dashed var(--line); border-radius: 12px; margin: 10px 0 14px; cursor: pointer; font-size: .95rem; }
.consent input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--primary); flex: none; }
.shake { animation: shake .45s; border-color: #ff5a5f; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-row.center { justify-content: center; margin: 16px 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border: var(--bw) solid var(--line); border-radius: 14px;
  background: var(--card); color: var(--ink); font-weight: 700; font-size: 1rem; cursor: pointer; text-decoration: none;
  box-shadow: 4px 4px 0 var(--shadow); transition: transform .08s, box-shadow .08s; user-select: none; }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--shadow); }
.btn:disabled { opacity: .5; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.big { flex: 1 1 200px; padding: 16px; font-size: 1.15rem; }

.status { margin-top: 16px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--paper); font-weight: 500; }
.status.ok { background: #d9f7e6; color: #14532d; }
.status.warn { background: #fff1c2; color: #6b4b00; }
.status.err { background: #ffd9d9; color: #7f1d1d; }
.spin { display: inline-block; width: 16px; height: 16px; border: 3px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -3px; margin-right: 6px; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.face-pick { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.face-pick p { width: 100%; margin: 0; font-weight: 600; }
.face-btn { padding: 0; width: 72px; height: 72px; border-radius: 50%; overflow: hidden; border: var(--bw) solid var(--line); cursor: pointer; background: none; opacity: .55; }
.face-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.face-btn.on { opacity: 1; outline: 4px solid var(--primary); outline-offset: 2px; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
@media (max-width: 480px) { .photo-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; } }
.ph { display: block; aspect-ratio: 1; border: 2px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--dot); }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.ph:hover img { transform: scale(1.05); }
.small-note { text-align: center; font-size: .9rem; }

.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(10, 8, 6, .92); display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 94vw; max-height: calc(100vh - 120px); border-radius: 8px; border: 3px solid #fff; }
.lb-close { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 3px solid #000; background: var(--accent); font-size: 1.2rem; cursor: pointer; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 64px; border: 3px solid #000; border-radius: 12px; background: rgba(255,255,255,.9); font-size: 2rem; cursor: pointer; }
.lb-prev { left: 8px; } .lb-next { right: 8px; }
.lb-bar { position: absolute; bottom: 16px; left: 0; right: 0; display: flex; justify-content: center; gap: 12px; padding: 0 12px; }

.foot { text-align: center; color: var(--muted); font-size: .9rem; padding: 10px 16px 30px; }
.foot p { margin: 4px 0; }
