/* Gameplay visibility fixes kept separate from the general UI theme. */
.ring {
  display: block;
  width: 100%;
  min-height: clamp(30px, 5vw, 43px);
  flex: 0 0 clamp(30px, 5vw, 43px);
  pointer-events: none;
}

/* Hidden Colors hides only the color, never the ring itself. */
.ring.hidden {
  display: block !important;
  background: #fff !important;
  border: 3px solid #172322;
  box-shadow: inset 0 -5px 0 #d9dedc, 0 3px 5px rgba(0, 0, 0, .18);
}

.ring.hidden::after {
  content: "?";
  display: grid;
  place-items: center;
  inset: 0;
  width: 100%;
  height: 100%;
  color: #172322;
  background: transparent;
  font-size: 1rem;
  font-weight: 950;
}

/* Keep colored rings as chunky and playful as the unknown ones, without a dark center dot. */
.ring:not(.hidden) {
  border: 3px solid #172322;
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .16), inset 0 5px 0 rgba(255, 255, 255, .2), 0 3px 5px rgba(0, 0, 0, .18);
}

.ring:not(.hidden)::after {
  content: "";
  width: 18%;
  height: 16%;
  left: 21%;
  top: 20%;
  background: rgba(255, 255, 255, .55);
}

.stack:focus-visible {
  outline: 4px solid var(--sun);
  outline-offset: 3px;
}

@media (max-width: 480px) {
  .ring {
    min-height: 31px;
    flex-basis: 31px;
  }

  .game-panel { min-height: 0; }
  .board { flex: none; padding: 10px 0 4px; }
  .stack { height: 190px; }
  .tool-grid { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .tool { min-height: 44px; padding: 4px; font-size: 0; }
  .tool .icon { width: 32px; height: 32px; font-size: 1rem; }
  .abandon { margin-top: 10px; min-height: 42px; }
}

/* Compact campaign rows keep their summary and actions on one desktop line. */
.campaign { grid-template-columns: minmax(180px, 1.4fr) repeat(4, minmax(62px, .45fr)) auto auto; }
.tier-summary { white-space: nowrap; }
.campaign-actions { display: flex; gap: 5px; }
.mini-action { min-height: 34px; padding: 0 9px; border-radius: 10px; font-size: .76rem; }

.dashboard-card { padding-bottom: 14px; }
.table-wrap { margin-top: 16px; border: 1px solid #e5e9e5; border-radius: 13px; }
.table-wrap table { background: white; }
.table-wrap th { background: #f5f8f5; }
.sort { appearance: none; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 900; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.sort:hover { color: var(--teal); }
.variant-icon { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #e7f2ef; color: var(--teal); font-size: 1rem; font-weight: 900; }
.level-button { min-height: 34px; padding: 0 9px; border-radius: 9px; }
.dashboard-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; }
.dashboard-footer small { color: var(--muted); }
.export-link { min-height: 38px; padding: 0 12px; }

@media (max-width: 800px) {
  .campaign-actions { grid-column: 1 / -1; }
  .dashboard-footer { align-items: flex-start; flex-direction: column; }
}

/* Use the wider admin canvas for stable campaign columns. */
.admin-main { width: min(1500px, 100%); }
.campaign { grid-template-columns: minmax(250px, 1.5fr) 90px 145px 90px 90px 70px auto; }

@media (max-width: 480px) {
  main { margin: 0 auto; padding-top: 20px; }
  .tool-grid { grid-template-columns: repeat(4, 1fr); gap: 7px; }
  .tool-grid.has-reveal { grid-template-columns: repeat(3, 1fr); }
  .tool { min-height: 62px; display: grid; grid-template-rows: 32px auto; gap: 3px; align-content: center; font-size: .67rem; line-height: 1; }
  .tool > span:last-child { display: block; }
  .tool small { display: none; }
}
