:root {
  --gold:      #c9a84c;
  --gold-dim:  #7a5e24;
  --easy-col:  #4ade80;
  --medium-col:   #facc15;
  --hard-col:  #f87171;
  --elite-col:  #fb00ff;
  --contract-col:  #007bff;
  --bg:        #0b0b0e;
  --surface:   #111117;
  --surface2:  #18181f;
  --border:    rgba(201,168,76,0.2);
}

* { box-sizing: border-box; margin:0; padding:0; }

html {
    scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: #e8dfc8;
  font-family: 'Black Ops One', Georgia, serif;
  min-height: 100vh;
}

/* ── Header ── */
header {
    display: grid;
    align-items: center;
    padding: 20px;
}

header h1 {
    justify-self: center;
    font-family: 'Black Ops One', serif;
    font-size: clamp(3.2rem, 4vw, 3rem);
    color: #d94d4d;
    letter-spacing: 0.06em;
    text-shadow: 0 0 20px rgb(165 9 9 / 75%);
    text-align: center;
}
header p { font-size: 0.85rem; color: #7a6a4a; letter-spacing: 0.15em; text-transform: uppercase; margin-top: 0.25rem; }

.page-nav {
    position: fixed;
    top: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    text-align: right;
    padding: 30px 40px 30px 30px;
    background: var(--bg);
    z-index: 100;
}

@media (max-width: 1000px) {
    .page-nav {
        display: none;
    }
}


.page-nav span {
    text-decoration: underline;
  }

.page-nav a {
    text-decoration: none;
    text-transform: uppercase;
    font-size: 15px;
    letter-spacing: 0.08em;
    transition: color 0.2s;
    margin: 12px 0 0 0;
}

.page-nav a:hover {
    color: #fff;
}

/* ── Layout ── */
.outer { max-width: 1700px; margin: 0 auto; padding: 0 1rem 3rem; }

#container {
  display: none;
    width: 100%;
    max-width: 1300px;
    justify-self: center;
}
#container.visible {
    display: flex;
    flex-direction: column;
}

.boards-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 100px;
  padding-top: 15px;
}
@media (max-width: 1200px) {
  .boards-wrap {
    grid-template-columns: 1fr;
  }
}
#codeInput {
    text-transform: uppercase;
}

/* ── Redeem panel ── */
.redeem-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  max-width: 600px;
  justify-self: center;
  width: 100%;
    gap: 0 20px;
    align-items: center;
}
.redeem-panel input {
  flex: 1 1 220px;
  background: #0d0d12;
  border: 1px solid var(--gold-dim);
  color: #e8dfc8;
  padding: 0.55rem 0.85rem;
  font-family: 'Black Ops One', serif;
  font-size: 1rem;
  border-radius: 5px;
  outline: none;
  transition: border-color 0.2s;
}
.redeem-panel input:focus { border-color: var(--gold); }
.btn-redeem {
  background: linear-gradient(135deg, #8b1a1a, #c0392b);
  border: 1px solid #e05555;
  color: #fff;
  font-family: 'Black Ops One', serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.55rem 1.4rem;
  border-radius: 5px;
  cursor: pointer;
  transition: filter 0.2s;
}
.btn-redeem:hover { filter: brightness(1.15); }

/* Redeem Result */
#redeem-result {
  width: 100%;
  text-align: center;
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s ease-in-out;
}
#redeem-result.open {
  grid-template-rows: 1fr;
}
#redeem-result-inner {
  width: 100%;
  text-align: center;
  overflow: hidden;
}

#modifierPanel .modifier-name { font-family:'Black Ops One',serif; color: var(--easy-col); font-size:1rem; text-transform:uppercase}
#modifierPanel .modifier-hint { font-size:16px; color:#fff; margin-top:12px }

