/* =========================
   GLOBAL
========================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #05070b;
  color: #d6a63a;
  font-family: "Inconsolata", monospace;
  min-height: 100vh;
  padding: 10px;
}

a {
  text-decoration: none;
  color: inherit;
}

/* =========================
   HEADER
========================= */

header {
  border: 1px solid #2a2112;
  background-color: #07090d;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  margin-bottom: 12px;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  letter-spacing: 3px;
  color: #d6a63a;
}

.search {
  width: 260px;
  padding: 10px 12px;
  background-color: #0d1016;
  border: 1px solid #2d2415;
  color: #ffffff;
  outline: none;
  font-size: 14px;
}

.search::placeholder {
  color: #666;
}

/* =========================
   MAIN LAYOUT
========================= */

.container {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 12px;
  align-items: start;
}

.left,
.main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

/* =========================
   SIDEBAR + INFO
========================= */

.sidebar,
.infor {
  background-color: #07090d;
  border: 1px solid #2a2112;
  padding: 16px;
  width: 100%;
}

.sidebar {
  min-height: 440px;
}

.sidebar h3,
.infor h3 {
  margin-bottom: 20px;
  font-size: 20px;
  color: #d6a63a;
  letter-spacing: 2px;
}

.sidebar ul {
  list-style: none;
}

.sidebar ul li {
  margin-bottom: 10px;
}

.sidebar ul li a {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #1f1a10;
  background-color: #0b0d12;
  color: #ffffff !important;
  transition: 0.25s;
  font-size: 15px;
  letter-spacing: 1px;
}

.sidebar ul li a:visited {
  color: #ffffff !important;
}

.sidebar ul li a i {
  width: 18px;
  color: #d6a63a;
  font-size: 15px;
}

.sidebar ul li a:hover,
.sidebar ul li a.active {
  background-color: #161109;
  border-color: #d6a63a;
  color: #d6a63a !important;
  transform: translateX(6px);
  box-shadow: 0 0 12px rgba(214, 166, 58, 0.08);
}

.infor {
  min-height: 250px;
}

.infor div {
  margin-bottom: 15px;
  color: #ffffff;
  font-size: 14px;
}

.infor label {
  float: right;
  color: #9c9c9c;
}

/* =========================
   BUTTON
========================= */

.btn {
  margin-top: 16px;
  width: 100%;
  padding: 12px;
  background-color: #1a1409;
  border: 1px solid #d6a63a;
  color: #d6a63a;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

.btn:hover {
  background-color: #d6a63a;
  color: #000;
}

.page-banner .btn,
.items-banner .btn {
  width: 190px;
  padding: 10px;
}

/* =========================
   BANNER
========================= */
.page-banner,
.items-banner {
  border: 1px solid #2a2112;

  background:
    linear-gradient(rgba(0, 0, 0, 0.72),
    rgba(0, 0, 0, 0.72)),
    url("../image/wiki.png");

  background-size: cover;

  background-position: center;

  padding: 28px;

  min-height: 260px;

  display: flex;

  flex-direction: column;

  justify-content: center;
}

.page-banner h1,
.items-banner h1 {
  font-size: 42px;

  line-height: 48px;

  letter-spacing: 5px;

  margin-bottom: 14px;

  color: #d6a63a;

  text-shadow:
    0 0 12px
    rgba(214, 166, 58, 0.3);
}

.page-banner p,
.items-banner p {
  width: 70%;

  max-width: 650px;

  color: #d0d0d0;

  font-size: 15px;

  line-height: 28px;

  margin-bottom: 18px;
}

.page-banner .btn,
.items-banner .btn {
  width: 190px;

  padding: 10px;
}




/* =========================
   COMMON SECTION
========================= */

.featured-box,
.section,
.update,
.link {
  background-color: #07090d;
  border: 1px solid #2a2112;
  padding: 22px;
  box-shadow: inset 0 0 20px rgba(214, 166, 58, 0.03);
}

.featured-box > h3,
.section h2,
.update h3,
.link h3 {
  color: #d6a63a;
  font-size: 26px;
  letter-spacing: 3px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #2a2112;
}

/* =========================
   HOME
========================= */

.featured-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: stretch;
}

.featured-cards a {
  display: block;
}

