:root {
  --bg: #111111;
  --panel: #f7f7f5;
  --ink: #171717;
  --muted: #656565;
  --purple: #3b1872;
  --gold: #c5a046;
  --line: #d9d7d2;
  --danger: #d71920;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

.login-app {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.login-panel {
  width: min(520px, 100%);
  padding: 24px;
  border: 1px solid #2a2a2a;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}

.login-brand {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 22px;
}

.login-brand img {
  width: 82px;
  height: 82px;
  border-radius: 12px;
  background: var(--purple);
  object-fit: contain;
}

.login-brand h1 {
  margin: 0;
  color: #111;
  font-size: 28px;
  line-height: 1;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form button {
  width: 100%;
  margin-left: 0;
}

.login-status {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.app {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 36px 0;
}

.home-app {
  width: min(1180px, calc(100vw - 32px));
  padding: 28px 0 42px;
}

.home-hero {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) auto;
  gap: 26px;
  align-items: center;
  margin-bottom: 16px;
  padding: 24px;
  border: 1px solid #242424;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(59, 24, 114, 0.96), rgba(8, 8, 10, 0.98)),
    #050505;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.home-mark {
  display: grid;
  place-items: center;
  width: 118px;
  height: 118px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

.home-mark img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  transition: transform 140ms ease;
}

.home-mark:hover img,
.home-mark:focus img {
  transform: scale(1.04);
}

.home-hero-copy h1 {
  margin: 0;
  color: #fff;
  font-size: 42px;
  line-height: 1;
}

.home-hero-copy p:not(.eyebrow) {
  max-width: 660px;
  margin: 12px 0 0;
  color: #e2deea;
  font-size: 15px;
  line-height: 1.45;
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.home-hero-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.home-hero-actions .primary-action {
  border-color: #d9d9d9;
  background: #fff;
  color: #111;
}

.home-search {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid #262626;
  border-radius: 12px;
  background: #fff;
}

.home-search label {
  color: #171717;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.home-search input {
  height: 42px;
  border-color: #d8d8d8;
  border-radius: 8px;
  background: #f7f7f5;
}

.home-section {
  border-color: #252525;
  border-radius: 12px;
  background: #fff;
}

.home-section .section-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  padding: 18px 20px;
  background: #fff;
}

.home-section .section-header h2 {
  margin: 0;
  color: #171717;
  font-size: 20px;
}

.home-section .section-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.home-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.home-grid.four-up {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.home-grid .resource-card {
  min-height: 92px;
  border-radius: 10px;
  background: #fbfbfa;
}

.home-grid .featured-card {
  border-color: #171717;
  background: #111;
}

.home-grid .featured-card strong,
.home-grid .featured-card small {
  color: #fff;
}

.portal {
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid #2c2c2c;
  border-radius: 8px;
  background: #050505;
}

.portal-top {
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: 250px;
}

.portal-compact .portal-top {
  grid-template-columns: 220px 1fr;
  min-height: 150px;
}

.portal-compact .brand-block {
  min-height: 150px;
}

.portal-compact .brand-block img {
  width: 188px;
}

.portal-compact .portal-copy {
  padding: 24px 32px;
}

.portal-compact .portal-copy h1 {
  font-size: 38px;
}

.brand-block {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  background: var(--purple);
  border-right: 8px solid var(--gold);
}

.brand-block img {
  width: 300px;
  max-width: 86%;
  height: auto;
  display: block;
}

.brand-home {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.brand-home img {
  transition: transform 140ms ease;
}

.brand-home:hover img,
.brand-home:focus img {
  transform: scale(1.03);
}

.portal-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 36px 40px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-copy h1 {
  max-width: 720px;
  color: #fff;
  font-size: 54px;
  line-height: 1;
}

.portal-copy p:not(.eyebrow) {
  max-width: 700px;
  color: #d8d8d8;
  font-size: 16px;
  line-height: 1.45;
}

.portal-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  background: #241044;
  border-top: 3px solid #8c8c8c;
}

.portal-tabs a {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: var(--purple);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.portal-tabs a:hover,
.portal-tabs a:focus,
.portal-tabs a.active {
  background: var(--gold);
  color: #171717;
  outline: none;
}

.portal-rule {
  height: 4px;
  background: #8c8c8c;
}

.launch-panel {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid #2c2c2c;
  border-radius: 8px;
  background: #fff;
}

.launch-main {
  display: grid;
  gap: 8px;
}

.launch-main label {
  color: var(--purple);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.launch-main input {
  height: 46px;
  border-color: var(--line);
  font-weight: 700;
}

.launch-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.launch-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f7f5;
  color: var(--purple);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.launch-actions a:hover,
.launch-actions a:focus {
  border-color: var(--gold);
  outline: none;
}

.launch-actions .launch-primary {
  border-color: var(--purple);
  background: var(--purple);
  color: #fff;
}

.portal-empty {
  margin-bottom: 18px;
}

.link-section {
  margin-bottom: 18px;
  border: 1px solid #2c2c2c;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.primary-links {
  background: var(--purple);
}

.section-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.primary-links .section-header {
  border-bottom-color: rgba(255, 255, 255, 0.18);
  background: var(--purple);
}

.section-header h2 {
  color: var(--purple);
}

.primary-links .section-header h2 {
  color: #fff;
}

.section-header p {
  max-width: 680px;
}

.primary-links .section-header p {
  color: #e7ddf2;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

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

.resource-grid.social-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.resource-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 84px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f7f5;
  color: var(--ink);
  text-decoration: none;
}

.primary-links .resource-card {
  border-color: rgba(255, 255, 255, 0.22);
  background: #fff;
}

.resource-card img {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 6px;
}

.resource-card span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.resource-card strong {
  color: var(--purple);
  font-size: 16px;
  line-height: 1.1;
}

.resource-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.resource-card:hover,
.resource-card:focus {
  border-color: var(--gold);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  outline: none;
  transform: translateY(-1px);
}

.quick-links {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.quick-links a {
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #2c2c2c;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}

.quick-links strong {
  color: var(--purple);
}

.quick-links span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.social-feed .header {
  background: #fff;
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  background: #fff;
}

.social-card {
  display: grid;
  gap: 6px;
  min-height: 96px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f7f5;
  color: var(--ink);
  text-decoration: none;
}

.social-card strong {
  color: var(--purple);
  font-size: 18px;
}

.social-card span {
  color: var(--muted);
  font-size: 13px;
}

.social-card:hover,
.social-card:focus {
  border-color: var(--gold);
  outline: none;
}

.panel {
  background: var(--panel);
  border: 1px solid #2c2c2c;
  border-radius: 8px;
  overflow: hidden;
}

.header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 24px 28px;
  border-bottom: 1px solid var(--line);
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
  color: var(--purple);
}

h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
  color: var(--purple);
}

p {
  margin: 7px 0 0;
  color: var(--muted);
}

.status {
  min-width: 120px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

form {
  padding: 24px 28px 28px;
}

.instruction-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  padding: 0 28px 22px;
  background: linear-gradient(#fff, #fff) padding-box;
}

.instruction-strip span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: #333;
  font-size: 12px;
  font-weight: 800;
}

.instruction-strip b,
.step-title > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  font-size: 12px;
  flex: 0 0 auto;
}

.step-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.step-card + .step-card,
.advanced + .advanced,
.step-card + .advanced,
.advanced + .step-card {
  margin-top: 14px;
}

.step-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.step-title h3 {
  margin: 0;
  color: var(--purple);
  font-size: 16px;
}

.step-title p {
  margin-top: 4px;
  font-size: 13px;
}

.grid,
.uploads {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.uploads {
  margin-top: 18px;
}

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

.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0;
}

.output-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.output-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f7f5;
}

.output-option input {
  width: 18px;
  height: 18px;
}

.advanced {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.advanced summary {
  cursor: pointer;
  padding: 15px 18px;
  color: var(--purple);
  font-weight: 800;
}

.advanced > .uploads,
.advanced > .wide,
.advanced > .acronyms {
  margin: 0;
  padding: 0 18px 18px;
}

label {
  display: grid;
  gap: 7px;
  color: #333;
  font-size: 13px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #c8c5bd;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 400;
}

input,
select {
  height: 40px;
  padding: 0 11px;
}

input[type="file"] {
  padding: 8px;
}

textarea {
  min-height: 90px;
  padding: 10px 11px;
  resize: vertical;
}

.wide {
  margin-top: 18px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 20px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check input {
  width: 18px;
  height: 18px;
}

button {
  margin-left: auto;
  height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  background: var(--purple);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.generate-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.generate-card .step-title {
  margin: 0;
}

.generate-card button {
  margin-left: 0;
}

button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.results {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.success-panel {
  margin-top: 16px;
  padding: 22px;
  border: 1px solid #d6e8d6;
  border-radius: 8px;
  background: #f4fbf4;
}

.success-panel h2 {
  color: #236b2e;
}

.player-lookup-panel {
  margin-top: 16px;
}

.lookup-body {
  padding: 18px;
  background: #fff;
}

.lookup-controls {
  display: grid;
  grid-template-columns: 220px minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.voice-button {
  min-width: 92px;
  margin-left: 0;
}

.voice-button.listening {
  background: var(--danger);
}

.lookup-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.lookup-suggestions button {
  margin-left: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f7f5;
  color: var(--purple);
  font-size: 12px;
}

.player-card,
.player-card-empty {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f7f5;
}

.player-card-empty {
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.player-card-top {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.player-card-photo {
  width: 96px;
  height: 118px;
  flex: 0 0 auto;
  border: 2px solid #111;
  border-radius: 6px;
  background: #e9e9e9;
  object-fit: cover;
}

.player-card-photo.placeholder {
  display: grid;
  place-items: center;
  color: var(--purple);
  font-size: 24px;
  font-weight: 800;
}

.player-card-main {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  min-width: 0;
  flex: 1;
}

.player-card-top h3 {
  margin: 0;
  color: var(--purple);
  font-size: 24px;
}

.player-label {
  min-width: 110px;
  padding: 8px 10px;
  border: 1px solid #e1cf00;
  border-radius: 6px;
  background: #ffff00;
  color: #ff0000;
  text-align: center;
  font-size: 16px;
}

.voice-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.player-stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  padding: 1px;
  background: var(--line);
}

.player-stat-grid div {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 10px;
  background: #fff;
  text-align: center;
}

.player-stat-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.player-stat-grid strong {
  color: var(--ink);
  font-size: 15px;
}

.player-role-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 18px 18px;
}

.player-role-row span {
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--purple);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.acronyms {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.acronyms h2 {
  margin: 0 0 12px;
  color: var(--purple);
  font-size: 16px;
}

.acronyms dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 14px;
  margin: 0;
}

.acronyms div {
  min-height: 54px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.acronyms dt {
  color: var(--purple);
  font-weight: 800;
}

.acronyms dd {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.download {
  display: grid;
  gap: 4px;
  padding: 18px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e2e2e2;
  color: var(--purple);
  text-decoration: none;
}

.download span {
  color: var(--muted);
  font-size: 13px;
}

.download.muted {
  color: #333;
}

.recent-panel {
  margin-top: 16px;
}

.recent-list {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.recent-item {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.recent-item strong {
  color: var(--purple);
}

.recent-item span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.recent-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.recent-links a {
  padding: 7px 9px;
  border-radius: 6px;
  background: var(--purple);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.empty-state {
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
}

@media (max-width: 820px) {
  .home-hero {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .home-hero-actions {
    justify-content: flex-start;
  }

  .home-search {
    grid-template-columns: 1fr;
  }

  .home-section .section-header {
    display: block;
  }

  .home-grid,
  .home-grid.four-up {
    grid-template-columns: 1fr;
  }

  .portal-top {
    grid-template-columns: 1fr;
  }

  .brand-block {
    border-right: 0;
    border-bottom: 6px solid var(--gold);
  }

  .portal-copy {
    padding: 28px 22px;
  }

  .portal-copy h1 {
    font-size: 38px;
  }

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

  .quick-links,
  .instruction-strip,
  .output-grid,
  .two-up,
  .resource-grid,
  .resource-grid.social-grid,
  .compact-grid,
  .social-grid {
    grid-template-columns: 1fr;
  }

  .launch-panel {
    grid-template-columns: 1fr;
  }

  .launch-actions {
    justify-content: flex-start;
  }

  .lookup-controls,
  .player-stat-grid {
    grid-template-columns: 1fr;
  }

  .player-card-top {
    flex-direction: column;
  }

  .player-card-main {
    width: 100%;
    flex-direction: column;
  }

  .generate-card,
  .recent-item {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .header,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .grid,
  .uploads,
  .results,
  .acronyms dl {
    grid-template-columns: 1fr;
  }

  button {
    margin-left: 0;
  }
}
