@font-face {
  font-family: "office";
  src: url("ITC American Typewriter Medium.otf");
  font-display: swap;
}

* {
    box-sizing: border-box;
    font-family: "office", serif !important;
}

/* =========================
   GLOBAL
========================= */

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;

    min-height: 100vh;

    background-image: url("https://media.wifi4office.com/bgpic.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* =========================
   VIDEO PLAYER (same position system kept)
========================= */
.vid {
    margin: 20px;
    width: 65%;
    max-width: 900px;

    aspect-ratio: 16 / 9;

    background: linear-gradient(
        to bottom,
        #cfd7de 0%,
        #aab5bf 45%,
        #8f9eab 100%
    );

    border: 3px solid #d8dde1;
    border-radius: 14px;

    box-shadow:
        inset 0 2px 3px rgba(255,255,255,.45),
        inset 0 -2px 4px rgba(0,0,0,.12),
        0 10px 25px rgba(0,0,0,.4);

    overflow: hidden;
}

/* subtle inner glow */
.vid::before {
    content: "";
    position: absolute;
    inset: 0;

    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0.08),
        transparent 40%,
        rgba(0,0,0,0.25)
    );

    pointer-events: none;
}

.vid video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* =========================
   BACK BUTTON (same placement kept)
========================= */
#back {
    position: absolute;
    right: 55px;
    bottom: 240px;

    width: 30%;
    max-width: 450px;
    height: 50px;

    font-size: 18px;
    font-weight: bold;

    color: #ffffff;

    background: linear-gradient(
        to bottom,
        #5B9BD5 0%,
        #3E7DB5 45%,
        #1F4E79 100%
    );

    border: 3px solid #88B6D9;
    border-radius: 12px;

    box-shadow:
        inset 0 1px 2px rgba(255,255,255,.45),
        inset 0 -2px 4px rgba(0,0,0,.18),
        0 6px 15px rgba(0,0,0,.35);

    text-shadow: 0 1px 2px rgba(0,0,0,.4);

    cursor: pointer;

    transition: all .2s ease;
}

#back:hover {
    background: linear-gradient(
        to bottom,
        #6FAFE4 0%,
        #4A89C2 45%,
        #295D8A 100%
    );

    border-color: #A7CAE6;

    box-shadow:
        inset 0 1px 2px rgba(255,255,255,.55),
        0 0 18px rgba(91,155,213,.55),
        0 8px 18px rgba(0,0,0,.4);

    transform: translateY(-2px);
}

/* =========================
   EPISODE SCROLLER (same structure)
========================= */
.episodes {
    margin: 20px;

    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;

    overflow-x: auto;
    overflow-y: hidden;

    height: 170px;

    gap: 18px;
    padding: 20px;

    background: linear-gradient(
        to bottom,
        #cfd7de 0%,
        #aab5bf 45%,
        #8f9eab 100%
    );

    border: 3px solid #d8dde1;
    border-radius: 14px;

    box-shadow:
        inset 0 2px 3px rgba(255,255,255,.45),
        inset 0 -2px 4px rgba(0,0,0,.12),
        0 10px 25px rgba(0,0,0,.4);
}
.episodes::before {
    content: "";

    position: absolute;
    top: 0;
    left: 0;
    right: 0;

    height: 40%;

    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0.08),
        transparent
    );

    pointer-events: none;
}

/* =========================
   EPISODE TILE
========================= */
.ep {
    flex: 0 0 auto;

    width: 260px;
    height: 140px;

    position: relative;

    background: linear-gradient(
        to bottom,
        #cfd7de 0%,
        #aab5bf 45%,
        #8f9eab 100%
    );

    border: 3px solid #d8dde1;
    border-radius: 14px;

    overflow: hidden;

    cursor: pointer;

    box-shadow:
        inset 0 2px 3px rgba(255,255,255,.45),
        inset 0 -2px 4px rgba(0,0,0,.12),
        0 10px 25px rgba(0,0,0,.4);

    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ep:hover {
    transform: translateY(-6px) scale(1.04);

    box-shadow:
        inset 0 2px 3px rgba(255,255,255,.55),
        inset 0 -2px 4px rgba(0,0,0,.18),
        0 18px 35px rgba(0,0,0,.55),
        0 0 12px rgba(91,155,213,.35);
}

/* =========================
   EPISODE VIDEO
========================= */
.ep video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;

    filter: contrast(1.05) saturate(1.05);
}

