/* ======= GLOBAL LAYOUT / THEME ======= */

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  background: #0d0d0f;
  color: #ffffff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  min-height: 100vh;
}

.wrapper {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px 80px;
  text-align: center;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  background: #000;
  border-bottom: 1px solid rgba(255,122,24,.4);
  padding: 12px 16px;
}

.top-nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  margin-right: 12px;
}

.top-nav .brand,
.top-nav .brand:link,
.top-nav .brand:visited {
  font-size: 15px;
  font-weight: 700;
  color: #ff7a18;
  text-decoration: none;
}

h1,h2,h3,h4 {
  color: #fff;
  margin: 16px 0 8px;
  font-weight: 600;
  line-height: 1.2;
  word-break: break-word;
}

p {
  color: #aaa;
  line-height: 1.5;
  font-size: 14px;
  margin: 8px 0 16px;
  word-break: break-word;
}

footer {
  text-align: center;
  font-size: 11px;
  color: #555;
  padding: 40px 16px;
}

/* ======= SCENARIO LIST / BUTTONS ======= */

.scenario-list {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.scenario-card {
  background: #1a1a1a;
  border: 1px solid rgba(255,122,24,.3);
  border-radius: 14px;
  padding: 16px;
  text-align: left;
  box-shadow: 0 20px 40px rgba(0,0,0,.6);
}

.scenario-card h2 {
  font-size: 16px;
  color: #fff;
  margin: 0 0 6px;
  font-weight: 600;
  line-height: 1.3;
}

.scenario-meta {
  font-size: 12px;
  color: #888;
  margin-bottom: 12px;
  line-height: 1.4;
  word-break: break-word;
}

.card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-primary,
.btn-secondary,
.btn-small {
  appearance: none;
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.2;
  display: inline-block;
  text-align: center;
  min-width: 140px;
}

.btn-primary {
  background: #ff7a18;
  color: #000;
  box-shadow: 0 10px 20px rgba(255,122,24,.5);
  text-decoration: none;
}

.btn-secondary {
  background: #222;
  color: #fff;
  border: 1px solid #444;
  text-decoration: none;
}

.btn-small {
  padding: 6px 10px;
  min-width: 0;
  font-size: 12px;
  line-height: 1.2;
  border-radius: 8px;
  background: #222;
  color: #fff;
  border: 1px solid #444;
}

/* full-width helper for touch UI */
.w-100 {
  width: 100%;
  text-align: center;
}

/* ======= TABLE WRAP ======= */

.table-wrap {
  overflow-x: auto;
  margin: 16px 0;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 300px;
}

th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #333;
  color: #ccc;
  vertical-align: top;
}

th {
  color: #fff;
  font-weight: 600;
  background: #111;
  border-bottom: 1px solid rgba(255,122,24,.3);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
  line-height: 1.4;
}

/* ======= ASSIGN SCREEN ======= */

.status-text {
  font-size: 13px;
  color: #bbb;
  margin-top: 4px;
  line-height: 1.4;
}

.deal-card-outer {
  display: flex;
  justify-content: center;
  margin: 20px auto 12px;
  width: 100%;
}

.deal-card-wrapper {
  position: relative;
  width: 300px;
  max-width: 90vw;
  min-height: 420px;
  border-radius: 16px;
  background: radial-gradient(
    circle at 10% 10%,
    rgba(255,122,24,.15) 0%,
    rgba(0,0,0,.2) 60%,
    rgba(0,0,0,1) 100%
  );
  border: 1px solid rgba(255,122,24,.4);
  box-shadow: 0 30px 60px rgba(0,0,0,.8);
  overflow: hidden;

  /* kill any leftover flip styles from cache */
  transform: none !important;
  -webkit-transform: none !important;
  perspective: none !important;
  -webkit-perspective: none !important;
}

.deal-stage {
  position: absolute;
  inset: 0;
  padding: 20px;
  border-radius: 16px;

  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;

  transform: none !important;
  -webkit-transform: none !important;
  backface-visibility: visible !important;
  -webkit-backface-visibility: visible !important;
}

