:root {
  --dcci-purple: #8e44ad;
  --dcci-purple-deep: #6c3483;
  --dcci-pink: #e91e63;
  --dcci-indigo: #3f51b5;
  --dcci-green: #27ae60;
  --dcci-dark: #1c2833;
  --dcci-navy: #2c3e50;
  --dcci-light: #ecf0f1;
  --dcci-white-hi: #ffffff;
  --dcci-white-mid: rgba(255, 255, 255, 0.82);
  --dcci-border: rgba(255, 255, 255, 0.22);
  --dcci-header-font: Inter, Aptos, "Segoe UI", Arial, sans-serif;
  --panel: rgba(236, 240, 241, 0.95);
  --focus: #e91e63;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: auto;
  min-height: 0;
  overflow: visible;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background-image: url("https://dcciportal.co.uk/wp-content/uploads/2026/02/Picture1.png");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: scroll;
  color: var(--dcci-dark);
  font-family: Inter, Aptos, "Segoe UI", Arial, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 8% 12%, rgba(255, 255, 255, 0.16), transparent 30%),
    radial-gradient(circle at 94% 10%, rgba(255, 255, 255, 0.12), transparent 26%);
}

button {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px) 0 34px;
}

.app-header {
  text-align: center;
  margin: 0 auto clamp(18px, 3vw, 28px);
  max-width: 820px;
}

.dcci-logo {
  display: block;
  width: min(190px, 48vw);
  height: auto;
  margin: 0 auto 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--dcci-purple-deep);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--dcci-purple-deep);
  font-size: clamp(2rem, 4.4vw, 4.2rem);
  line-height: 1;
  letter-spacing: 0;
}

.header-copy {
  max-width: 640px;
  margin: 16px auto 0;
  color: #34495e;
  font-size: clamp(1rem, 1.5vw, 1.12rem);
  line-height: 1.58;
}

.activity-panel {
  position: relative;
  overflow: hidden;
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 28px);
  background: var(--panel);
  border-radius: 22px;
  box-shadow: 0 18px 42px rgba(28, 40, 51, 0.13);
}

.activity-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  border-radius: 22px 0 0 22px;
  background: linear-gradient(180deg, #8e44ad 0%, #e91e63 30%, #3f51b5 62%, #27ae60 100%);
}

.status-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr)) minmax(130px, auto);
  gap: 12px;
  align-items: stretch;
  margin-bottom: 14px;
  padding-left: 6px;
}

.status-chip {
  display: grid;
  gap: 2px;
  min-height: 58px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 0 0 1px rgba(52, 73, 94, 0.13);
}

.status-label {
  color: #5d6d7e;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-chip strong {
  color: #17202a;
  font-size: 1.18rem;
  line-height: 1.1;
}

.control-btn {
  min-height: 58px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--dcci-purple), var(--dcci-pink));
  font-weight: 850;
  box-shadow: 0 12px 24px rgba(142, 68, 173, 0.2);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.control-btn:hover {
  transform: translateY(-1px);
}

.live-status {
  margin: 0 0 16px 6px;
  color: var(--dcci-purple-deep);
  font-weight: 800;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(8px, 1.4vw, 14px);
}

.memory-card {
  position: relative;
  min-width: 0;
  aspect-ratio: 353 / 395;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: transparent;
  cursor: pointer;
  perspective: 1000px;
}

.memory-card:focus-visible,
.control-btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.card-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 420ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.memory-card.is-flipped .card-inner,
.memory-card.is-matched .card-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  display: flex;
  overflow: hidden;
  border-radius: 16px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 10px 22px rgba(28, 40, 51, 0.16);
}

.card-front {
  align-items: center;
  justify-content: center;
  padding: 0;
  background: linear-gradient(135deg, #f5eff9 0%, #eadff4 48%, #f7f4fa 100%);
}

.card-front::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 2;
  height: 5px;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(90deg, #8e44ad 0%, #e91e63 34%, #3f51b5 68%, #27ae60 100%);
}

.card-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transform: scale(1.18);
}

.card-back {
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: clamp(10px, 1.6vw, 18px);
  background: rgba(255, 255, 255, 0.95);
  color: #17202a;
  transform: rotateY(180deg);
  box-shadow: inset 0 0 0 3px rgba(142, 68, 173, 0.18);
}

.memory-card.is-matched .card-back {
  background: linear-gradient(135deg, rgba(39, 174, 96, 0.17), rgba(255, 255, 255, 0.95));
  box-shadow: inset 0 0 0 3px rgba(39, 174, 96, 0.38);
}

.card-type {
  color: var(--dcci-purple-deep);
  font-size: clamp(0.62rem, 0.9vw, 0.72rem);
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-text {
  color: #17202a;
  font-size: clamp(0.82rem, 1.15vw, 1rem);
  font-weight: 760;
  line-height: 1.22;
  letter-spacing: 0;
}

.card-text.definition {
  font-size: clamp(0.74rem, 1vw, 0.9rem);
  font-weight: 650;
  line-height: 1.3;
}

.completion-note {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(39, 174, 96, 0.13);
  color: #145a32;
  font-size: 0.98rem;
  line-height: 1.5;
  box-shadow: inset 0 0 0 1px rgba(39, 174, 96, 0.24);
}

.completion-note strong {
  display: block;
  color: #0b4223;
}

.dcci-a11y-trigger--float {
  right: 18px;
  bottom: 18px;
  top: auto;
  border-color: rgba(255, 255, 255, 0.2);
  background: #1e1136;
  color: #fff;
}

.dcci-a11y-trigger--float .dcci-a11y-trigger__label {
  display: none;
}

.dcci-a11y-panel {
  top: auto;
  right: 18px;
  bottom: 72px;
}

.dcci-a11y-panel,
.dcci-a11y-panel * {
  color: #fff;
}

.dcci-a11y-panel input:checked + .dcci-a11y-seg-btn {
  color: #1c2833;
}

html.accessibility-reduce-motion * {
  transition: none !important;
  animation: none !important;
}

html.accessibility-high-contrast body,
html.accessibility-contrast-light body,
html.accessibility-contrast-dyslexia body,
html.accessibility-contrast-yellow body {
  background-image: none;
}

html.accessibility-simplified .header-copy {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .card-inner,
  .control-btn {
    transition: none;
  }
}

@media (max-width: 920px) {
  .memory-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 560px);
    padding-top: 18px;
  }

  .status-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .control-btn {
    grid-column: 1 / -1;
  }

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

@media (max-width: 430px) {
  .memory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
