/* =========================
   Base
========================= */
body {
  font-family: Arial;
  margin: 0;
  min-height: 100vh;
  padding: 24px;
  box-sizing: border-box;
  background: #fff1f6;
  text-align: center;
  touch-action: manipulation;
}

body.modal-open {
  overflow: hidden;
}

* {
  box-sizing: border-box;
}

a,
button,
input,
label,
.cell,
.collection-card,
.trade-card {
  touch-action: manipulation;
}

h1 {
  margin: 0 0 14px;
}

h3,
p {
  margin: 8px 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =========================
   Language Switch
========================= */
#lang-switch {
  position: fixed;
  top: 10px;
  left: 10px;
  background: white;
  padding: 6px 10px;
  border-radius: 6px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

#btn-ja.active,
#btn-en.active {
  background: #333;
  color: white;
  font-weight: bold;
}

/* =========================
   Container
========================= */
.container {
  background: white;
  padding: 20px;
  border: 3px solid #000;
  border-radius: 8px;
  max-width: 560px;
  margin: auto;
}

.site-footer {
  margin-top: 16px;
}

.home-intro {
  margin: 18px auto 0;
  padding: 12px 14px;
  border: 2px solid #e8a9bf;
  border-radius: 8px;
  background: #fff8fb;
  box-shadow: 0 3px 0 #d88aa6;
  color: #555;
  font-size: 13px;
  line-height: 1.7;
  text-align: left;
}

.home-intro h2 {
  margin: 0 0 6px;
  color: #333;
  font-size: 15px;
}

.home-intro p {
  margin: 0 0 6px;
}

.legal-container {
  max-width: 760px;
  text-align: left;
}

.legal-container h1 {
  text-align: center;
}

.legal-section {
  margin: 18px 0;
}

.legal-section h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.legal-section p {
  line-height: 1.7;
}

.legal-updated {
  color: #666;
  font-size: 13px;
}

.legal-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13px;
  line-height: 1;
}

.legal-links a {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  color: #555;
  text-decoration: underline;
}

.pixel-title {
  min-height: 50px;
}

.pixel-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  line-height: 0;
}

.logo-image {
  display: block;
  width: min(180px, 100%);
  height: auto;
  image-rendering: pixelated;
}

.logo-tile {
  display: grid;
  grid-template-columns: repeat(5, 4px);
  grid-auto-rows: 4px;
  gap: 0;
  padding: 0;
  background: transparent;
  line-height: 0;
}

.logo-cell {
  display: block;
  width: 4px;
  height: 4px;
}

/* =========================
   Grid（draw画面）
========================= */
#grid {
  display: grid;
  --draw-cell-size: 50px;
  grid-template-columns: repeat(5, var(--draw-cell-size));
  gap: 0;
  margin: 16px auto;
  width: fit-content;
  max-width: 100%;
  border: 4px solid #111;
}

.cell {
  width: var(--draw-cell-size);
  height: var(--draw-cell-size);
  border: 1px solid #999;
  background: #ffffff;
  box-sizing: border-box;
}

/* =========================
   Pixel Grid（表示専用）
========================= */
.pixel-grid {
  display: grid;
  grid-template-columns: repeat(5, 25px);

  /* ← これを変更 */
  grid-auto-rows: 25px;

  gap: 1px;
  background: #999;
  padding: 1px;
  margin: 12px auto;
  width: fit-content;

  line-height: 0;
}

.pixel-cell {
  width: 25px;
  height: 25px;
  display: block;
}

/* =========================
   Draw Grid（描画用）
========================= */
.draw-cell {
  width: var(--draw-cell-size, 50px);
  height: var(--draw-cell-size, 50px);
  border: 1px solid #999;
}

.title-area {
  margin: 10px 0;
}

#title-input {
  width: min(260px, 100%);
  padding: 10px;
  border: 2px solid #111;
  border-radius: 6px;
  font-size: 16px;
  text-align: center;
}

.color-area {
  display: inline-block;
  padding: 8px 12px;
  border: 2px solid #111;
  border-radius: 8px;
  background: #fff7fb;
  min-width: 170px;
  box-shadow: 0 3px 0 #111;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.color-area:hover {
  transform: translateY(-2px);
  background: white;
}

.color-area:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 #111;
}

