// Rôle : regroupe les styles de cards, panels et variantes compactes.
@use "mixins";

.section-grid,
.cards,
.info-grid,
.modules {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.section-grid,
.info-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cards {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.feature,
.info-panel,
.module,
.empty,
.card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: rgba(16, 20, 38, 0.88);
  box-shadow: var(--shadow-sm);
}

.card {
  border-color: transparent;
  border-radius: var(--radius-md);
  background:
    linear-gradient(rgba(16, 20, 38, 0.88), rgba(16, 20, 38, 0.88)) padding-box,
    radial-gradient(circle at 100% 0%, rgba(34, 211, 238, 0.42), transparent 28%) border-box,
    linear-gradient(135deg, rgba(246, 196, 83, 0.62) 0%, rgba(246, 196, 83, 0.42) 72%, rgba(34, 211, 238, 0.24) 100%) border-box;
}

@supports (corner-shape: scoop) {
  .card {
    corner-shape: scoop;
  }
}

.feature,
.info-panel,
.empty {
  padding: var(--space-5);
}

.feature,
.card,
.info-panel {
  transition:
    transform var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard),
    background-color var(--duration-fast) var(--ease-standard);
}

.feature:hover,
.card:hover,
.info-panel:hover {
  transform: translateY(-2px);
  border-color: var(--color-border-hover);
  background: rgba(21, 26, 48, 0.96);
}

.card:hover {
  transform: none;
  border-color: transparent;
  background:
    linear-gradient(rgba(21, 26, 48, 0.96), rgba(21, 26, 48, 0.96)) padding-box,
    linear-gradient(135deg, rgba(139, 92, 246, 0.9), rgba(196, 181, 253, 0.72)) border-box;
  box-shadow:
    var(--shadow-sm),
    0 0 18px rgba(139, 92, 246, 0.22),
    0 0 34px rgba(196, 181, 253, 0.12);
}

.compact-data-card {
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background:
    linear-gradient(rgba(17, 20, 34, 0.93), rgba(17, 20, 34, 0.93)) padding-box,
    radial-gradient(circle at 100% 0%, rgba(34, 211, 238, 0.24), transparent 24%) border-box,
    linear-gradient(135deg, rgba(246, 196, 83, 0.34) 0%, rgba(246, 196, 83, 0.2) 54%, rgba(34, 211, 238, 0.22) 100%) border-box;
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard),
    background-color var(--duration-fast) var(--ease-standard);
}

@supports (corner-shape: scoop) {
  .compact-data-card {
    corner-shape: scoop;
  }
}

.compact-data-card:hover {
  transform: none;
  border-color: transparent;
  background:
    linear-gradient(rgba(20, 23, 39, 0.96), rgba(20, 23, 39, 0.96)) padding-box,
    linear-gradient(135deg, rgba(139, 92, 246, 0.62), rgba(196, 181, 253, 0.42)) border-box;
  box-shadow:
    var(--shadow-sm),
    0 0 14px rgba(139, 92, 246, 0.12),
    0 0 22px rgba(196, 181, 253, 0.07);
}

.feature {
  display: grid;
  gap: 8px;
}

.feature strong {
  color: var(--color-text-primary);
}

.page-heading,
.toolbox-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-5);
}

.card {
  overflow: hidden;
}

.card-cover {
  min-height: 124px;
  border-bottom: 1px solid rgba(246, 196, 83, 0.42);
}

.card-body {
  padding: var(--space-5);
}

.card-actions {
  margin-top: var(--space-5);
}

.toolbox-card {
  --reorder-drop-shadow: var(--shadow-sm);

  position: relative;
  display: flex;
  min-height: 292px;
  flex-direction: column;
}

.toolbox-card .card-cover {
  flex: 0 0 124px;
  height: 124px;
  min-height: 124px;
}

.toolbox-card-cover-link,
.game-card-cover-link {
  display: block;
  outline-offset: -3px;
}

.toolbox-card-cover-link:hover img,
.toolbox-card-cover-link:focus-visible img,
.game-card-cover-link:hover img,
.game-card-cover-link:focus-visible img {
  transform: scale(1.035);
  filter: brightness(1.08);
}

.toolbox-card-cover-link img,
.game-card-cover-link img {
  transition:
    transform var(--duration-normal) var(--ease-standard),
    filter var(--duration-normal) var(--ease-standard);
}

.toolbox-card .card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.toolbox-card .card-actions {
  margin-top: auto;
  padding-top: var(--space-5);
}

.toolbox-card-drag-handle {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border-color: rgba(165, 180, 252, 0.12);
  background: rgba(7, 10, 24, 0.42);
  color: var(--color-text-muted);
  cursor: grab;
  opacity: 0.72;
  touch-action: none;
  user-select: none;
}

