/* ===== The World of Esports ===== */

:root {
  --bg: #1a0f17;
  --panel: #2a1825;
  --line: #3d2a38;
  --accent: #fffe3e;
  --on-accent: #1a0f17;
  --red: #f23f37;
  --text: #f3eff2;
  --muted: #a39aa1;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  line-height: 1.6;
}

/* ----- navigation ----- */
header {
  background: rgba(26, 15, 23, 0.95);
  padding: 14px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
}

.logo {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: white;
  text-decoration: none;
}

.logo span {
  color: var(--accent);
}

nav a {
  color: var(--muted);
  margin-left: 22px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}

nav a:hover,
nav a.active {
  color: white;
  border-bottom-color: var(--accent);
}

/* ----- hero with video ----- */
.hero {
  position: relative;
  height: 100vh;
  min-height: 500px;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 0 8%;
  background: #000 url("https://upload.wikimedia.org/wikipedia/commons/thumb/b/b9/IEM_Katowice_Major_2019.jpg/1280px-IEM_Katowice_Major_2019.jpg") center / cover;
}

/* YouTube video as background: always covers the whole screen */
#ytBg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100vw;
  height: 56.25vw;      /* 16:9 */
  min-height: 100vh;
  min-width: 177.78vh;  /* 16:9 */
  transform: translate(-50%, -50%) scale(1.15); /* hide YouTube title and logo at the edges */
  pointer-events: none;
  border: 0;
  opacity: 0;
  transition: opacity 1s;
}

#ytBg.on {
  opacity: 1;
}

.watch-full {
  color: white;
  font-size: 13px;
  font-weight: 600;
  margin-right: 15px;
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
}

.hero .overlay {
  position: absolute;
  inset: 0;
  background: rgba(26, 15, 23, 0.62);
}

.hero-text {
  position: relative;
  max-width: 640px;
}

.label {
  display: inline-block;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.hero h1 {
  font-size: 60px;
  line-height: 1.1;
  margin: 0 0 15px;
  font-weight: 800;
  text-transform: uppercase;
}

.hero p {
  font-size: 19px;
  color: #d0d0d5;
}

.btn {
  display: inline-block;
  padding: 13px 28px;
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 2px solid var(--accent);
  margin: 10px 10px 0 0;
  transition: 0.2s;
}

.btn:hover {
  background: transparent;
  color: var(--accent);
}

.btn.outline {
  background: transparent;
  border-color: white;
  color: white;
}

.btn.outline:hover {
  background: white;
  color: var(--bg);
}

.hero-controls {
  position: absolute;
  bottom: 30px;
  left: 8%;
  right: 8%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.clip-info {
  color: #ccc;
  font-size: 13px;
}

.dots span {
  display: inline-block;
  width: 30px;
  height: 4px;
  background: rgba(255, 255, 255, 0.35);
  margin-left: 6px;
  cursor: pointer;
  vertical-align: middle;
}

.dots span.on {
  background: var(--accent);
}

.icon-btn {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.4);
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 14px;
  margin-left: 10px;
}

/* ----- sections ----- */
main {
  max-width: 1150px;
  margin: 0 auto;
  padding: 0 20px;
}

section {
  padding: 70px 0 30px;
  scroll-margin-top: 50px;
}

h2 {
  font-size: 32px;
  font-weight: 800;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.lead {
  color: var(--muted);
  margin: 0 0 30px;
  max-width: 700px;
}

/* appear on scroll */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: 0.7s;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ----- facts ----- */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 30px;
}

.fact {
  background: var(--panel);
  padding: 25px;
  color: var(--muted);
  font-size: 14px;
}

.fact .num {
  display: block;
  font-size: 40px;
  font-weight: 800;
  color: white;
}

/* steps */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.step {
  border-top: 3px solid var(--line);
  padding-top: 15px;
  transition: 0.2s;
}

.step:hover {
  border-top-color: var(--accent);
}

.step b {
  color: var(--accent);
  font-size: 14px;
}

.step h3 {
  margin: 5px 0;
}

.step p {
  color: var(--muted);
  margin: 0;
}

/* ----- filters and tabs ----- */
.filters,
.tabs {
  margin-bottom: 20px;
}

.filters button,
.tabs button {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 8px 18px;
  margin: 0 8px 8px 0;
}

.filters button.on,
.tabs button.on {
  background: white;
  color: var(--bg);
  border-color: white;
}

/* ----- game cards ----- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: 0.25s;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}

.card.hidden {
  display: none;
}

.card img {
  width: 100%;
  height: 165px;
  object-fit: cover;
  display: block;
  background: #222;
}

.card-body {
  padding: 16px;
}

.card h3 {
  margin: 0;
}

.tag {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.more {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

/* ----- modal window ----- */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 50;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal.open {
  display: flex;
}

.modal-box {
  background: var(--panel);
  border: 1px solid var(--line);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-box img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  display: block;
}

.modal-content {
  padding: 20px 25px;
}

.modal-content h3 {
  font-size: 26px;
  margin: 0 0 5px;
}

.modal-content table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.modal-content td {
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.modal-content td:first-child {
  color: var(--muted);
  width: 40%;
}

.close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 20px;
}

/* ----- videos ----- */
.videos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 20px;
}

.video {
  background: var(--panel);
  border: 1px solid var(--line);
}

.thumb {
  position: relative;
  display: block;
}