.draw-tools {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.color-history {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  margin: 10px auto 0;
  flex-wrap: wrap;
}

.color-history:empty {
  display: none;
}

.color-swatch {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 2px solid #111;
  border-radius: 6px;
  background: var(--swatch-color, #fff);
  box-shadow: 0 2px 0 #111;
  cursor: pointer;
}

.color-swatch.active {
  transform: translateY(-2px);
  outline: 3px solid #ff8fbd;
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .color-swatch:hover {
    transform: translateY(-2px);
    outline: 3px solid #ff8fbd;
    outline-offset: 2px;
  }
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 2px solid #111;
  border-radius: 8px;
  background: white;
  box-shadow: 0 3px 0 #111;
  cursor: pointer;
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
}

.icon-button:hover {
  transform: translateY(-2px);
  background: #fff1f6;
}

.icon-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 0 #111;
}

.color-label {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  font-weight: bold;
  cursor: pointer;
}

.color-preview {
  display: block;
  width: 46px;
  height: 34px;
  border: 2px solid #111;
  border-radius: 6px;
  background: var(--current-color, #ff8fbd);
}

#colorPicker {
  width: 46px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
  display: block;
  position: absolute;
  right: 0;
  opacity: 0;
  -webkit-appearance: none;
  appearance: none;
}

#colorPicker::-webkit-color-swatch-wrapper {
  padding: 0;
}

#colorPicker::-webkit-color-swatch {
  border: 0;
  padding: 0;
}

#colorPicker::-moz-color-swatch {
  border: 0;
}

/* =========================
   Art Area
========================= */
.art-area {
  margin: 16px 0;
  text-align: center;
}

#art-display {
  display: inline-block;
}

.trade-deck {
  position: relative;
  width: min(260px, 100%);
  height: 258px;
  margin: 16px auto 8px;
}

.trade-card {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 238px;
  padding: 14px 12px 12px;
  border: 2px solid #e8a9bf;
  border-radius: 8px;
  background: #fff8fb;
  box-shadow: 0 4px 0 #d88aa6;
  cursor: pointer;
  user-select: none;
  touch-action: pan-y;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.trade-feedback {
  position: absolute;
  left: 50%;
  bottom: 12px;
  z-index: 3;
  padding: 8px 14px;
  border: 2px solid #ff5f9f;
  border-radius: 8px;
  background: white;
  color: #ff5f9f;
  font-size: 22px;
  font-weight: bold;
  opacity: 0;
  transform: translate(-50%, 18px) scale(0.85);
}

.trade-feedback.show {
  opacity: 1;
  transform: translate(-50%, -34px) scale(1.15);
}

.trade-card .trade-feedback.show {
  animation: get-pop 0.42s cubic-bezier(0.18, 1.4, 0.28, 1) both;
}

@keyframes get-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, 24px) scale(0.65);
  }

  58% {
    opacity: 1;
    transform: translate(-50%, -42px) scale(1.22);
  }

  100% {
    opacity: 1;
    transform: translate(-50%, -34px) scale(1.08);
  }
}

.trade-feedback.blue-get {
  border-color: #56bfe3;
  color: #168aad;
}

.trade-card.even-card {
  background: #eefaff;
  border-color: #9fd7ea;
  box-shadow: 0 4px 0 #8ec8dd;
}

.trade-card-current {
  z-index: 2;
}

.trade-card-next {
  z-index: 1;
  transform: none;
  opacity: 1;
  pointer-events: none;
}

.trade-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #d88aa6;
}

.trade-card.dragging {
  transition: none;
  cursor: grabbing;
}

.trade-card.swipe-left {
  transform: translateX(-720px) rotate(-22deg);
  opacity: 0;
  transition: transform 0.28s ease-in, opacity 0.24s ease-in;
}

.trade-card.swipe-right {
  transform: translateX(720px) rotate(22deg);
  opacity: 0;
  transition: transform 0.28s ease-in, opacity 0.24s ease-in;
}

.trade-card .art-area {
  margin: 0;
  text-align: center;
}

.trade-card .title-area {
  margin-top: 8px;
}

/* =========================
   Buttons
========================= */
.button-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 14px;
}

.exchange-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.button {
  position: relative;
  display: block;
  width: 220px;
  padding: 12px;
  margin: 6px;
  font-size: 18px;
  font-weight: bold;
  background: white;
  color: #111;
  text-decoration: none;
  border-radius: 8px;
  border: 2px solid #111;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease;
}

