:root {
  --green: #17634b;
  --green-dark: #104b39;
  --soft: #e9f3ed;
  --ink: #23352d;
  --muted: #64746b;
  --paper: #f7f9f5;
  --line: #dce4dc;
  --white: #fff;
  --radius: 18px;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
    "PingFang SC", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.65;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
[hidden] {
  display: none !important;
}
html {
  scroll-behavior: smooth;
}
a {
  color: var(--green);
  text-decoration: none;
  overflow-wrap: anywhere;
}
a:hover {
  text-decoration: underline;
}
img {
  display: block;
  max-width: 100%;
  height: auto;
}
button,
input,
select {
  font: inherit;
  touch-action: manipulation;
}
button,
.button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #d99031;
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin: 0 0 0.7em;
  overflow-wrap: anywhere;
}
h1 {
  font-size: clamp(30px, 5vw, 50px);
  line-height: 1.2;
  letter-spacing: -1px;
}
h2 {
  font-size: 26px;
  line-height: 1.35;
}
h3 {
  font-size: 19px;
  line-height: 1.4;
}
.container {
  max-width: 1120px;
  padding: 0 24px;
  margin: auto;
}
main {
  min-height: 60vh;
}
.small {
  font-size: 13px;
}
.muted {
  color: var(--muted);
}
.prose {
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.center {
  text-align: center;
}
.skip {
  position: fixed;
  top: -80px;
  left: 16px;
  z-index: 100;
  background: white;
  padding: 8px;
}
.skip:focus {
  top: 8px;
}
.icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.site-header {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  color: var(--ink);
  font-size: 18px;
}
.brand:hover {
  text-decoration: none;
}
.brand-icon {
  background: var(--green);
  color: white;
  border-radius: 12px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.desktop-nav {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.desktop-nav a {
  color: var(--muted);
  padding: 10px 16px;
  border-radius: 10px;
}
.desktop-nav a.active {
  color: var(--green);
  background: var(--soft);
  font-weight: 700;
}
.mobile-nav {
  display: none;
}
.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 20px;
  background: var(--green);
  color: white;
  border: 1px solid var(--green);
  border-radius: 12px;
  font-weight: 650;
  text-decoration: none;
}
.button:hover,
button:hover:not(:disabled) {
  background: var(--green-dark);
  text-decoration: none;
}
.button.secondary,
button.secondary {
  background: white;
  border-color: var(--line);
  color: var(--green);
}
.secondary:hover:not(:disabled) {
  background: var(--soft);
}
.button.small,
button.small {
  min-height: 40px;
  padding: 7px 12px;
  font-size: 14px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.pill {
  display: inline-flex;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 650;
  padding: 6px 10px;
  border-radius: 30px;
  background: var(--soft);
  color: var(--green);
}
.pill.gray,
.status-borrowed,
.status-unknown {
  background: #eef0ed;
  color: #58665d;
}
.status-reserved,
.status-maintenance {
  background: #fff0d5;
  color: #805318;
}
.status-conflict {
  background: #fce8e7;
  color: #b33636;
}
.eyebrow {
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 1.5px;
  color: var(--green);
  margin-bottom: 12px;
}
.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 45px;
  padding: 45px 0 55px;
}
.hero h1 {
  font-size: clamp(34px, 4.6vw, 54px);
  margin: 18px 0 20px;
  max-width: 500px;
}
.hero-description {
  max-width: 480px;
  color: var(--muted);
  font-size: 17px;
  margin-bottom: 24px;
}
.hero-stats {
  display: flex;
  gap: 30px;
  margin: 28px 0 0;
}
.hero-stats strong {
  display: block;
  font-size: 24px;
  font-weight: 800;
}
.hero-stats span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.section {
  margin: 40px 0 52px;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.section-heading h2 {
  margin: 0;
}
.section-heading p {
  margin: 5px 0 0;
  font-size: 14px;
  color: var(--muted);
}
.notice {
  padding: 22px 26px;
  background: #edf3e8;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.notice h3 {
  font-size: 17px;
  margin-bottom: 5px;
}
.notice p {
  font-size: 14px;
  margin: 0;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 0;
}
.card-image {
  width: 100%;
  height: 185px;
  object-fit: cover;
  background: #edf2e8;
}
.card-body {
  padding: 20px;
}
.card-title {
  font-size: 20px;
  color: var(--ink);
  font-weight: 750;
}
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
  margin: 10px 0;
}
.card-description {
  font-size: 13px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 43px;
}
.empty {
  grid-column: 1 / -1;
  background: white;
  border: 1px dashed #cbd8cb;
  border-radius: var(--radius);
  padding: 38px 24px;
  text-align: center;
  color: var(--muted);
}
.empty strong {
  display: block;
  color: var(--ink);
  font-size: 19px;
  margin-bottom: 8px;
}
.empty p {
  margin: 0;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.feature {
  padding: 24px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.feature p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}
.join-panel {
  padding: 30px;
  border-radius: var(--radius);
  background: var(--green);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
}
.join-panel p {
  color: #d4e7dc;
  margin: 0;
}
.join-panel .button,
.join-panel button {
  background: white;
  color: var(--green);
  border-color: white;
}
.photo {
  margin: 0;
}
.photo img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}
.photo figcaption {
  padding: 12px 16px;
  color: var(--muted);
  font-size: 14px;
  white-space: pre-line;
}
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 52px;
  padding: 24px 0 32px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}
.page-title {
  padding: 28px 0 22px;
}
.page-title h1 {
  font-size: 34px;
}
.page-title p {
  color: var(--muted);
  margin: 0;
}
.filters {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}
label {
  display: block;
  font-size: 14px;
  font-weight: 650;
  margin-bottom: 6px;
}
input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cdd9d0;
  background: white;
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
}
.filter-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.filter-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}
.check-label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 400;
  margin: 0;
  min-height: 42px;
}
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: auto;
  flex-shrink: 0;
  accent-color: var(--green);
}
.result-bar {
  margin: 20px 0;
  font-size: 14px;
  color: var(--muted);
}
.pagination {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin: 28px 0;
}
.back-link {
  display: inline-flex;
  margin: 15px 0 25px;
  color: var(--muted);
  font-size: 14px;
  min-height: 40px;
  align-items: center;
}
.game-top {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: 38px;
  align-items: start;
}
.game-cover {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--soft);
}
.game-info h1 {
  font-size: 34px;
  margin: 12px 0;
}
.game-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  background: white;
  border: 1px solid var(--line);
  padding: 16px;
  border-radius: 14px;
  margin: 22px 0;
  font-weight: 650;
}
.stock {
  margin: 18px 0;
}
.copy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}
.content-panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  margin: 20px 0;
}
.content-panel h2 {
  font-size: 22px;
}
.content-panel p:last-child {
  margin-bottom: 0;
}
.content-panel .button {
  margin: 6px 8px 0 0;
}
.inline-info {
  padding: 14px 18px;
  background: var(--soft);
  border-radius: 12px;
  font-size: 14px;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.gallery img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
}
.modal {
  width: min(480px, calc(100% - 36px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  color: var(--ink);
}
.modal::backdrop {
  background: #17302580;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.modal-header h2 {
  margin: 0;
}
.close-button {
  background: var(--soft);
  border: 0;
  color: var(--green);
  font-size: 24px;
  padding: 0;
  width: 44px;
  height: 44px;
}
.qr {
  max-width: 260px;
  margin: 0 auto 18px;
}
noscript {
  display: block;
  padding: 18px;
  background: #fff0d5;
}
@media (max-width: 900px) {
  .hero {
    gap: 25px;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .game-top {
    grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
    gap: 24px;
  }
}
@media (max-width: 640px) {
  body {
    padding-bottom: 80px;
  }
  .container {
    padding: 0 18px;
  }
  .site-header {
    min-height: 66px;
  }
  .brand {
    font-size: 16px;
  }
  .brand-icon {
    width: 35px;
    height: 35px;
  }
  .desktop-nav {
    display: none;
  }
  .mobile-nav {
    position: fixed;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--line);
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    z-index: 30;
  }
  .mobile-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--muted);
    font-size: 11px;
    min-height: 46px;
    padding: 4px;
  }
  .mobile-nav a.active {
    color: var(--green);
    font-weight: 750;
  }
  .hero {
    grid-template-columns: 1fr;
    padding: 22px 0 30px;
    gap: 28px;
  }
  .hero h1 {
    font-size: 38px;
  }
  .hero-description {
    font-size: 15px;
  }
  .hero-stats {
    gap: 25px;
  }
  .section {
    margin: 30px 0 38px;
  }
  .section-heading {
    align-items: flex-start;
  }
  .section-heading h2 {
    font-size: 22px;
  }
  .section-heading a {
    font-size: 13px;
    white-space: nowrap;
  }
  .notice {
    padding: 18px;
  }
  .grid {
    gap: 12px;
  }
  .card-image {
    height: 140px;
  }
  .card-body {
    padding: 13px;
  }
  .card-title {
    font-size: 16px;
  }
  .card-meta {
    gap: 6px;
    font-size: 11px;
  }
  .card-description {
    min-height: 43px;
  }
  .feature-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .feature {
    padding: 18px;
  }
  .join-panel {
    padding: 24px;
    flex-direction: column;
    align-items: flex-start;
  }
  .site-footer {
    margin-top: 30px;
    padding-bottom: 20px;
  }
  .page-title h1 {
    font-size: 30px;
  }
  .filters {
    padding: 15px;
  }
  .filter-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .filter-row select {
    font-size: 14px;
  }
  .game-top {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .game-cover {
    max-height: 380px;
  }
  .game-info h1 {
    font-size: 30px;
  }
  .content-panel {
    padding: 20px;
  }
}
@media (max-width: 360px) {
  .grid {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* 图片保留原比例；卡片按列流动，整张卡片是一个链接。 */
.masonry {
  columns: 3;
  column-gap: 20px;
}
.masonry .card {
  break-inside: avoid;
  margin: 0 0 20px;
}
.card-link {
  display: block;
  color: inherit;
  height: 100%;
}
.card-link:hover {
  text-decoration: none;
}
.card-link:hover .card-title {
  color: var(--green);
}
.card-link:focus-visible {
  outline-offset: -4px;
}
.card-image,
.photo img {
  height: auto;
  width: 100%;
  object-fit: contain;
}
.card-description {
  min-height: 0;
}
.card-title {
  margin: 0;
}
.card-category {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.catalog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 32px 0 16px;
}
.catalog-heading h1 {
  font-size: 32px;
  margin: 0;
}
.catalog-heading h1 {
  flex: 1;
  min-width: 0;
}
.search-controls {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(480px, 48%);
  min-width: 0;
}
.search-controls input {
  flex: 1;
  width: 100%;
  min-width: 0;
}
.search-controls > button {
  min-height: 46px;
  flex-shrink: 0;
}
.filter-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(560px, calc(100vw - 48px));
  z-index: 40;
}
.filter-popover .filters {
  margin: 0;
  max-height: min(560px, calc(100dvh - 150px));
  overflow-y: auto;
  box-shadow: 0 16px 44px #23352d24;
}
.filter-popover .filter-row {
  margin-top: 0;
}
body[data-page="catalog"] .masonry {
  columns: 4;
  column-gap: 16px;
}
body[data-page="catalog"] .masonry .card {
  margin-bottom: 16px;
}
body[data-page="catalog"] .card-body {
  padding: 14px;
}
body[data-page="catalog"] .card-title {
  font-size: 17px;
}
body[data-page="catalog"] .card-meta {
  font-size: 12px;
  gap: 8px;
  margin: 8px 0;
}
body[data-page="catalog"] .card-description {
  font-size: 12px;
  margin-bottom: 0;
}
.game-cover {
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  max-height: none;
}
.image-preview-button {
  display: block;
  border: 0;
  background: transparent;
  padding: 0;
  min-height: 0;
  width: 100%;
}
.image-preview-button:hover:not(:disabled) {
  background: transparent;
}
.gallery {
  align-items: start;
}
.gallery img {
  aspect-ratio: auto;
  object-fit: contain;
}
.image-dialog {
  width: min(1000px, calc(100% - 32px));
  max-height: 92vh;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  color: var(--ink);
}
.image-dialog::backdrop {
  background: #173025bb;
}
.image-dialog img {
  width: auto;
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  margin: auto;
}
.image-controls {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}
.document-block + .document-block {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.html-document {
  width: 100%;
  min-height: 400px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}
.rich-document {
  overflow-wrap: anywhere;
}
.rich-document pre {
  white-space: pre-wrap;
  background: var(--paper);
  padding: 16px;
  border-radius: 8px;
}
.rich-document code {
  background: var(--paper);
  padding: 2px 4px;
}
.rich-document blockquote {
  border-left: 3px solid var(--line);
  margin: 12px 0;
  padding-left: 18px;
  color: var(--muted);
}
.table-scroll {
  overflow-x: auto;
}
.rich-document table {
  border-collapse: collapse;
  width: 100%;
}
.rich-document th,
.rich-document td {
  padding: 10px;
  border: 1px solid var(--line);
  text-align: left;
}
.site-footer > span:last-child {
  margin-left: auto;
  text-align: right;
}
@media (max-width: 900px) {
  .masonry {
    columns: 2;
  }
}
@media (max-width: 1100px) {
  body[data-page="catalog"] .masonry {
    columns: 3;
  }
}
@media (max-width: 900px) {
  body[data-page="catalog"] .masonry {
    columns: 2;
  }
}
@media (max-width: 640px) {
  .mobile-nav {
    grid-template-columns: repeat(3, 1fr);
  }
  .masonry {
    column-gap: 12px;
  }
  .masonry .card {
    margin-bottom: 12px;
  }
  .catalog-heading {
    flex-wrap: wrap;
    gap: 16px;
  }
  .catalog-heading h1 {
    font-size: 28px;
  }
  .search-controls {
    width: 100%;
  }
  .filter-popover {
    width: calc(100vw - 36px);
  }
  body[data-page="catalog"] .card-body {
    padding: 12px;
  }
  body[data-page="catalog"] .card-title {
    font-size: 16px;
  }
  .card-image,
  .photo img {
    height: auto;
  }
}
@media (max-width: 360px) {
  .masonry,
  body[data-page="catalog"] .masonry {
    columns: 1;
  }
}

.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.form-grid .full{grid-column:1/-1}label{display:block;font-size:14px;font-weight:650;margin-bottom:6px}input,select,textarea{width:100%;min-height:46px;border:1px solid #cdd9d0;background:white;color:var(--ink);border-radius:10px;padding:10px 12px}textarea{min-height:110px;resize:vertical}input[type=checkbox]{width:18px;height:18px;min-height:auto;flex-shrink:0;accent-color:var(--green)}.check-label{display:flex;gap:10px;align-items:flex-start;font-weight:400;font-size:14px;padding:12px 0}.check-label input{margin-top:4px}.error{color:var(--red);font-size:14px;white-space:pre-line;overflow-wrap:anywhere}.error:empty{display:none}.form-error{margin:12px 0}.honeypot{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}.status-title{display:flex;gap:16px;align-items:center}.status-title .brand-icon{width:54px;height:54px}.receipt-link{font-size:13px;overflow-wrap:anywhere;background:var(--paper);padding:12px;border:1px dashed var(--line);border-radius:10px}.steps{list-style:none;padding:0;margin:24px 0}.steps li{padding:10px 0 10px 28px;position:relative;color:var(--muted);border-left:2px solid var(--line);margin-left:8px}.steps li::before{content:'';width:12px;height:12px;background:var(--line);border-radius:50%;position:absolute;left:-7px;top:19px}.steps li.current{color:var(--green);font-weight:700}.steps li.current::before{background:var(--green)}.toast{position:fixed;left:50%;bottom:95px;transform:translateX(-50%);background:var(--green-dark);color:white;padding:12px 20px;border-radius:12px;z-index:100;width:max-content;max-width:calc(100vw - 32px);font-size:14px}
.admin-header{background:white;border-bottom:1px solid var(--line)}.admin-header .container{display:flex;justify-content:space-between;align-items:center;padding-top:18px;padding-bottom:18px;gap:12px}.admin-shell{display:grid;grid-template-columns:175px 1fr;gap:28px;margin:26px auto}.admin-nav{display:flex;flex-direction:column;gap:6px;align-self:start;position:sticky;top:20px}.admin-nav button{background:transparent;border-color:transparent;color:var(--muted);justify-content:flex-start;text-align:left;padding:12px 14px;font-size:14px}.admin-nav button.active{background:var(--green-soft);color:var(--green)}.admin-main{min-width:0}.admin-title{display:flex;justify-content:space-between;align-items:center;gap:14px;margin:0 0 22px}.admin-title h1{font-size:28px;letter-spacing:-.5px;margin:0}.stat-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:20px}.stat-card{border:1px solid var(--line);background:white;border-radius:14px;padding:18px}.stat-card strong{display:block;font-size:30px}.stat-card span{color:var(--muted);font-size:13px}.table-wrap{overflow:auto;background:white;border:1px solid var(--line);border-radius:14px}table{border-collapse:collapse;width:100%;font-size:14px;text-align:left}th{background:#f0f4ee;font-size:12px;color:var(--muted);font-weight:650}td,th{padding:14px 16px;border-bottom:1px solid var(--line);vertical-align:top}tr:last-child td{border-bottom:0}td .actions{min-width:110px}td .button,td button{font-size:12px;min-height:40px;padding:6px 10px}.table-name{min-width:140px;display:block;font-weight:650}.table-sub{font-size:12px;color:var(--muted);margin-top:3px;max-width:280px;overflow-wrap:anywhere}.risk-row{background:#fff6f3}.login-panel{width:min(460px,100%);margin:64px auto;padding:32px;border-radius:var(--radius);background:white;border:1px solid var(--line)}.login-panel label{margin-top:16px}.login-panel button{margin-top:20px;width:100%}.admin-toolbar{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:18px}.admin-toolbar input{flex:1;min-width:180px}.admin-toolbar select{width:auto;min-width:140px}.admin-toolbar button{white-space:nowrap}.detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;background:var(--paper);padding:16px;border-radius:12px;font-size:14px;margin-bottom:16px}.detail-grid span{color:var(--muted);display:block;font-size:12px}.detail-grid strong{font-weight:650;overflow-wrap:anywhere}.admin-user{font-size:13px;display:flex;gap:10px;align-items:center}.caption-row{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:8px}

.image-picker input[type=file]{max-width:100%;margin-top:6px}.image-picker .image-status{margin:6px 0}.image-preview{display:block;max-width:100%;width:180px;max-height:140px;object-fit:contain;border-radius:8px;margin-top:8px}.image-preview[hidden]{display:none}


/* Existing application forms and admin controls share the reference palette. */
:root { --green-soft: var(--soft); --accent: #d99031; --red: #b33636; }
.visually-hidden { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:-1px!important; overflow:hidden!important; clip:rect(0,0,0,0)!important; white-space:nowrap!important; border:0!important; }
.narrow { max-width:780px; }
button.ghost, .button.ghost { background:transparent; border-color:transparent; color:var(--green); }
.danger { background:var(--red)!important; border-color:var(--red)!important; color:white!important; }
.pill.warn { background:#fff0d5; color:#805318; }
.pill.red { background:#fce8e7; color:var(--red); }
.stock { display:flex; flex-wrap:wrap; gap:8px; }
.filter-actions .check-label { align-items:center; gap:8px; margin:0; padding:0; min-height:42px; }
.filter-actions .check-label input { margin-top:0; }
.demo-banner { padding:10px 16px; background:#fff2d8; border-radius:10px; color:#78551e; font-size:13px; margin-top:18px; }
.loading { padding:35px; color:var(--muted); text-align:center; }
.masonry > .empty, .masonry > .loading { column-span:all; }
#application .check-label { align-items:flex-start; margin:12px 0; }
#application .check-label input { margin-top:4px; }
.admin-page .modal { width:min(780px,calc(100% - 24px)); max-height:90dvh; overflow:auto; }
textarea { font:inherit; width:100%; min-height:110px; border:1px solid #cdd9d0; background:white; color:var(--ink); border-radius:10px; padding:10px 12px; resize:vertical; }
textarea:focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
@media(max-width:900px) {
  .stat-grid { grid-template-columns:repeat(2,1fr); }
  .admin-shell { grid-template-columns:140px 1fr; gap:16px; }
}
@media(max-width:640px) {
  .form-grid { grid-template-columns:1fr; }
  .form-grid .full { grid-column:1; }
  .admin-header .container { padding-top:14px; padding-bottom:14px; }
  .admin-user { font-size:12px; }
  .admin-user .button { font-size:12px; padding:6px 10px; }
  .admin-shell { display:block; margin-top:16px; }
  .admin-nav { position:static; flex-direction:row; overflow:auto; gap:4px; padding-bottom:12px; margin-bottom:18px; }
  .admin-nav button { min-width:max-content; font-size:13px; padding:9px 12px; }
  .admin-title { flex-wrap:wrap; }
  .admin-title h1 { font-size:25px; }
  .stat-card { padding:15px; }
  .stat-card strong { font-size:26px; }
  .admin-toolbar input { min-width:100%; font-size:16px; }
  .admin-toolbar select { flex:1; }
  .caption-row { grid-template-columns:1fr; }
  .login-panel { margin:30px auto; padding:24px; }
  .admin-page { padding-bottom:0; }
  .admin-page .container { padding-left:14px; padding-right:14px; }
}

.hero-text-only, .game-text-only { grid-template-columns:1fr; }
.hero-text-only h1 { max-width:800px; }
.hero-text-only .hero-description { max-width:700px; }
.game-image-list { display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:12px; margin-top:12px; }
.game-image-item { margin:0; padding:12px; border:1px solid var(--line); border-radius:12px; background:var(--paper); min-width:0; }
.game-image-item img { width:100%; height:140px; object-fit:contain; }
.game-image-item figcaption { margin:8px 0; font-size:13px; font-weight:650; }
.game-image-item .actions { gap:6px; }
.game-image-item button { padding:6px 10px; font-size:12px; }

/* Unified collection editor. */
.game-editor fieldset{border:1px solid var(--border,#dedbd2);border-radius:14px;padding:20px;margin:24px 0;min-width:0}
.game-editor legend{font-size:18px;font-weight:700;padding:0 8px}
.field-label{display:block;font-weight:600;margin-bottom:8px}
.player-buttons{display:flex;flex-wrap:wrap;gap:8px}
.player-button{min-width:42px;padding:10px 12px;border:1px solid var(--border,#dedbd2)}
.player-button[aria-pressed="true"]{background:var(--accent,#8e4f36);color:white;border-color:var(--accent,#8e4f36)}
.inventory-row,.rule-file-row{display:flex;align-items:center;flex-wrap:wrap;gap:12px;padding:12px 0;border-bottom:1px solid var(--border,#dedbd2)}
.inventory-row select{width:auto;min-width:120px}.inventory-row input{flex:1;min-width:160px}
.rule-file-row a{flex:1;overflow-wrap:anywhere}.rule-downloads{padding-left:20px}.rule-downloads li{margin:12px 0}
@media(max-width:600px){.game-editor fieldset{padding:14px}.inventory-row input{flex-basis:100%}}

/* Account usage and remaining free quota. */
.quota-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:24px 0}
.quota-card{padding:22px;border:1px solid var(--line);border-radius:14px;background:white;min-width:0}
.quota-card h2{font-size:18px;margin:0 0 8px}.quota-card .small{overflow-wrap:anywhere}
.quota-remaining{display:flex;flex-wrap:wrap;align-items:baseline;gap:10px;margin:20px 0 12px}
.quota-remaining strong{font-size:28px}.quota-remaining span{color:var(--muted);font-size:13px}
.quota-card meter{display:block;width:100%;height:16px;margin:12px 0}
.quota-warning{border-color:var(--accent);background:#fff9ef}.quota-warning .quota-remaining strong{color:#9a5720}
.quota-setup summary{font-weight:650;cursor:pointer}.quota-setup li{margin:12px 0}
@media(max-width:700px){.quota-grid{grid-template-columns:1fr}.quota-card{padding:18px}}
