/* style-grid.css - Anime Grid (uses buttons/stats from style-daily.css) */
.grid-page { max-width: 760px; }
.grid-page .site-logo-link-small { text-decoration: none; }
.grid-page .blog-post-content a:not(.dl-btn):not(.dl-arch) { color: var(--primary-color); }
#gr-app { margin: 10px 0 30px; }
.gr-headline { text-align: center; margin-bottom: 12px; }
.gr-headline h2 { margin: 0; font-size: 1.5rem; }
#gr-date { color: var(--text-muted-color); font-size: 0.9rem; }

#gr-board { display: grid; grid-template-columns: 0.8fr repeat(3, 1fr); gap: 6px; max-width: 600px; margin: 0 auto; }
.gr-corner, .gr-head { display: flex; align-items: center; justify-content: center; text-align: center; padding: 6px; font-weight: 700; font-size: clamp(0.7rem, 2.4vw, 0.95rem); line-height: 1.2; border-radius: 10px; }
.gr-corner { flex-direction: column; color: var(--text-muted-color); font-weight: 600; font-size: 0.75rem; }
.gr-corner span { font-size: 1.8rem; color: var(--text-color); font-weight: 700; }
.gr-head { background: color-mix(in srgb, var(--primary-color) 16%, transparent); border: 1px solid color-mix(in srgb, var(--primary-color) 45%, transparent); }
.gr-row { min-height: 90px; }
.gr-cell { position: relative; aspect-ratio: 1 / 1; border-radius: 12px; border: 2px dashed var(--tile-border, rgba(255,255,255,0.3)); background: var(--tile-bg, rgba(0,0,0,0.25)); color: var(--text-color); cursor: pointer; overflow: hidden; padding: 0; font: inherit; transition: transform 0.15s ease, border-color 0.15s ease; }
.gr-cell:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--primary-color); }
.gr-cell:focus-visible { outline: 3px solid var(--primary-color); outline-offset: 2px; }
.gr-cell.filled { border-style: solid; border-color: #4caf50; cursor: default; }
.grid-page .gr-cell img { width: 100%; height: 100%; object-fit: cover; display: block; margin: 0; border-radius: 0; box-shadow: none; max-width: none; }
.gr-plus { font-size: 2rem; opacity: 0.5; }
.gr-miss { font-size: 0.8rem; color: var(--text-muted-color); padding: 4px; }
.gr-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 3px 3px; font-size: clamp(0.6rem, 2vw, 0.78rem); line-height: 1.15; color: #fff; font-weight: 600; background: linear-gradient(to top, rgba(0,0,0,0.88) 40%, transparent); text-shadow: 0 1px 2px #000; }
.gr-rare { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,0.7); color: #ffd54a; font-size: 0.65rem; padding: 2px 6px; border-radius: 8px; font-weight: 700; }
.gr-tools { display: flex; justify-content: center; gap: 8px; margin: 12px 0; }

#gr-picker { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,0.6); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 12px 12px; }
#gr-picker[hidden] { display: none; }
#gr-picker-box { width: 100%; max-width: 460px; background: var(--modal-bg, #1f2430); color: var(--text-color); border-radius: 14px; padding: 16px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
#gr-picker-box h3 { margin: 0 30px 10px 0; font-size: 1rem; }
#gr-close { float: right; background: none; border: 0; color: var(--text-color); font-size: 1.4rem; cursor: pointer; line-height: 1; }
#gr-search { width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 10px; border: 2px solid var(--primary-color); background: var(--tile-bg, #111); color: var(--text-color); font: inherit; font-size: 1rem; }
#gr-results { margin-top: 10px; max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.gr-opt { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; border: 1px solid var(--tile-border, rgba(255,255,255,0.2)); background: transparent; color: var(--text-color); cursor: pointer; text-align: left; font: inherit; }
.gr-opt:hover, .gr-opt:focus-visible { border-color: var(--primary-color); background: color-mix(in srgb, var(--primary-color) 14%, transparent); outline: none; }
.gr-opt.used { opacity: 0.45; }
.grid-page .gr-opt img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; margin: 0; box-shadow: none; flex-shrink: 0; }
.gr-opt span { display: flex; flex-direction: column; }
.gr-opt small { color: var(--text-muted-color); }
.gr-hint { color: var(--text-muted-color); font-size: 0.9rem; margin: 6px 2px; }
.gr-shake { animation: dl-shake 0.45s ease; }

#gr-toast { position: fixed; left: 50%; top: 14%; transform: translate(-50%, -10px); z-index: 70; background: rgba(0,0,0,0.85); color: #fff; padding: 10px 18px; border-radius: 10px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease; }
#gr-toast.show { opacity: 1; transform: translate(-50%, 0); }
#gr-result { margin: 18px auto 0; max-width: 600px; padding: 18px; border-radius: 14px; background: var(--tile-bg, rgba(0,0,0,0.25)); text-align: center; }
#gr-result h2 { margin-top: 0; }
.gr-share { display: inline-block; text-align: left; font-family: inherit; white-space: pre-wrap; margin: 0 0 10px; }
.gr-all { text-align: left; margin-top: 12px; }
.gr-all summary { cursor: pointer; font-weight: 600; }
.gr-all p { font-size: 0.9rem; margin: 6px 0; }
#gr-archive { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 480px) { #gr-board { gap: 4px; } .gr-row { min-height: 70px; } }