.button-primary {
  background: #ff5f9f;
  border-color: #111;
  color: white;
  box-shadow: 0 4px 0 #111;
}

.button-secondary {
  background: white;
  border-color: #111;
  color: #111;
  box-shadow: 0 3px 0 #111;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary:hover {
  background: #ff3f8c;
}

.button-secondary:hover {
  background: #fff1f6;
}

.button:focus-visible {
  outline: 3px solid #ff8fbd;
  outline-offset: 3px;
}

.button:disabled {
  opacity: 0.5;
  cursor: wait;
  transform: none;
  box-shadow: 0 3px 0 #111;
}

.button.has-notice::after {
  content: "!";
  position: absolute;
  top: -8px;
  right: -8px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid #56bfe3;
  border-radius: 50%;
  background: #eefaff;
  color: #168aad;
  font-size: 16px;
  font-weight: bold;
  line-height: 1;
  box-shadow: 0 2px 0 #9ad9ef;
}

/* =========================
   MVP / Text
========================= */
.mvp {
  font-size: 22px;
  margin-top: 12px;
}

.mvp-count {
  position: absolute;
  top: -18px;
  left: -16px;
  z-index: 2;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: #7a4f00;
  margin-top: 0;
  display: inline-flex;
  padding: 4px 8px;
  border: 2px solid #f0b429;
  border-radius: 999px;
  background: #fff8d8;
  box-shadow: 0 2px 0 #d6a51e;
  font-weight: normal;
  line-height: 1;
}

.topic {
  font-size: 16px;
  color: #555;
  margin-top: 0;
}

.mvp-card {
  position: relative;
  width: fit-content;
  margin: 13px auto 7px;
  padding: 12px 14px 5px;
  border: 2px solid #e8a9bf;
  border-radius: 8px;
  background: #fff8fb;
  box-shadow: 0 3px 0 #d88aa6;
}

.mvp-card[role="button"] {
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.mvp-card[role="button"]:hover {
  transform: translateY(-2px);
  background: #fff2f7;
  box-shadow: 0 5px 0 #d88aa6;
}

.mvp-card[role="button"]:focus-visible {
  outline: 3px solid #ff8fbd;
  outline-offset: 4px;
}

.mvp-share-modal[hidden] {
  display: none;
}

.mvp-share-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 28px 18px;
}

.mvp-share-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
}

.mvp-share-panel {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  grid-template-rows: auto 1fr auto;
  align-content: stretch;
  row-gap: 0;
  width: min(350px, calc(100vw - 36px));
  aspect-ratio: 1;
  padding: 9px 16px 12px;
  border: 3px solid #e8a9bf;
  border-radius: 10px;
  background: #fff8fb;
  box-shadow: 0 6px 0 #d88aa6;
}

.mvp-share-close {
  position: absolute;
  top: -44px;
  right: 0;
  z-index: 3;
  width: 34px;
  height: 34px;
  border: 2px solid #111;
  border-radius: 50%;
  background: #fff;
  color: #111;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.mvp-share-logo .logo-image {
  width: min(150px, 42vw);
}

.mvp-share-card {
  position: relative;
  align-self: start;
  width: fit-content;
  margin: 24px auto 0;
  padding: 12px 14px 5px;
  border: 2px solid #e8a9bf;
  border-radius: 8px;
  background: #fff8fb;
  box-shadow: 0 3px 0 #d88aa6;
}

.mvp-share-label {
  position: absolute;
  top: -18px;
  left: -16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 4px 8px;
  border: 2px solid #f0b429;
  border-radius: 999px;
  background: #fff8d8;
  color: #7a4f00;
  box-shadow: 0 2px 0 #d6a51e;
  font-size: 13px;
  line-height: 1;
}

.mvp-share-art {
  width: clamp(153px, 48vw, 178px);
  height: clamp(153px, 48vw, 178px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  color: #555;
  font-size: 14px;
}

.mvp-share-art .mvp-preview {
  padding: 4px;
  border: 0;
  background: #fff;
}

.mvp-share-title {
  max-width: 100%;
  margin-top: 0;
  font-size: 16px;
  font-weight: normal;
  color: #555;
  overflow-wrap: anywhere;
}

.mvp-share-url {
  align-self: end;
  margin-top: 0;
  color: #777;
  font-size: 14px;
}

/* =========================
   Animation Box
========================= */
.animation {
  width: 155px;
  height: 155px;
  margin: 0 auto;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  font-size: 14px;
}

.mvp-pixel-grid {
  margin: 0 auto;
  border: 0;
}

.mvp-preview {
  display: inline-block;
  padding: 4px;
  border: 0;
  border-radius: 6px;
  background: #ffffff;
}

.mvp-preview .pixel-grid {
  outline: 1px solid #999;
  outline-offset: 0;
}

.trade-card #art-display p,
.trade-card #next-art-display p {
  margin: 0;
  line-height: 1.4;
}

