/* Fanart room + character art. Loaded by fanart.html and index.html (latest strip). */

/* ---------- character art (placeholder until official art: drop assets/characters/<id>.png) ---------- */
.char-art { position: absolute; inset: 0; overflow: hidden; display: grid; place-items: center; isolation: isolate; }
.char-art.suika {
  background:
    radial-gradient(circle at 70% 25%, rgba(255, 150, 180, .55), transparent 45%),
    radial-gradient(circle at 20% 90%, rgba(69, 208, 122, .45), transparent 50%),
    linear-gradient(160deg, #3b0d1c, #1b0a10 55%, #0b1a10);
}
.char-art.suika::before { /* watermelon seeds */
  content: ""; position: absolute; inset: -20%; z-index: -1; opacity: .5;
  background-image: radial-gradient(ellipse 5px 8px at 50% 50%, #1a0508 60%, transparent 62%);
  background-size: 46px 52px; transform: rotate(-12deg);
}
.char-art.suika::after { /* rind arc */
  content: ""; position: absolute; width: 150%; aspect-ratio: 1; bottom: -118%; left: -25%; border-radius: 50%; z-index: -1;
  border: 18px solid #45d07a; box-shadow: 0 0 0 10px #d9ffe6 inset, 0 0 60px rgba(69, 208, 122, .5);
}
.char-art.hina {
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 220, 120, .6), transparent 45%),
    radial-gradient(circle at 80% 85%, rgba(255, 150, 100, .45), transparent 50%),
    linear-gradient(160deg, #3a2608, #1a1208 55%, #120c0a);
}
.char-art.hina::before { /* sparkles */
  content: "✦ ✧ ✦ ✧ ✦ ✧ ✦ ✧ ✦ ✧ ✦ ✧ ✦ ✧ ✦ ✧ ✦ ✧ ✦ ✧ ✦ ✧ ✦ ✧ ✦ ✧ ✦ ✧ ✦ ✧ ✦ ✧ ✦ ✧ ✦ ✧ ✦ ✧ ✦ ✧";
  position: absolute; inset: -10%; z-index: -1; color: rgba(255, 220, 140, .28); font-size: 22px; line-height: 2.4; letter-spacing: 1.2em; word-break: break-all; transform: rotate(-10deg);
}
.char-name { font: 800 clamp(34px, 5vw, 64px)/.9 var(--display); letter-spacing: -.02em; text-align: center; color: transparent; -webkit-text-stroke: 1.5px rgba(255, 255, 255, .55); text-shadow: 0 0 60px rgba(255, 255, 255, .15); }
.char-art.has-img .char-name { display: none; }
.char-art > img.char-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }

/* ---------- fanart room hero: character cards ---------- */
.chars { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; }
.char-card { position: relative; min-height: 380px; border-radius: 24px; overflow: hidden; border: 1px solid var(--line-2); box-shadow: var(--shadow); cursor: pointer; display: flex; align-items: flex-end; }
.char-card .char-art::after, .char-card::after { pointer-events: none; }
.char-card > .shade { position: absolute; inset: 0; z-index: 2; background: linear-gradient(0deg, rgba(8, 7, 8, .95) 5%, rgba(8, 7, 8, .25) 55%, transparent); }
.char-card .info { position: relative; z-index: 3; padding: 26px; width: 100%; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.char-card h3 { font: 800 34px/1 var(--display); letter-spacing: -.02em; }
.char-card p { color: var(--text-2); font-size: 14px; margin-top: 8px; font-family: var(--thai); font-weight: 300; }
.char-card .count { font: 700 12px var(--display); letter-spacing: .1em; color: var(--muted); }
.char-card .ribbon { position: absolute; z-index: 4; top: 18px; left: 18px; }
.char-card.active { border-color: rgba(255, 45, 63, .6); box-shadow: var(--shadow), 0 0 0 2px rgba(255, 45, 63, .35), 0 30px 70px -30px var(--glow); }
.char-card.suika h3 { color: #ffd1dc; } .char-card.hina h3 { color: #ffe9b0; }

/* ---------- toolbar / filters ---------- */
.fa-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin: 34px 0 20px; }
.tabs { display: flex; gap: 4px; padding: 5px; border-radius: 14px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); }
.tab { height: 38px; padding: 0 16px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; transition: .2s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); background: linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .04)); box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 6px 14px -8px #000; }
.tab .n { font-size: 11px; color: var(--dim); }
.dot-s { width: 8px; height: 8px; border-radius: 50%; }