/* BEFORE reveal */
#stageLocked {
  background: radial-gradient(
    circle at 30% 30%,
    rgba(255,122,24,.4) 0%,
    rgba(0,0,0,.2) 60%,
    rgba(0,0,0,1) 100%
  );
  color: #fff;
}

#stageLocked h2 {
  font-size: 20px;
  font-weight: 700;
  color: #ff7a18;
  margin: 0 0 8px;
  line-height: 1.2;
  word-break: break-word;
  text-align: center;
}

#stageLocked p {
  color: #bbb;
  font-size: 13px;
  margin: 0;
  line-height: 1.4;
  word-break: break-word;
  text-align: center;
  max-width: 90%;
}

/* AFTER reveal */
#stageRole {
  background: #111;
  color: #fff;
}

#stageRole img {
  max-width: 80%;
  max-height: 40%;
  object-fit: contain;
  border-radius: 12px;
  border: 2px solid rgba(255,122,24,.5);
  box-shadow: 0 20px 40px rgba(0,0,0,.8);
  margin-bottom: 12px;
  background: #000;
}

#stageRole h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px;
  color: #ff7a18;
  line-height: 1.3;
  text-align: center;
  word-break: break-word;
}

#stageRole p {
  font-size: 14px;
  line-height: 1.4;
  color: #ddd;
  margin: 0;
  white-space: pre-line;
  word-break: break-word;
  max-height: 120px;
  overflow-y: auto;
  width: 100%;
  text-align: center;
  padding: 0 8px;
}

.countdown {
  font-size: 32px;
  font-weight: 700;
  color: #ff7a18;
  margin-top: 12px;
  line-height: 1;
  text-align: center;
}

/* overlay after time / skip */
.deal-overlay {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: rgba(0,0,0,.9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  transform: none !important;
  -webkit-transform: none !important;
  backface-visibility: visible !important;
  -webkit-backface-visibility: visible !important;
}

.deal-overlay-inner {
  font-size: 15px;
  line-height: 1.4;
  font-weight: 600;
  max-width: 220px;
  word-break: break-word;
  text-align: center;
}

.controls {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin: 20px 0;
  width: 100%;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.done {
  background: #1a1a1a;
  border: 1px solid rgba(255,122,24,.3);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0,0,0,.6);
  max-width: 360px;
  margin: 24px auto 0;
}

.hidden {
  display: none !important;
}

/* ======= RESPONSIVE BREAKPOINTS ======= */

/* Phones / narrow screens */
@media (max-width: 480px) {

  .wrapper {
    padding: 16px 12px 64px;
  }

  .top-nav {
    padding: 10px 12px;
  }

  .top-nav a {
    font-size: 13px;
    margin-right: 8px;
  }

  .top-nav .brand {
    font-size: 14px;
  }

  h1 {
    font-size: 22px;
    margin-top: 12px;
    margin-bottom: 8px;
  }

  .status-text {
    font-size: 12px;
  }

  .deal-card-wrapper {
    width: 100%;
    max-width: 360px;
    min-height: 360px;
    border-radius: 14px;
  }

  #stageLocked h2 {
    font-size: 18px;
  }
  #stageLocked p {
    font-size: 12px;
  }

  #stageRole h2 {
    font-size: 16px;
  }
  #stageRole p {
    font-size: 13px;
    line-height: 1.45;
    max-height: 140px;
  }

  .countdown {
    font-size: 28px;
  }

  .controls {
    gap: 8px;
    margin-top: 16px;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    min-width: 0;
    font-size: 15px;
    padding: 14px 16px;
    border-radius: 12px;
  }

  .btn-small {
    font-size: 12px;
    padding: 8px 10px;
  }

  table {
    font-size: 12px;
  }

  th {
    font-size: 11px;
  }
}

/* Very wide screens (desktop monitor) */
@media (min-width: 768px) {
  .wrapper {
    max-width: 520px;
  }
  .deal-card-wrapper {
    width: 320px;
    min-height: 440px;
  }
}