.trade-preview {
  cursor: default;
}

.trade-card.even-card .trade-preview {
  border-color: #9fd7ea;
}

.mvp-crown {
  color: #f0b429;
  font-size: 20px;
  line-height: 1;
  vertical-align: -1px;
}

.mvp-award-popup {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 28px);
  padding: 10px 16px;
  border: 2px solid #e8a9bf;
  border-radius: 999px;
  background: #fff8fb;
  color: #111;
  box-shadow: 0 4px 0 #d88aa6;
  font-size: 16px;
  font-weight: bold;
  opacity: 0;
  transform: translate(-50%, 18px) scale(0.92);
  transition: opacity 0.18s ease, transform 0.22s ease;
  pointer-events: none;
}

.mvp-award-popup.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.mvp-award-crown {
  color: #f0b429;
  font-size: 20px;
  line-height: 1;
}

/* =========================
   Collection
========================= */
.collection-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 10px 0 14px;
  width: min(390px, 100%);
  padding: 12px 14px;
  border: 2px solid #e8a9bf;
  border-radius: 8px;
  background: #fff8fb;
  box-shadow: 0 3px 0 #d88aa6;
  margin-left: auto;
  margin-right: auto;
}

.collection-container {
  max-width: 900px;
}

.collection-container #collection-title {
  margin-bottom: 20px;
}

.collection-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: -6px auto 14px;
}

.collection-tab {
  position: relative;
  min-width: 120px;
  padding: 8px 12px;
  border: 2px solid #e8a9bf;
  border-radius: 8px;
  background: #fff;
  color: #555;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 3px 0 #d88aa6;
}

.collection-tab.active {
  background: #fff1f6;
  color: #111;
  transform: translateY(2px);
  box-shadow: 0 1px 0 #d88aa6;
}

.collection-tab.has-notice::after {
  content: "!";
  position: absolute;
  top: -8px;
  right: -8px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid #56bfe3;
  border-radius: 50%;
  background: #eefaff;
  color: #168aad;
  font-size: 15px;
  font-weight: bold;
  line-height: 1;
  box-shadow: 0 2px 0 #9ad9ef;
}

.collection-actions .button {
  width: 150px;
  padding: 9px;
  font-size: 14px;
  margin: 0;
}

.collection-action-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.selected-preview {
  width: 100%;
  min-height: 70px;
  padding: 10px 8px;
  display: grid;
  justify-items: center;
  align-items: center;
  gap: 6px;
  border: 1px solid #e8a9bf;
  border-radius: 6px;
  background: #fff;
  color: #555;
  font-size: 13px;
}

.selected-preview .pixel-grid {
  margin: 0 auto;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.collection-empty {
  grid-column: 1 / -1;
  margin: 14px 0;
  text-align: center;
  color: #555;
  font-size: 14px;
}

.collection-card {
  position: relative;
  padding: 8px 6px 7px;
  border: 2px solid #e8a9bf;
  border-radius: 8px;
  background: #fff8fb;
  box-shadow: 0 3px 0 #d88aa6;
  text-align: center;
  cursor: pointer;
}

.collection-card.selected {
  outline: 3px solid #ff5f9f;
  outline-offset: 2px;
}

.collection-new-badge {
  position: absolute;
  top: -8px;
  left: -8px;
  z-index: 2;
  padding: 4px 8px;
  border: 2px solid #56bfe3;
  border-radius: 999px;
  background: #eefaff;
  color: #168aad;
  font-size: 13px;
  font-weight: bold;
  line-height: 1;
  box-shadow: 0 2px 0 #9ad9ef;
  pointer-events: none;
}

.collection-mvp-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  z-index: 2;
  padding: 4px 8px;
  border: 2px solid #f0b429;
  border-radius: 999px;
  background: #fff8d8;
  color: #7a4f00;
  font-size: 13px;
  font-weight: bold;
  line-height: 1;
  box-shadow: 0 2px 0 #d6a51e;
  pointer-events: none;
}