.btn-confirm {
    margin-top: 16px;
    background: #00cb4a;
    border: 1px solid #00cb4a;
    color: #ffffff;
    font-family: 'Black Ops One', serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.5rem 1.2rem;
    border-radius: 4px;
    cursor: pointer;
    transition: filter 0.2s;
}
.btn-confirm:hover { filter: brightness(1.15); }

#result { font-size: 0.82rem; color: #7a8a6a; 
    font-size: 18px;
    /* font-style: italic; */
    text-transform: uppercase;
    text-align: center;
    /* align-self: center; */
    margin-bottom: 10px;
    margin-top: 10px;
    color: #00ff5d;
    width: 100%; }

/* ── Team label ── */
.team-label {
  font-family: 'Black Ops One', serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 0.6rem;
  padding-left: 2px;
  text-align: center;
    border-bottom: 3px solid #c9a84c;
    padding-bottom: 15px;
}

/* ── Board grid ── */
.board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }

/* ── TILE ── */
.tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  cursor: default;
  transition: transform 0.15s, box-shadow 0.15s;
  border: 2px solid rgba(255,255,255,0.08);
  text-align: center;
}
/* Background image layer */
.tile-bg {
  position: absolute; inset: 0;
  background-position: center;
  transition: opacity 0.2s;
  background-size: contain;
  background-repeat: no-repeat;
    inset: 13% 13% 36% 13%;
}

/* Dark scrim so text is always readable */
.tile-scrim {
  position: absolute; inset: 0;
    background: rgb(0, 0, 0, 0.15);
}

/* Text content */
.tile-content {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  justify-content: flex-end;
  padding: 5px 6px;
}
.tile.complete .tile-content {
    background-color: rgb(0 128 0 / 44%);
}
.tile-boss {
  font-family: 'Black Ops One', serif;
  font-size: 15px;
  line-height: 1.1;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
  overflow: hidden;
  text-overflow: ellipsis;
    text-transform: uppercase;
}
.tile-drop {
  font-size: 13px;
  color: #c9b88a;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
    text-transform: uppercase;
}
.tile-status {
  flex: 1;
  font-family: 'Black Ops One', serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-top: 2px;
    text-transform: uppercase;
}

/* Tier accent border */
.tile.easy:not(.selectable)   { border-color: var(--easy-col); }
.tile.medium:not(.selectable)  { border-color: var(--medium-col); }
.tile.hard:not(.selectable)    { border-color: var(--hard-col); }
.tile.elite:not(.selectable)    { border-color: var(--elite-col); }