.toolbox-card-drag-handle .ui-icon {
  width: 18px;
  height: 18px;
}

.toolbox-card:hover .toolbox-card-drag-handle,
.toolbox-card:focus-within .toolbox-card-drag-handle {
  opacity: 1;
}

.toolbox-card-drag-handle:active {
  cursor: grabbing;
}

.toolbox-page {
  display: flex;
  min-height: calc(100vh - 68px - var(--space-8) - var(--space-12));
  flex: 1;
  flex-direction: column;
  gap: var(--space-4);
}

.toolbox-embedded {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.storage-help-card {
  position: relative;
  min-height: 292px;
  overflow: hidden;
  border-color: rgba(246, 196, 83, 0.22);
  background:
    linear-gradient(135deg, rgba(246, 196, 83, 0.1), transparent 38%),
    rgba(10, 13, 29, 0.84);
}

.storage-help-card::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--gradient-brand);
}

.storage-help-card .card-body {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  padding: 18px;
}

.storage-help-heading {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.storage-help-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(246, 196, 83, 0.32);
  border-radius: var(--radius-md);
  background: rgba(246, 196, 83, 0.1);
  color: var(--color-accent-gold);
  box-shadow: 0 0 22px rgba(246, 196, 83, 0.12);
}

.storage-help-mark::before {
  content: "";
  width: 19px;
  height: 19px;
  background: currentColor;
  mask: url("/static/icons/save.svg") center / contain no-repeat;
  -webkit-mask: url("/static/icons/save.svg") center / contain no-repeat;
}

.storage-help-card h2 {
  margin: 0;
  font-size: var(--font-size-lg);
  line-height: 1.2;
}

.storage-help-card .eyebrow {
  color: var(--color-accent-gold);
}

.storage-help-intro {
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  line-height: 1.45;
}

.storage-help-card p,
.storage-help-card ul {
  margin: 0;
}

.storage-help-list {
  display: grid;
  gap: 7px;
  margin-top: 18px;
  padding: 10px 0 0;
  list-style: none;
}

.storage-help-list li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px 9px;
  border: 1px solid rgba(150, 165, 205, 0.12);
  border-radius: var(--radius-md);
  background: rgba(7, 10, 24, 0.45);
}

.storage-help-list span {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: var(--radius-sm);
  background: rgba(139, 92, 246, 0.18);
  color: var(--color-text-primary);
  font-size: var(--font-size-xs);
  font-weight: 800;
}

.storage-help-list p {
  align-self: center;
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  line-height: 1.32;
}

.storage-quota {
  position: relative;
  isolation: isolate;
  display: grid;
  gap: var(--space-3);
  margin-top: auto;
  padding: var(--space-4);
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  background: rgba(16, 20, 38, 0.58);
  box-shadow: var(--shadow-sm);
}

.storage-quota::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 92% 12%, rgba(246, 196, 83, 0.009), transparent 34%),
    radial-gradient(circle at 0% 100%, rgba(139, 92, 246, 0.011), transparent 42%);
  pointer-events: none;
}

.storage-quota::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  padding: 1px;
  border-radius: inherit;
  background:
    radial-gradient(circle at 100% 0%, rgba(246, 196, 83, 0.42), transparent 34%),
    linear-gradient(135deg, rgba(246, 196, 83, 0.42), rgba(139, 92, 246, 0.32) 54%, rgba(196, 181, 253, 0.24));
  @include mixins.border-mask;
  pointer-events: none;
}

.storage-quota > * {
  position: relative;
  z-index: 1;
}

.toolbox-page > .storage-quota,
.drawer-content > .storage-quota {
  margin-top: auto;
}

.storage-quota > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.storage-quota strong {
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
}

.storage-quota-track {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border: 1px solid rgba(150, 165, 205, 0.14);
  border-radius: var(--radius-pill);
  background: rgba(5, 7, 17, 0.82);
}

.storage-quota-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--gradient-brand);
  box-shadow: 0 0 18px rgba(99, 102, 241, 0.32);
  transition: width var(--duration-normal) var(--ease-standard);
}

.storage-quota-warning {
  border-color: rgba(251, 191, 36, 0.34);
}

.storage-quota-warning .storage-quota-track span {
  background: linear-gradient(135deg, #fbbf24, #f97316);
}

.storage-quota-danger {
  border-color: rgba(251, 113, 133, 0.42);
}

.storage-quota-danger .storage-quota-track span {
  background: linear-gradient(135deg, #fb7185, #d946ef);
}

.card-icon-button {
  flex: 0 0 40px;
}