.collection-preview {
  display: inline-block;
  padding: 4px;
  border: 1px solid #e8a9bf;
  border-radius: 6px;
  background: #ffffff;
}

.collection-preview .pixel-grid {
  margin: 0 auto;
  border: 0;
}

.collection-card-title {
  margin-top: 6px;
  font-size: 13px;
  font-weight: bold;
  color: #111;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-card-date {
  margin-top: 2px;
  font-size: 11px;
  color: #888;
  line-height: 1.2;
}

.collection-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  width: fit-content;
  margin: 16px auto 4px;
  padding: 8px 10px;
  border: 2px solid #e8a9bf;
  border-radius: 8px;
  background: #fff8fb;
  box-shadow: 0 3px 0 #d88aa6;
}

.collection-pager .button {
  width: 96px;
  margin: 0;
  padding: 8px;
  font-size: 13px;
}

#collection-page-info {
  min-width: 56px;
  font-size: 13px;
  font-weight: bold;
  text-align: center;
  color: #111;
}

/* =========================
   Admin
========================= */
.admin-container {
  max-width: 860px;
}

.admin-note,
.admin-status,
.admin-meta,
.admin-id {
  color: #555;
  font-size: 14px;
}

.admin-actions {
  display: grid;
  gap: 10px;
  margin: 14px auto;
}

.admin-action-row,
.admin-item-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-filter-row {
  padding: 10px;
  border: 2px solid #e8a9bf;
  border-radius: 8px;
  background: #fff8fb;
}

.admin-pager-row,
.admin-bulk-row {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 8px 10px;
  border: 2px solid #e8a9bf;
  border-radius: 8px;
  background: #fff8fb;
  box-shadow: 0 3px 0 #d88aa6;
}

.admin-actions .button {
  width: 132px;
  margin: 0;
  padding: 8px;
  font-size: 13px;
}

.admin-page-size {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: bold;
}

.admin-page-size select {
  min-width: 96px;
  padding: 6px;
  border: 2px solid #111;
  border-radius: 6px;
  background: #fff;
}

.admin-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.admin-card {
  padding: 10px 10px 6px;
  border: 2px solid #111;
  border-radius: 8px;
  background: #fff7fb;
  text-align: center;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.admin-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 0 #111;
}

.admin-card-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.admin-card-select-area {
  display: grid;
  justify-items: center;
  gap: 6px;
  cursor: pointer;
}

.admin-card-preview .pixel-grid {
  margin: 0 auto;
}

.admin-card-info-area {
  margin-top: 6px;
  cursor: pointer;
}

.admin-card-title {
  font-weight: bold;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-card-meta {
  color: #555;
  font-size: 12px;
  margin-top: 2px;
  margin-bottom: 0;
}

.admin-item-body {
  display: grid;
  gap: 8px;
}

.admin-id {
  word-break: break-all;
}

.admin-title-input {
  width: 100%;
  padding: 10px;
  border: 2px solid #111;
  border-radius: 6px;
  font-size: 16px;
}

.admin-button {
  width: 150px;
  padding: 9px;
  font-size: 14px;
  margin: 0;
}

.admin-detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.admin-detail[hidden] {
  display: none;
}

.admin-detail {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.35);
}

.admin-detail-panel {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr);
  gap: 18px;
  width: min(560px, 100%);
  padding: 18px;
  border: 3px solid #111;
  border-radius: 8px;
  background: white;
}

.admin-detail-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: 2px solid #111;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  font-weight: bold;
}

@media (max-width: 760px) {
  .collection-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 520px) {
  body {
    padding: 14px;
  }

  .container {
    padding: 16px;
  }

  #grid {
    --draw-cell-size: min(46px, calc((100vw - 56px) / 5));
    grid-template-columns: repeat(5, var(--draw-cell-size));
  }

  .cell,
  .draw-cell {
    width: var(--draw-cell-size);
    height: var(--draw-cell-size);
  }

  .button {
    width: min(220px, 100%);
  }

  .collection-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-detail-panel,
  .admin-item {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .admin-preview .pixel-grid {
    margin: 0 auto;
  }

  .pixel-logo {
    width: 100%;
  }

  .logo-image {
    width: min(150px, 100%);
  }
}