.card {
  min-height: 230px;
  background: linear-gradient(145deg, #0b0d12, #07090d);
  border: 1px solid #2a2112;
  padding: 25px 25px 25px 140px;
  position: relative;
  transition: 0.3s;
  box-shadow: inset 0 0 18px rgba(214, 166, 58, 0.03);
}

.card::before {
  content: "";
  position: absolute;
  left: 25px;
  top: 50%;
  transform: translateY(-50%);
  width: 90px;
  height: 90px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  image-rendering: pixelated;
}

.featured-character::before {
  background-image: url("../image/person.png");
}

.featured-item::before {
  background-image: url("../image/backpack.png");
}

.featured-ending::before {
  background-image: url("../image/ending.png");
}

.card:hover,
.item-card:hover,
.ending-card:hover {
  border-color: #d6a63a;
  transform: translateY(-4px);
  box-shadow: 0 0 12px rgba(214, 166, 58, 0.08);
}

.card h3 {
  color: #d6a63a;
  margin-bottom: 15px;
  font-size: 24px;
  letter-spacing: 2px;
}

.card p,
.update p,
.link p {
  color: #d0d0d0;
  font-size: 15px;
  line-height: 28px;
}

.bottom {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
}

.update,
.link {
  min-height: 150px;
}

/* =========================
   LORE BASIC
========================= */

.lore-box {
  display: flex;
  gap: 30px;
  align-items: stretch;
  flex-wrap: wrap;
}

.lore-text {
  flex: 2;
  min-width: 300px;
}

.lore-text p {
  color: #d0d0d0;
  font-size: 15px;
  line-height: 30px;
  margin-bottom: 22px;
}

.lore-image {
  width: 420px;
  height: 260px;
  min-width: 420px;
  min-height: 260px;
  max-width: 420px;
  max-height: 260px;
  background-color: #0b0d12;
  border: 1px solid #2a2112;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.lore-image::before {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #5f5f5f;
  font-size: 24px;
  letter-spacing: 5px;
}

.lore-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* =========================
   CHARACTER PROFILE
========================= */

.character-title {
  text-align: center;
  font-size: 28px;
  letter-spacing: 4px;
  margin-bottom: 20px;
  color: #d6a63a;
  border-bottom: 1px solid #2a2112;
  padding-bottom: 12px;
}

.character-top {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid #2a2112;
  padding-bottom: 20px;
  flex-wrap: wrap;
}

.character-image {
  width: 220px;
  height: 280px;
  border: 2px solid #d6a63a;
  background-image: url("../image/AnhTeo.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #111;
  overflow: hidden;
}

.character-stats {
  flex: 1;
  min-width: 260px;
}

.stat-row {
  display: flex;
  padding: 14px 6px;
  border-bottom: 1px solid #1b1b1b;
  font-size: 15px;
}

.stat-row label {
  width: 160px;
  color: #8e8e8e;
  font-weight: bold;
}

.stat-row span {
  color: #d6a63a;
  letter-spacing: 1px;
}

.alive {
  color: #1cff5b !important;
}

.character-lore,
.character-quote {
  margin-top: 25px;
}

.character-lore h2,
.character-quote h2 {
  font-size: 22px;
  color: #d6a63a;
  margin-bottom: 15px;
  letter-spacing: 2px;
}

.character-lore p {
  color: #cfcfcf;
  line-height: 28px;
  font-size: 15px;
  margin-bottom: 14px;
  max-width: 1000px;
}

.character-quote blockquote {
  border-left: 3px solid #d6a63a;
  padding-left: 15px;
  color: #8f8f8f;
  font-style: italic;
  font-size: 17px;
  line-height: 28px;
  margin-top: 10px;
}

/* =========================
   ITEMS PAGE
========================= */

.items-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.item-card {
  background-color: #0b0d12;
  border: 1px solid #2a2112;
  overflow: hidden;
  transition: 0.3s;
  min-height: 390px;
  position: relative;
}

.item-image,
.ending-image {
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #111;
  border-bottom: 1px solid #2a2112;
}

.item-image {
  height: 125px;
}

.food-image {
  background-image: url("../image/Food.png");
}

.water-image {
  background-image: url("../image/Water.png");
}

.medicine-image {
  background-image: url("../image/Medicine.png");
}

.chess-image {
  background-image: url("../image/Chess.png");
}

.fire-image {
  background-image: url("../image/Fire.png");
}

.radio-image {
  background-image: url("../image/Radio.png");
}

.item-content {
  padding: 16px;
}

.item-content h2 {
  color: #d6a63a;
  margin-bottom: 12px;
  font-size: 24px;
  letter-spacing: 2px;
}

.item-content p {
  color: #d0d0d0;
  line-height: 28px;
  font-size: 15px;
  margin-bottom: 16px;
}

.item-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item-info div {
  background: #0b0d12;
  border: 1px solid #1f1a10;
  padding: 10px 12px;
  color: #8f8f8f;
  font-size: 14px;
}

.item-info span {
  float: right;
  color: #d6a63a;
}

/* Popup shown on hover */
.item-popup {
  position: absolute;
  left: 50%;
  top: 18px;
  transform: translate(-50%, -10px) scale(0.98);
  opacity: 0;
  background: rgba(7, 9, 13, 0.98);
  border: 1px solid #2a2112;
  padding: 12px 14px;
  color: #d0d0d0;
  width: 320px;
  max-width: calc(100% - 24px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  transition: all 180ms ease;
  z-index: 30;
  pointer-events: none;
  border-radius: 6px;
}

.item-popup h3 {
  color: #b90707;
  margin-bottom: 8px;
  font-size: 18px;
}

.item-popup p {
  margin: 0;
  color: #cfcfcf;
  font-size: 14px;
  line-height: 1.4;
}

.item-card:hover .item-popup {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
  pointer-events: auto;
}

/* =========================
   STORY + GAMEPLAY
========================= */

.gameplay-layout,
.story-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 24px;
  align-items: start;
}

.gameplay-main,
.story-main,
.gameplay-side,
.story-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gameplay-card,
.story-card {
  background: linear-gradient(145deg, #0b0d12, #07090d);
  border: 1px solid #2a2112;
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 18px rgba(214, 166, 58, 0.03);
}

.gameplay-card::before,
.story-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: #d6a63a;
  opacity: 0.75;
}

.gameplay-card h3,
.story-card h3,
.status-box h3,
.story-note h3 {
  color: #d6a63a;
  font-size: 20px;
  letter-spacing: 2px;
  margin-bottom: 14px;
}

.gameplay-card p,
.story-card p {
  color: #d0d0d0;
  font-size: 15px;
  line-height: 28px;
  margin-bottom: 10px;
}

.gameplay-top,
.story-top {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.gameplay-number,
.story-number,
.story-symbol {
  width: 58px;
  height: 58px;
  min-width: 58px;
  border: 1px solid #d6a63a;
  background: #161109;
  color: #d6a63a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: bold;
  letter-spacing: 2px;
  box-shadow: 0 0 12px rgba(214, 166, 58, 0.12);
}

.story-symbol {
  width: 64px;
  height: 64px;
  min-width: 64px;
  background: radial-gradient(circle, #1a1409, #07090d);
  font-size: 30px;
}

.step-list,
.objective-list,
.ending-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step-item,
.objective-item,
.status-item,
.story-note-item,
.ending-feature {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #0b0d12;
  border: 1px solid #1f1a10;
  padding: 12px 14px;
  transition: 0.25s;
}

.step-item:hover,
.objective-item:hover,
.ending-feature:hover {
  border-color: #d6a63a;
  transform: translateX(4px);
}

.step-item span,
.objective-item span {
  width: 30px;
  height: 28px;
  min-width: 30px;
  border: 1px solid #d6a63a;
  color: #d6a63a;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #161109;
  font-weight: bold;
  font-size: 13px;
}

.step-item p,
.objective-item p,
.status-item p,
.story-note-item p {
  margin: 0;
  color: #e0e0e0;
}

.item-grid,
.story-tags {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.game-item,
.story-tag {
  background: #0b0d12;
  border: 1px solid #1f1a10;
  color: #e0e0e0;
  padding: 13px 14px;
  font-size: 15px;
  transition: 0.25s;
}

.game-item:hover,
.story-tag:hover {
  border-color: #d6a63a;
  color: #d6a63a;
  transform: translateY(-3px);
}

.status-box,
.story-note {
  background: #07090d;
  border: 1px solid #2a2112;
  padding: 18px;
}

.status-item span,
.story-note-item span {
  font-size: 20px;
}

.final-card {
  border-color: #d6a63a;
  box-shadow: 0 0 14px rgba(214, 166, 58, 0.08);
}

/* =========================
   ENDINGS
========================= */

.ending-grid,
.ending-showcase {
  display: grid;
  gap: 20px;
}

.ending-grid {
  grid-template-columns: repeat(2, minmax(300px, 500px));
  justify-content: center;
}

.ending-showcase {
  grid-template-columns: repeat(2, 1fr);
}

.ending-card,
.ending-panel {
  background: linear-gradient(145deg, #0b0d12, #07090d);
  border: 1px solid #2a2112;
  overflow: hidden;
  transition: 0.3s;
}

.ending-image {
  height: 160px;
}

.good-ending {
  background-image: url("../image/goodEnding.png");
}

.bad-ending {
  background-image: url("../image/badEnding.png");
}

.ending-content,
.ending-body {
  padding: 26px;
}

.ending-content h2,
.ending-header h2 {
  color: #d6a63a;
  letter-spacing: 3px;
}

.ending-content h2 {
  margin-bottom: 10px;
  font-size: 22px;
}

.ending-content p,
.ending-body p {
  color: #d0d0d0;
  line-height: 30px;
  font-size: 15px;
  margin-bottom: 24px;
}

.ending-status {
  background: #0b0d12;
  border: 1px solid #1f1a10;
  padding: 10px;
  color: #d6a63a;
  font-size: 13px;
  letter-spacing: 2px;
  text-align: center;
}

.ending-panel {
  position: relative;
  min-height: 450px;
  display: flex;
  flex-direction: column;
}

.ending-panel:hover {
  transform: translateY(-6px);
  border-color: #d6a63a;
  box-shadow: 0 0 22px rgba(214, 166, 58, 0.12);
}

.ending-overlay {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  pointer-events: none;
}

.good-panel .ending-overlay {
  background: radial-gradient(circle at top left, #d6a63a 0%, transparent 55%);
}

.bad-panel .ending-overlay {
  background: radial-gradient(circle at top left, #7a1414 0%, transparent 55%);
}

.ending-header {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 26px;
  border-bottom: 1px solid #1f1a10;
}

.ending-icon {
  width: 70px;
  height: 70px;
  border: 1px solid #d6a63a;
  background: #161109;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 28px;
  color: #d6a63a;
  box-shadow: 0 0 14px rgba(214, 166, 58, 0.12);
}

.ending-type {
  color: #8f8f8f;
  font-size: 13px;
  letter-spacing: 3px;
}

.ending-header h2 {
  margin-top: 6px;
  font-size: 32px;
}

.ending-body {
  flex: 1;
}

.ending-feature i {
  width: 26px;
  text-align: center;
  color: #d6a63a;
}

.ending-feature span {
  color: #e0e0e0;
  font-size: 15px;
}

.ending-footer {
  padding: 24px 26px;
  border-top: 1px solid #1f1a10;
}

.ending-footer .ending-status {
  width: 100%;
  padding: 14px;
  letter-spacing: 4px;
  font-size: 14px;
  font-weight: bold;
}

.success-status {
  background: rgba(40, 95, 40, 0.18);
  border: 1px solid #4caf50;
  color: #7dff8a;
}

.dead-status {
  background: rgba(120, 20, 20, 0.18);
  border: 1px solid #a33;
  color: #ff7d7d;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1200px) {
  .featured-cards,
  .items-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1100px) {
  .gameplay-layout,
  .story-layout {
    grid-template-columns: 1fr;
  }

  .gameplay-side .lore-image,
  .story-side .lore-image {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 1000px) {
  .container {
    grid-template-columns: 1fr;
  }

  header {
    flex-direction: column;
    gap: 16px;
  }

  .search {
    width: 100%;
  }

  .sidebar {
    min-height: auto;
  }

  .page-banner h1,
  .items-banner h1 {
    font-size: 38px;
    line-height: 44px;
  }

  .page-banner p,
  .items-banner p {
    width: 100%;
  }

  .bottom,
  .ending-showcase,
  .ending-grid {
    grid-template-columns: 1fr;
  }

  .lore-box {
    flex-direction: column;
  }

  .character-top {
    flex-direction: column;
  }

  .character-image {
    width: 100%;
    height: 350px;
  }

  .character-title {
    font-size: 24px;
  }

  .stat-row {
    flex-direction: column;
    gap: 6px;
  }
}

@media (max-width: 700px) {
  .featured-cards,
  .items-grid,
  .item-grid,
  .story-tags {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 140px 20px 25px 20px;
    text-align: center;
  }

  .card::before {
    left: 50%;
    top: 25px;
    transform: translateX(-50%);
  }

  .page-banner h1,
  .items-banner h1 {
    font-size: 32px;
    line-height: 38px;
  }

  .gameplay-top,
  .story-top,
  .ending-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .gameplay-card,
  .story-card {
    padding: 18px;
  }

  .ending-header h2 {
    font-size: 26px;
  }
}

.ending-art {
  height: 220px;
  margin: 24px 26px 0;
  border: 1px solid #2a2112;
  background-color: #0b0d12;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  image-rendering: pixelated;
}

.good-art {
  background-image: url("../image/teo_win.png");
}

.bad-art {
  background-image: url("../image/teo_dead.png");
}