/* =========================
   EPISODE TITLE (re-styled, same position)
========================= */
.ep-title {
    position: absolute;
    top: 6px;
    left: 6px;

    font-family: "office", serif;
    font-size: 13px;
    font-weight: bold;

    color: #ffffff;

    background: linear-gradient(
        to bottom,
        #5B9BD5 0%,
        #3E7DB5 45%,
        #1F4E79 100%
    );

    border: 2px solid #88B6D9;
    border-radius: 12px;

    padding: 4px 8px;

    box-shadow:
        inset 0 1px 2px rgba(255,255,255,.45),
        inset 0 -2px 4px rgba(0,0,0,.18),
        0 4px 10px rgba(0,0,0,.35);

    text-shadow: 0 1px 2px rgba(0,0,0,.4);

    pointer-events: none;

    max-width: 90%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =========================
   SCROLLBAR
========================= */
::-webkit-scrollbar {
    height: 10px;
    width: 10px;
}

::-webkit-scrollbar-track {
    background: linear-gradient(
        to bottom,
        #2b2f3a,
        #1f2430
    );

    border-radius: 10px;

    box-shadow:
        inset 0 1px 2px rgba(255,255,255,0.05),
        inset 0 -1px 2px rgba(0,0,0,0.4);
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(
        to bottom,
        #5B9BD5,
        #3E7DB5,
        #1F4E79
    );

    border-radius: 10px;

    border: 2px solid #88B6D9;

    box-shadow:
        inset 0 1px 2px rgba(255,255,255,0.35),
        0 2px 8px rgba(0,0,0,0.4);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(
        to bottom,
        #6FAFE4,
        #4A89C2,
        #295D8A
    );

    box-shadow:
        0 0 10px rgba(91,155,213,0.6),
        inset 0 1px 2px rgba(255,255,255,0.4);
}

/* =========================
   COMMENT BOX (same fixed layout)
========================= */
.comment-box {
  position: fixed;
  top: 20px;
  right: 50px;

  inline-size: min(30vw, 555px);
  block-size: 55vh;

  display: flex;
  flex-direction: column;

  padding: 10px;

  background: linear-gradient(
      to bottom,
      #cfd7de 0%,
      #aab5bf 45%,
      #8f9eab 100%
  );

  border: 3px solid #d8dde1;
  border-radius: 14px;

  box-shadow:
      inset 0 2px 3px rgba(255,255,255,.45),
      inset 0 -2px 4px rgba(0,0,0,.12),
      0 10px 25px rgba(0,0,0,.4);

  z-index: 999;
}

/* =========================
   INPUT AREA
========================= */
.comment-create {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comment-create input,
.comment-create textarea {
    width: 100%;

    padding: 10px;

    margin-bottom: 10px;

    color: #333;

    background: linear-gradient(
        to bottom,
        #ffffff,
        #e6eaed
    );

    border: 2px solid #a5afb8;

    border-radius: 6px;

    box-shadow:
        inset 0 1px 2px rgba(255,255,255,.8),
        inset 0 -1px 2px rgba(0,0,0,.08);

    outline: none;

    transition: .2s;

    font-family: "office", serif;
}

.comment-create textarea {
    min-block-size: 120px;
    resize: none;
}

/* =========================
   COMMENT BUTTON
========================= */
.comment-create button {
    width: 100%;
    padding: 10px;

    font-size: 18px;
    font-weight: bold;

    color: #ffffff;

    background: linear-gradient(
        to bottom,
        #5B9BD5 0%,
        #3E7DB5 45%,
        #1F4E79 100%
    );

    border: 3px solid #88B6D9;
    border-radius: 12px;

    box-shadow:
        inset 0 1px 2px rgba(255,255,255,.45),
        inset 0 -2px 4px rgba(0,0,0,.18),
        0 6px 15px rgba(0,0,0,.35);

    text-shadow: 0 1px 2px rgba(0,0,0,.4);

    cursor: pointer;

    transition: all .2s ease;
}

.comment-create button:hover {
    background: linear-gradient(
        to bottom,
        #6FAFE4 0%,
        #4A89C2 45%,
        #295D8A 100%
    );

    border-color: #A7CAE6;

    box-shadow:
        inset 0 1px 2px rgba(255,255,255,.55),
        0 0 18px rgba(91,155,213,.55),
        0 8px 18px rgba(0,0,0,.4);

    transform: translateY(-2px);
}

/* =========================
   COMMENTS LIST
========================= */
#comments {
  display: flex;
  flex-direction: column;
  gap: 6px;

  background: rgba(255,255,255,0.25);

  border-radius: 10px;

  padding: 6px;

  overflow-y: auto;
  flex: 1;
}

.comment {
  background: linear-gradient(
      to bottom,
      #ffffff 0%,
      #f2f4f6 100%
  );

  border: 1px solid #d8dde1;
  border-radius: 8px;

  padding: 10px;

  color: #2b2f3a;
}

/* =========================
   COMMENT ACTION BUTTONS
========================= */
.comment button {
  margin-left: 5px;

  font-family: "office", serif;
  font-size: 14px;
  font-weight: bold;

  color: #ffffff;

  background: linear-gradient(
      to bottom,
      #5B9BD5 0%,
      #3E7DB5 45%,
      #1F4E79 100%
  );

  border: 2px solid #88B6D9;
  border-radius: 12px;

  padding: 4px 10px;

  cursor: pointer;

  box-shadow:
      inset 0 1px 2px rgba(255,255,255,.45),
      inset 0 -2px 4px rgba(0,0,0,.18),
      0 4px 10px rgba(0,0,0,.25);

  text-shadow: 0 1px 2px rgba(0,0,0,.4);

  transition: all .2s ease;
}

.comment button:hover {
  background: linear-gradient(
      to bottom,
      #6FAFE4 0%,
      #4A89C2 45%,
      #295D8A 100%
  );

  border-color: #A7CAE6;

  box-shadow:
      inset 0 1px 2px rgba(255,255,255,.55),
      0 0 12px rgba(91,155,213,.5),
      0 6px 14px rgba(0,0,0,.35);

  transform: translateY(-2px);
}

/* =========================
   RESPONSIVE (PORTRAIT)
========================= */
@media (orientation: portrait) {

  html, body {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100vh;
  }

  .vid {
    width: 95%;
    margin: 10px auto;
  }

  #back {
    position: relative;
    display: block;

    width: 95%;
    margin: 10px auto;
  }

  .episodes {
    width: 95%;
    margin: 10px auto;
  }

.comment-box {
  position: relative;

  width: 95%;
  max-width: 600px;
  right: 0;
  margin: 10px auto;

  block-size: 50vh;
}
}

/* =========================
   LANDSCAPE SMALL SCREENS
========================= */
@media (orientation: landscape) and (max-width: 1024px) {

  .vid {
    width: 65%;
    margin: 20px;
  }

  .episodes {
    margin: 20px;
  }

  #back {
    position: absolute;
    right: 40px;
    top: 280px;

    width: 20%;
    max-width: 250px;
    height: 25px;

    font-size: 14px;
  }

  .comment-create textarea {
    min-block-size: 70px;
  }

  .comment-box {
    position: absolute;
    top: 20px;
    right: 20px;

    width: min(25vw, 200px);
    height: 70vh;
  }
}