/* なかまの絵を大きく見る窓（js/art-viewer.js）と、絵のタイル・ゲームのギャラリー。wiki（../gallery.css）とゲームの両方が読む。 */
.art-view { position: fixed; inset: 0; z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 42%, #272c56, #05081a);
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: zoom-out; animation: avin .2s ease-out; overflow: hidden; }
@keyframes avin { from { opacity: 0; transform: scale(.96); } }
.art-view .av-stage { flex: 1 1 auto; width: 100%; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 14px 10px 0; box-sizing: border-box; }
/* 画面いっぱいに出す（縦長の絵は縦いっぱい、横長は横いっぱい） */
.art-view .av-img { width: 100%; height: 100%; max-width: 1100px; object-fit: contain; transform-origin: center center; will-change: transform;
  filter: drop-shadow(0 0 18px color-mix(in srgb, var(--rc, #fff29a) 55%, transparent)); -webkit-user-drag: none; pointer-events: none; }
.art-view .av-cap { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 12px 2px; text-align: center; max-width: 92%; }
.art-view .av-star { color: var(--rc, #fff29a); font-size: 14px; letter-spacing: 1px; text-shadow: 0 1px 3px #000; }
.art-view .av-name { color: #fff6cf; font-size: 21px; letter-spacing: .08em; text-shadow: 0 2px 6px #000; font-family: 'DotGothic16', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Meiryo', sans-serif; }
.art-view .av-sub { color: #c9d0ff; font-size: 12px; opacity: .85; }
.art-view .av-sub:empty { display: none; }
.art-view .av-hint { flex: none; color: #c9d0ff; font-size: 11px; opacity: .6; padding: 2px 0 calc(12px + env(safe-area-inset-bottom)); }
.art-view .av-count { position: absolute; top: calc(10px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); color: #c9d0ff; font-size: 12px; background: #0008; border-radius: 10px; padding: 2px 10px; }
.art-view .av-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; border: 0; border-radius: 12px; background: #0006; color: #fff;
  font-size: 34px; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0 0 4px; }
.art-view .av-nav:hover { background: #000a; }
.art-view .av-prev { left: 6px; }
.art-view .av-next { right: 6px; }

/* 絵のタイル（wiki のギャラリーとゲームのギャラリーで同じもの）。枠の色が★の色 */
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
@media (max-width: 420px) { .gal-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; } }
.gal-tile { position: relative; display: flex; align-self: start; flex-direction: column; padding: 0; margin: 0; border: 2px solid var(--rc); border-radius: 12px; overflow: hidden; cursor: zoom-in;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--rc) 30%, #1a2350), #0a0f24 75%); box-shadow: 0 3px 0 #0008, inset 0 0 18px color-mix(in srgb, var(--rc) 25%, transparent);
  color: #fffbea; font: inherit; text-align: center; transition: transform .12s; }
.gal-tile:active { transform: scale(.97); }
.gal-tile .gal-art { position: relative; display: block; aspect-ratio: 1 / 1.08; overflow: hidden; }
/* 絵の大きさでタイルの高さが変わらないよう、絵は枠の中に浮かせる */
.gal-tile .gal-art img { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); object-fit: contain; display: block; filter: drop-shadow(0 4px 6px #000a); -webkit-user-drag: none; }
.gal-tile .gal-evo { position: absolute; top: 6px; left: 6px; font-style: normal; font-size: 10.5px; color: #3a2200; background: linear-gradient(#fff29a, #f2b630); border-radius: 6px; padding: 1px 6px; box-shadow: 0 1px 0 #0008; }
.gal-tile .gal-cap { display: flex; flex-direction: column; gap: 0; padding: 4px 6px 7px; background: linear-gradient(transparent, #0009); }
.gal-tile .gal-cap b { font-size: 13px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gal-tile .gal-cap em { font-style: normal; font-size: 11px; color: var(--rc); letter-spacing: 1px; line-height: 1.2; }
/* まだ見ていない絵: 影と「？？？」だけ */
.gal-tile.locked { cursor: default; border-style: dashed; }
.gal-tile.locked .gal-art img { filter: brightness(0) invert(.2) sepia(.5) hue-rotate(185deg) drop-shadow(0 0 1px #8a96d8); opacity: .8; }
.gal-tile.locked .gal-cap b { color: #8a93bd; letter-spacing: 2px; }

/* ゲームのギャラリー（拠点の「絵を見る」から） */
.gal-panel { position: absolute; inset: 0; z-index: 60; display: flex; flex-direction: column; background: linear-gradient(#0d1530, #070b18); color: #fffbea; animation: avin .18s ease-out; }
.gal-panel .gal-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 10px 12px 6px; border-bottom: 2px solid #f2c14e55; }
.gal-panel .gal-head h2 { margin: 0; font-size: 18px; color: #f2c14e; letter-spacing: .1em; flex: 1; text-shadow: 0 2px 0 #000; }
.gal-panel .gal-back { flex: none; font: inherit; font-size: 13px; color: #3a2200; background: linear-gradient(#ffd767, #c98b1c); border: 2px solid #f4f1e6; border-radius: 8px; padding: 4px 12px; cursor: pointer; box-shadow: 0 3px 0 #0007; }
.gal-panel .gal-meter { flex: none; display: flex; gap: 8px; padding: 8px 12px 4px; }
.gal-panel .gal-meter div { flex: 1; background: #18244a; border: 1px solid #34437a; border-radius: 10px; padding: 6px 10px; }
.gal-panel .gal-meter span { display: block; font-size: 11px; color: #aab6d6; }
.gal-panel .gal-meter b { font-size: 22px; color: #fff6cf; letter-spacing: .04em; }
.gal-panel .gal-meter b small { font-size: 13px; color: #aab6d6; margin-left: 2px; }
.gal-panel .gal-meter i { display: block; height: 5px; margin-top: 4px; border-radius: 3px; background: #0a0f24; overflow: hidden; }
.gal-panel .gal-meter i::after { content: ''; display: block; height: 100%; width: var(--p); background: linear-gradient(90deg, #f2b630, #fff29a); }
.gal-panel .gal-note { flex: none; margin: 2px 12px 6px; font-size: 11.5px; color: #aab6d6; }
.gal-panel .gal-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 12px 24px; }
/* 拠点の「カード｜表｜絵」の3つ目（なかま一覧の見え方の切りかえと並べる）。押すとギャラリーが開く */
#view-sw .gal-sw { background: #4a2f74; color: #ffe08a; border-color: #ffd76799; margin-left: 6px; }
/* 声つきで絵を開いたとき（持っている子）: 絵が小さく弾む。scale は transform（ずらし・拡大）と重ねて効く */
.art-view .av-img.av-pop { animation: avpop .34s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes avpop { 0% { scale: .9; } 100% { scale: 1; } }
@media (prefers-reduced-motion: reduce) { .art-view .av-img.av-pop { animation: none; } }