/* ── Modifier outlines ── */
.tile.defended  { border: none; box-shadow: inset 0 0 3px 3px #06b6d4, 0 0 3px 3px #06b6d4;  }
.tile.halved    { border: none; box-shadow: inset 0 0 3px 3px #f97316, 0 0 3px 3px #f97316;  }
.tile.doubled   { border: none; box-shadow: inset 0 0 3px 3px #a855f7, 0 0 3px 3px #a855f7;  }
.tile.disabled  { border: none; box-shadow: inset 0 0 3px 3px #6b7280, 0 0 3px 3px #6b7280; filter: grayscale(0.85); }
.tile.defended .tile-content  {background-color: rgb(6 182 212 / 20%);}
.tile.halved .tile-content    {background-color: rgb(249 115 22 / 20%);}
.tile.doubled .tile-content   {background-color: rgb(168 85 247 / 20%);}
.tile.modifierPending { box-shadow: 0 0 0 2px #facc15, 0 0 12px rgba(250,204,21,0.4); }

/* Selectable (target) glow */
.tile.selectable {
  cursor: pointer;
  box-shadow: 0 0 0 2px #fde047, 0 0 16px rgba(253,224,71,0.5);
  animation: pulse-select 1.4s ease-in-out infinite;
}
.tile.not-selectable {
  opacity: 0.3;
}
.tile.selectable:hover { cursor: pointer; transform: scale(1.04); z-index: 2; border-width: 3px}
.tile.selectable::after {
  content: "MODIFY";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  color: #fde047;
  font-family: 'Black Ops One', serif;
  font-size: 28px;
  text-shadow: 0 0 10px rgba(253,224,71,0.8);

  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
  z-index: 10;
}
.tile.selectable:hover::after {
  opacity: 1;
}

@keyframes pulse-select {
  0%,100% { box-shadow: 0 0 0 2px #fde047, 0 0 10px rgba(253,224,71,0.4); }
  50%     { box-shadow: 0 0 0 2px #fde047, 0 0 22px rgba(253,224,71,0.9); }
}
.tile.selectable-active {
  box-shadow: 0 0 0 3px #22c55e, 0 0 18px rgba(34,197,94,0.6) !important;
  animation: none;
}
.tile.selectable-active::after {
  content: "SELECTED";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  color: #22c55e;
  font-family: 'Black Ops One', serif;
  font-size: 28px;
  text-shadow: 0 0 10px rgba(253,224,71,0.8);

  opacity: 1;
  transition: opacity 0.15s;
  pointer-events: none;
  z-index: 10;
}

/* ── Complete overlay ── */
.tile-complete-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.52);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  inset: 0 0 25px 0;
  gap: 2px;
}
.tick-svg { width: 36%; opacity: 0.92; }
.complete-pts {
  font-family: 'Black Ops One', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--easy-col);
  text-shadow: 0 0 8px rgba(74,222,128,0.6);
}

/* Team point totals */
.team-pts {
  font-size: 16px;
  font-weight: 800;
  color: var(--easy-col);
  letter-spacing: 0.08em;
  margin-left: 0.6rem;
  text-shadow: 0 0 8px rgba(74,222,128,0.4);
}

/* Status colour helpers */
.status-disabled { color: #9ca3af; }
.status-halved   { color: #fb923c; }
.status-doubled  { color: #c084fc; }
.status-defended { color: #22d3ee; }

/* Legend */
.legend {
  display: flex; flex-wrap: wrap; gap: 0.6rem 1.2rem;
  margin-bottom: 1rem;
  font-size: 16px;
  font-weight: 500;
  font-family: 'Black Ops One', serif;
  letter-spacing: 0.06em;
  color: #fff;
  text-transform: uppercase;
    justify-content: center;
}
.legend span { display:flex; align-items:center; gap:5px; }
.legend i {
  display: inline-block; border-radius:2px;
  border: 2px solid;
    width: 13px;
    height: 13px;
}

/* Tile Heading */
.tile-heading {
  display: flex; flex-wrap: wrap; gap: 7px;
  
    flex-direction: column;
   grid-column: span 4;
  font-size: 16px;
  font-weight: 500;
  font-family: 'Black Ops One', serif;
  letter-spacing: 0.06em;
  color: #fff;
  text-transform: uppercase;
    padding: 20px 0 0 0;
    justify-content: center;
    text-align: center;
}
.tile-heading span { display:flex; align-items:center; gap:5px; }
.tile-heading .tile-type {
    display: flex;
    align-items: center;
    justify-content: center;
}
.tile-heading i {
  display: inline-block; border-radius:2px;
  border: 2px solid;
    width: 13px;
    height: 13px;
    margin-right: 7px;
}
.tile-heading.easy-heading i {
  border-color:#4ade80;background:#4ade80
}
.tile-heading.medium-heading i {
  border-color:#facc15;background:#facc15
}
.tile-heading.hard-heading i {
  border-color:#f87171;background:#f87171
}
.tile-heading.elite-heading i {
  border-color:#fb00ff;background:#fb00ff
}

/* TILE ANIMATION */
.tile.modifier-flash {
  animation: modifierFlash 0.7s ease-out;
  position: relative;
}

@keyframes modifierFlash {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.12); }
  60%  { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.tile.modifier-flash::before {
  content: "";
  position: absolute;
  inset: -20px;
  border-radius: inherit;
  pointer-events: none;
  z-index: 5;

  animation: modifierBurst 0.7s ease-out forwards;
}
.tile.modifier-flash.doubled::before {
  background: radial-gradient(
    circle,
    rgba(168,85,247,0.8) 0%,
    rgba(168,85,247,0.4) 40%,
    transparent 75%
  );
}

.tile.modifier-flash.halved::before {
  background: radial-gradient(
    circle,
    rgba(249,115,22,0.8) 0%,
    rgba(249,115,22,0.4) 40%,
    transparent 75%
  );
}

.tile.modifier-flash.defended::before {
  background: radial-gradient(
    circle,
    rgba(6,182,212,0.8) 0%,
    rgba(6,182,212,0.4) 40%,
    transparent 75%
  );
}

.tile.modifier-flash.disabled::before {
  background: radial-gradient(
    circle,
    rgba(107,114,128,0.8) 0%,
    rgba(107,114,128,0.4) 40%,
    transparent 75%
  );
}
@keyframes modifierBurst {
  0% {
    opacity: 1;
    transform: scale(0.2);
  }

  100% {
    opacity: 0;
    transform: scale(2.5);
  }
}


/* Contracts */
#contracts {
    display: flex;
    flex-direction: column;
    justify-self: center;
    padding: 30px 0 0 0;
    align-items: center;
    max-width: 1160px;
    align-self: center;
}

#contracts-title {
    font-size: 22px;
    font-weight: 500;
    font-family: 'Black Ops One', serif;
    letter-spacing: 0.06em;
    color: var(--contract-col);
    text-transform: uppercase;
    text-align: center;
    padding: 20px 0 0 0;
    text-shadow: 0 0 14px rgba(0,123,255,0.35);
}

#contracts-info {
    margin: 20px 0 15px 0;
    font-size: 18px;
    color: #fff;
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.5;
}

/* GRID */
#contracts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  align-items: stretch;
  grid-auto-rows: 1fr;
    width: 100%;
    max-width: 1070px;
}

@media (max-width: 1000px) {
    #contracts-grid {
        grid-template-columns: auto;
        max-width: 400px;
    }
}

/* CARD */
.contract {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  background: linear-gradient(180deg, #111117, #0d0d12);
  border: 1px solid rgba(0,123,255,0.6);
  border-radius: 10px;
  padding: 18px 18px 16px;
  gap: 12px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0,123,255,0.15);
}

/* subtle glow line */
.contract::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, transparent, var(--contract-col), transparent);
  opacity: 0.6;
}

/* TASK */
.contract-name {
  font-size: 16px;
  line-height: 1.4;
  color: #f1f1f1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;;
    text-align: center;
    flex: 1;
}

/* subtle emphasis */
.contract-name b {
  color: #ffffff;
}

/* spacer / divider */
.contract-detail {
  height: 1px;
  background: rgba(255,255,255,0.06);
}

/* REWARD BADGE */
.contract-reward {
  height: 120px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  padding: 10px;
  border-radius: 6px;

  font-size: 13px;
  font-family: 'Black Ops One', serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;

  color: #7dd3fc;
  background: rgba(0,123,255,0.12);
  border: 1px solid rgba(0,123,255,0.35);
  box-shadow: inset 0 0 10px rgba(0,123,255,0.08);
}

/* optional rarity accents */
.contract:nth-child(1) .contract-reward {
  color: #facc15;
  border-color: rgba(250,204,21,0.4);
  background: rgba(250,204,21,0.10);
}

.contract:nth-child(2) .contract-reward {
  color: #4ade80;
  border-color: rgba(74,222,128,0.35);
  background: rgba(74,222,128,0.10);
}

.contract:nth-child(3) .contract-reward {
  color: #fb923c;
  border-color: rgba(251,146,60,0.35);
  background: rgba(251,146,60,0.10);
}