/* ---------- gallery (masonry via columns) ---------- */
.gallery { columns: 4 250px; column-gap: 16px; }
.fa { break-inside: avoid; margin-bottom: 16px; border-radius: 16px; overflow: hidden; position: relative; cursor: zoom-in; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .35s var(--ease), border-color .3s; animation: fadeUp .6s var(--ease) both; }
.fa:hover { transform: translateY(-4px); border-color: rgba(255, 45, 63, .4); }
.fa img { width: 100%; height: auto; background: var(--panel-3); }
.fa .meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 13px 11px; background: linear-gradient(0deg, rgba(0, 0, 0, .85), transparent); display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; opacity: 0; transition: opacity .3s; }
.fa:hover .meta, .fa:focus-within .meta { opacity: 1; }
.fa .meta b { font-size: 13.5px; display: block; }
.fa .meta small { font-size: 11.5px; color: var(--text-2); }
.fa .who { font-size: 12px; color: var(--muted); }
.fa .badge { position: absolute; top: 10px; left: 10px; font: 700 10px var(--display); letter-spacing: .06em; padding: 4px 8px; border-radius: 7px; background: rgba(0, 0, 0, .6);  }
.fa .badge.suika-rei { color: #ffc1d0; } .fa .badge.hina-ito { color: #ffe39a; }
.fa .del { position: absolute; top: 10px; right: 10px; z-index: 3; height: 30px; padding: 0 10px; border-radius: 9px; background: #e5322d; color: #fff; font-weight: 700; font-size: 12px; }
.fa-empty { padding: 60px 20px; text-align: center; border: 1.5px dashed var(--line-2); border-radius: 22px; color: var(--muted); }
.fa-empty b { display: block; color: var(--text); font: 700 20px var(--display); margin-bottom: 8px; }

/* ---------- library shelves: one clearly separated block per character (+ "ผลงานของฉัน") ---------- */
.fa-lib { display: grid; gap: 26px; }
.shelf { --shelf: var(--orange); position: relative; padding: 22px; border-radius: 26px; background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .01)); border: 1px solid var(--line); box-shadow: var(--shadow); }
.shelf::before { content: ""; position: absolute; left: 22px; right: 22px; top: -1px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--shelf), transparent 70%); box-shadow: 0 0 18px var(--shelf); opacity: .8; }
.shelf.suika { --shelf: var(--suika); } .shelf.hina { --shelf: var(--hina); } .shelf.mine { --shelf: var(--text-2); border-style: dashed; border-color: var(--line-2); }
.shelf-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.shelf-art { position: relative; flex: none; width: 64px; height: 64px; border-radius: 18px; overflow: hidden; border: 1px solid var(--line-2); box-shadow: 0 0 0 3px rgba(0, 0, 0, .3), 0 10px 26px -10px var(--shelf); }
.shelf-art.mine-ic { display: grid; place-items: center; font-size: 26px; background: rgba(255, 255, 255, .05); }
.shelf-title { min-width: 0; flex: 1; }
.shelf-no { font: 700 10px var(--display); letter-spacing: .18em; color: var(--shelf); }
.shelf-title h2 { font: 800 clamp(22px, 3vw, 30px)/1.1 var(--display); letter-spacing: -.02em; margin-top: 4px; }
.shelf-title h2 .tag-new { font-size: 10px; vertical-align: 6px; }
.shelf-title small { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; font-family: var(--thai); }
.shelf-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.shelf .fa-empty { padding: 34px 20px; }
.tab-sep { width: 1px; margin: 6px 4px; background: var(--line-2); }
.fa .mine-tag { position: absolute; top: 10px; left: 10px; transform: translateY(26px); font: 700 10px var(--display); letter-spacing: .06em; padding: 4px 8px; border-radius: 7px; background: rgba(255, 255, 255, .9); color: #111; }

/* home page strip */
.fa-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.fa-strip .fa { margin: 0; aspect-ratio: 3/4; }
.fa-strip .fa img { height: 100%; object-fit: cover; }
.fa-strip .fa-empty { grid-column: 1/-1; padding: 36px 20px; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; padding: 30px; background: rgba(0, 0, 0, .88);  opacity: 0; pointer-events: none; transition: opacity .25s; }
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox figure { max-width: min(1100px, 100%); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.lightbox img { max-height: calc(100vh - 200px); border-radius: 14px; box-shadow: 0 40px 100px -30px #000; }
.lightbox figcaption { text-align: center; }
.lightbox figcaption b { font: 700 18px var(--display); }
.lightbox figcaption span { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
.lightbox .lb-dl { margin-top: 12px; cursor: pointer; }

/* ---------- submit modal ---------- */
.pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pick-card { position: relative; height: 150px; border-radius: 18px; overflow: hidden; border: 2px solid transparent; box-shadow: var(--shadow); text-align: left; transition: .25s var(--ease); }
.pick-card:hover { transform: translateY(-3px); }
.pick-card.sel { border-color: var(--orange); box-shadow: 0 0 0 4px rgba(255, 45, 63, .18), 0 24px 50px -24px var(--glow); }
.pick-card .char-name { font-size: 26px; }
.pick-card .lbl { position: absolute; z-index: 3; left: 12px; bottom: 10px; font-weight: 700; font-size: 13px; text-shadow: 0 2px 10px #000; }
.pick-card .tag-new { position: absolute; z-index: 3; top: 10px; right: 10px; }
.pick-card .check { position: absolute; z-index: 3; top: 10px; left: 10px; width: 24px; height: 24px; border-radius: 50%; background: var(--orange); color: var(--on-accent); display: none; place-items: center; font-weight: 800; font-size: 13px; }
.pick-card.sel .check { display: grid; }
.drop { position: relative; display: grid; place-items: center; min-height: 190px; border-radius: 18px; border: 1.5px dashed rgba(255, 45, 63, .4); background: rgba(255, 45, 63, .03); text-align: center; color: var(--muted); cursor: pointer; transition: .2s; overflow: hidden; }
.drop:hover, .drop.over { background: rgba(255, 45, 63, .08); border-color: var(--orange); color: var(--text); }
.drop img { max-height: 320px; width: auto; border-radius: 12px; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.step { font: 700 11px var(--display); letter-spacing: .16em; color: var(--orange-2); margin-bottom: 10px; }
.form-grid { display: grid; gap: 20px; margin-top: 22px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.rules { font-size: 12px; color: var(--dim); line-height: 1.7; }
.progress { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ember), var(--orange), var(--amber)); box-shadow: 0 0 14px var(--glow); transition: width .3s; }

@media (max-width: 1020px) { .fa-strip { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) {
  .chars { grid-template-columns: 1fr; }
  .char-card { min-height: 280px; }
  .fa-strip { grid-template-columns: repeat(2, 1fr); }
  .pick-card { height: 120px; }
  .fa .meta { opacity: 1; }
  .shelf { padding: 16px; }
  .shelf-head { flex-wrap: wrap; }
  .shelf-actions { width: 100%; justify-content: stretch; }
  .shelf-actions .btn { flex: 1; }
  .tabs { flex-wrap: wrap; }
}