.thumb img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: #000;
  filter: brightness(0.7);
  transition: 0.3s;
}

.thumb:hover img {
  filter: brightness(1);
}

.play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  line-height: 60px;
  text-align: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 22px;
}

.video-text {
  padding: 15px 18px;
}

.video-text h3 {
  margin: 4px 0;
}

.video-text p {
  color: var(--muted);
  margin: 0 0 10px;
}

.video a.link {
  color: var(--muted);
  font-size: 13px;
}

/* ----- teams ----- */
.teams {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.team {
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  padding: 20px;
}

.team h3 {
  margin: 0 0 5px;
  font-size: 22px;
}

.team-meta {
  color: var(--muted);
  margin: 0;
}

.team-games {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 8px 0 12px;
}

.team ul {
  margin: 0;
  padding: 12px 0 0 18px;
  border-top: 1px solid var(--line);
}

.team li {
  margin-bottom: 5px;
}

/* ----- tournaments (tabs) ----- */
.t-panel {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.t-panel.on {
  display: grid;
}

.t-panel img {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
  display: block;
}

.t-panel div {
  padding: 25px 25px 25px 0;
}

.t-panel h3 {
  font-size: 24px;
  margin: 0 0 10px;
}

.t-info {
  display: flex;
  gap: 30px;
  margin: 15px 0;
}

.t-info span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

/* ----- quiz ----- */
#quizBox {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 25px;
  max-width: 700px;
}

.progress {
  height: 4px;
  background: var(--line);
  margin-bottom: 20px;
}

#progressBar {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: 0.3s;
}

#quizCount {
  color: var(--muted);
  font-size: 13px;
}

#quizQuestion {
  font-size: 20px;
  font-weight: 700;
  margin: 5px 0 15px;
}

#quizAnswers button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  padding: 12px 15px;
  margin-bottom: 8px;
  font-weight: normal;
  font-size: 15px;
}

#quizAnswers button:hover {
  border-color: white;
  opacity: 1;
}

#quizAnswers button.right {
  border-color: #2ecc71;
  background: rgba(46, 204, 113, 0.15);
}

#quizAnswers button.wrong {
  border-color: var(--red);
  background: rgba(242, 63, 55, 0.15);
}

#quizNext {
  margin-top: 10px;
  display: none;
}

/* ----- agent ----- */
#agent-box {
  background: var(--panel);
  padding: 20px;
  border: 1px solid var(--line);
}

#chatLog {
  background: var(--bg);
  height: 280px;
  overflow-y: auto;
  padding: 12px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
}

#chatLog p {
  margin: 5px 0;
  padding: 9px 13px;
  max-width: 80%;
}

.agent-msg {
  background: #3a2635;
  align-self: flex-start;
}

.typing {
  color: var(--muted);
  font-style: italic;
}

.user-msg {
  background: var(--accent);
  color: var(--on-accent);
  align-self: flex-end;
}

.quick button {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  margin: 0 6px 10px 0;
}

.quick button:hover {
  color: white;
  border-color: white;
  opacity: 1;
}

input, textarea {
  padding: 11px;
  width: 320px;
  margin: 5px 0;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  font-family: inherit;
  font-size: 14px;
}

input:focus, textarea:focus {
  outline: none;
  border-color: white;
}

textarea {
  height: 100px;
}

button {
  padding: 11px 20px;
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
}

button:hover {
  opacity: 0.85;
}

#response {
  display: none; /* the answer is shown in the chat log */
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
}

.contact-info,
#contact form {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 25px;
}

.contact-info h3 {
  margin-top: 0;
}

.contact-info p {
  color: var(--muted);
}

.contact-info ul {
  list-style: none;
  padding: 0;
}

.contact-info li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.contact-info li span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

#contact .row {
  display: flex;
  gap: 15px;
}

#contact input,
#contact select,
#contact textarea {
  width: 100%;
  margin: 0 0 15px;
}

select {
  padding: 11px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  font-family: inherit;
  font-size: 14px;
}

#contact textarea {
  height: 140px;
}

#feedbackText {
  font-weight: bold;
}

/* back to top button */
#toTop {
  position: fixed;
  right: 25px;
  bottom: 25px;
  width: 45px;
  height: 45px;
  padding: 0;
  font-size: 18px;
  display: none;
  z-index: 30;
}

/* ----- footer ----- */
footer {
  text-align: center;
  padding: 30px 20px;
  margin-top: 50px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 13px;
}

footer .credits {
  font-size: 11px;
  color: #666;
  max-width: 900px;
  margin: 10px auto 0;
}

/* ----- phones ----- */
@media (max-width: 800px) {
  header {
    position: absolute;
    flex-direction: column;
    padding: 10px;
  }
  nav {
    text-align: center;
  }
  nav a {
    display: inline-block;
    margin: 4px 7px;
  }
  .hero h1 {
    font-size: 36px;
  }
  .clip-info {
    display: none;
  }
  .videos {
    grid-template-columns: 1fr;
  }
  .t-panel.on {
    grid-template-columns: 1fr;
  }
  .t-panel div {
    padding: 0 20px 20px;
  }
  input, textarea {
    width: 100%;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
  #contact .row {
    flex-direction: column;
    gap: 0;
  }
}

/* icon buttons on dark background */
.icon-btn,
.close {
  color: white;
}

/* wide input in the agent chat */
#agent-box input {
  width: calc(100% - 110px);
}
