/* ===== Light Theme & Global Styles ===== */
:root{
  --bg-body:#f8f9fa;
  --bg-white:#ffffff;
  /* Brand Colors based on Logo */
  --primary:#ff3d00; /* Vibrant Orange/Red */
  --primary-hover:#d50000;
  --gradient-start:#ff4d4d;
  --gradient-end:#ff0000;
  --accent:#ffab00;
  --text-main:#333333;
  --text-light:#666666;
  --border:#e0e0e0;
  --radius:12px;
  --font:'Inter','Segoe UI',Roboto,system-ui,sans-serif;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}
*{margin:0;padding:0;box-sizing:border-box}
html{scroll-behavior:smooth;scroll-padding-top:80px}
body{
  font-family:var(--font);
  background:var(--bg-body);
  color:var(--text-main);
  line-height:1.7;
  -webkit-font-smoothing:antialiased;
}
a{color:var(--primary);text-decoration:none;transition:.2s;cursor:pointer;}
a:hover{color:var(--primary-hover)}
img{max-width:100%;display:block;border-radius:var(--radius)}
h1,h2,h3,h4{line-height:1.3;color:#111;font-weight:700}

/* ===== NEW GRADIENT HEADING STYLE (From Screenshot 1) ===== */
h1, h2 {
  background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 8px;
  margin: 2rem 0 1.5rem 0;
  font-size: 1.6rem;
  box-shadow: 0 4px 10px rgba(255, 0, 0, 0.2);
}
h1 { font-size: 2rem; text-align: center; }
h3 { font-size: 1.2rem; margin: 1.5rem 0 .75rem; color: var(--primary); }
p{margin-bottom:1rem;color:var(--text-main)}

/* Keyword Highlighting */
.keyword {
  color: var(--primary);
  font-weight: 700;
}

/* ===== Header / Nav ===== */
header{
  position:sticky;top:0;z-index:1000;
  background:var(--bg-white);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  border-bottom:1px solid var(--border);
}
.nav-wrap{
  max-width:1100px;margin:auto;padding:0.8rem 1.2rem;
  display:flex;align-items:center;justify-content:space-between;
}
.logo img{height: 38px; width: auto; display: block;}
.logo-text { font-size: 1.5rem; font-weight: 800; color: var(--primary); }

/* Hamburger */
.hamburger{
  width:44px;height:44px;display:none;
  flex-direction:column;justify-content:center;gap:5px;
  background:transparent;border:1px solid var(--border);
  border-radius:8px;cursor:pointer;padding:10px;
}
.hamburger span{display:block;height:2px;background:var(--text-main);border-radius:2px;transition:.3s}
.hamburger.active span:nth-child(1){transform:translateY(7px) rotate(45deg)}
.hamburger.active span:nth-child(2){opacity:0}
.hamburger.active span:nth-child(3){transform:translateY(-7px) rotate(-45deg)}

nav ul{display:flex;gap:1.5rem;list-style:none}
nav a{font-weight:600;font-size:.95rem;color:var(--text-main);padding:.4rem .2rem;}
nav a.active,nav a:hover{color:var(--primary)}

@media(max-width:820px){
  .hamburger{display:flex}
  nav{
    position:fixed;top:64px;left:0;right:0;
    background:var(--bg-white);border-bottom:1px solid var(--border);
    max-height:0;overflow:hidden;transition:max-height .35s ease;
    box-shadow: var(--shadow);
  }
  nav.open{max-height:420px}
  nav ul{flex-direction:column;gap:0;padding:.5rem 1.2rem 1rem}
  nav li{border-bottom:1px solid var(--border)}
  nav a{display:block;padding:.9rem 0}
}

/* ===== Layout & Cards ===== */
main{max-width:1100px;margin:auto;padding:2rem 1.2rem 4rem; min-height: 70vh;}
.hero-top {
  text-align: center;
  padding: 2rem 1rem;
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}
.hero-top h1 { margin-top: 0; }
.hero-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.btn-primary, .btn-secondary {
  padding: 0.8rem 2.5rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: 0.2s;
  display: inline-block;
}
.btn-primary {
  background: var(--primary);
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(255,61,0,0.3);
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}
.btn-secondary {
  background: var(--bg-white);
  color: var(--primary) !important;
  border: 2px solid var(--primary);
}
.btn-secondary:hover {
  background: #fff3e0;
  transform: translateY(-2px);
}

.content-box {
  background: var(--bg-white);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

/* Tables */
.table-wrap{overflow-x:auto;margin:1.5rem 0; border-radius: 8px; border: 1px solid var(--border);}
table{width:100%;border-collapse:collapse;background:var(--bg-white);font-size:.95rem}
th,td{padding:.85rem 1rem;text-align:left;border-bottom:1px solid var(--border)}
th{background:#f1f3f5;color:var(--primary);font-weight:700}
tr:last-child td{border-bottom:none}

/* Lists & Steps */
ol.steps, ul.list {padding-left:1.5rem;margin-bottom:1.5rem}
ol.steps li, ul.list li {margin-bottom:.6rem}

/* TOC Dropdown */
.toc-container {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 2rem;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.toc-btn {
  width: 100%;
  padding: 1rem 1.5rem;
  background: #f8f9fa;
  border: none;
  text-align: left;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: 0.2s;
}
.toc-btn:hover { background: #e9ecef; }
.toc-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out;
  background: var(--bg-white);
}
.toc-content.open { max-height: 800px; }
.toc-content ol {
  padding: 1rem 1.5rem 1.5rem 3rem;
  margin: 0;
  font-size: 0.95rem;
}
.toc-content li { margin-bottom: 0.5rem; }

/* Article Image Space */
.article-image-space {
  width: 100%;
  height: 250px;
  background: #f8f9fa;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  margin: 1.5rem 0 2.5rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #adb5bd;
  font-weight: 600;
  font-size: 0.95rem;
}

/* Game Section (Play Store Style) */
.game-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; margin: 1.5rem 0; }
.game-card { 
  background: var(--bg-white); 
  border: 1px solid var(--border); 
  border-radius: var(--radius); 
  padding: 1rem; 
  display: flex; 
  align-items: center; 
  gap: 1rem; 
  box-shadow: var(--shadow); 
  transition: 0.2s; 
  cursor: pointer;
}
.game-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.game-img-box { 
  width: 70px; 
  height: 70px; 
  border-radius: 16px; 
  overflow: hidden; 
  flex-shrink: 0;
  background: #e9ecef;
  border: 1px solid #dee2e6;
}
.game-img-box img {
  width: 100%; height: 100%; object-fit: cover;
}
.game-info { flex-grow: 1; }
.game-info h3 { margin: 0 0 0.2rem 0; font-size: 1.1rem; color: #111; background: none; padding: 0; box-shadow: none; }
.game-info p { margin: 0; font-size: 0.85rem; color: var(--text-light); }
.game-install-btn {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.4rem 1rem;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

/* Alerts & Notes */
.tip{background:#e3f2fd;border-left:4px solid #1e88e5;padding:1rem;border-radius:8px;margin:1.5rem 0;font-size:.95rem}
.note{background:#fff3e0;border-left:4px solid var(--accent);padding:1rem;border-radius:8px;margin:1.5rem 0;font-size:.95rem}

/* FAQ */
.faq details{background:var(--bg-white);border:1px solid var(--border);border-radius:8px;padding:1rem 1.2rem;margin-bottom:.8rem;box-shadow: 0 1px 3px rgba(0,0,0,0.05);}
.faq summary{cursor:pointer;font-weight:600;color:var(--text-main);font-size: 1.05rem;}
.faq details[open] summary{color:var(--primary);margin-bottom:.8rem;}

/* Forms */
form { background: var(--bg-white); padding: 1.5rem; border-radius: var(--radius); border: 1px solid var(--border); }
form label{display:block;font-weight:600;margin:.8rem 0 .3rem;font-size:.95rem}
form input,form textarea{width:100%;padding:.8rem;border-radius:8px;border:1px solid var(--border);font-family:inherit;font-size:.95rem;}
form textarea{min-height:150px;resize:vertical}
form button{width: 100%; margin-top:1.2rem;background:var(--primary);color:#fff;border:none;font-weight:700;padding:.9rem;border-radius:8px;cursor:pointer;font-size:1rem; transition: 0.2s;}
form button:hover{background: var(--primary-hover);}

/* ===== FOOTER (Dark Theme & Fixed Text Visibility) ===== */
footer{background:#111111;color:#ffffff;padding:3rem 1.2rem 1rem;margin-top:4rem}
.foot-wrap{max-width:1100px;margin:auto;display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:2rem}
.footer-logo-box { margin-bottom: 1rem; }
.footer-logo-box img { height: 35px; border-radius: 4px; }
.footer-logo-text { font-size: 1.5rem; font-weight: 800; color: var(--primary); margin-bottom: 1rem; }
footer p { color: #aaaaaa; font-size: 0.95rem; line-height: 1.6; }
footer h4{color:#ffffff;margin-bottom:1rem;font-size: 1.1rem; text-transform: uppercase; letter-spacing: 1px;}
footer a{display:block;color:#dddddd;font-size:.95rem;margin-bottom:.8rem; text-decoration: none;}
footer a:hover{color:var(--accent); text-decoration: underline;}

/* Footer Contact Us Section (From Screenshot 3) */
.contact-list { list-style: none; padding: 0; }
.contact-list li { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; color: #dddddd; font-size: 0.95rem; }
.contact-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(to bottom right, #ff4d4d, #ff0000);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; box-shadow: 0 2px 5px rgba(255,0,0,0.3);
}
.contact-icon svg { width: 20px; height: 20px; fill: #ffffff; }

.copyright{max-width:1100px;margin:3rem auto 0;padding-top:1.5rem;border-top:1px solid #333;text-align:center;color:#888888;font-size:.9rem}

/* SPA Routing */
.page-section { display: none; }
.page-section.active { display: block; animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ===== Requested Home Page refinements ===== */
.primary-keyword-link { color: inherit; text-decoration: none; }
.primary-keyword-link:hover { text-decoration: underline; text-decoration-thickness: 2px; }
header .logo img { width: 160px; height: auto; max-height: 60px; object-fit: contain; }
footer .footer-logo-box img { width: 160px; height: auto; max-height: 60px; object-fit: contain; }
.dmplay-brand-icon { display:flex; justify-content:center; align-items:center; margin: 1.25rem auto 1.75rem; }
.dmplay-brand-icon img { width: min(190px, 55vw); height:auto; border-radius: 18px; }
.screenshot-placeholder {
  width: min(100%, 420px); min-height: 250px; margin: 1.25rem auto 2rem;
  border: 2px dashed #ff8a78; border-radius: 14px; background: #fff8f6;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  padding: 1.5rem; text-align:center; color:#a64b3d;
}
.screenshot-placeholder strong { font-size:1rem; color:#d84332; margin-bottom:.55rem; }
.screenshot-placeholder p { margin:0; color:#8b6b66; font-size:.9rem; }
@media (max-width: 600px) {
  header .logo img, footer .footer-logo-box img { width: 132px; }
  .screenshot-placeholder { min-height: 210px; }
}

/* ===== Header and image placeholder corrections ===== */
header .logo img,
footer .footer-logo-box img {
  width: 142px;
  height: auto;
  max-height: 54px;
  object-fit: contain;
}
.hamburger {
  width: auto;
  min-width: 64px;
  height: 40px;
  padding: 0 12px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text-main);
  font: 600 .9rem var(--font);
  letter-spacing: .01em;
}
.hamburger.active {
  border-color: var(--primary);
  background: #fff7f4;
}
@media (max-width: 820px) {
  .hamburger { display: inline-flex; }
  header .logo img { width: 120px; max-height: 46px; }
  header nav { top: 72px; }
}
@media (max-width: 600px) {
  footer .footer-logo-box img { width: 120px; }
}

/* ===== V3: mobile navigation hamburger and footer layout ===== */
header .hamburger {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 9px;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
header .hamburger span {
  display: block;
  width: 21px;
  height: 2px;
  border-radius: 2px;
  background: #222;
  transition: transform .2s ease, opacity .2s ease;
}
header .hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
header .hamburger.active span:nth-child(2) {
  opacity: 0;
}
header .hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
@media (max-width: 820px) {
  header .hamburger { display: inline-flex; }
  header .nav-wrap { min-height: 64px; }
  header nav { top: 64px; }
}
footer .foot-wrap {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem;
  align-items: start;
}
footer .foot-wrap > div { min-width: 0; }
footer .foot-wrap > div:first-child p {
  max-width: 270px;
  margin: .75rem 0 0;
  line-height: 1.55;
  overflow-wrap: break-word;
}
footer h4 { margin-bottom: 1rem; }
footer .foot-wrap a { overflow-wrap: anywhere; }
footer .contact-list li { align-items: center; }
footer .contact-list li > a:last-child {
  color: #f2f2f2;
  font-weight: 500;
}
footer .copyright { margin-top: 2rem; }
@media (max-width: 820px) {
  footer .foot-wrap {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1.5rem;
    row-gap: 1.75rem;
  }
}
@media (max-width: 430px) {
  footer .foot-wrap {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  footer .foot-wrap > div:first-child p { max-width: 100%; }
}


/* ===== Home page supplied screenshots ===== */
.home-screenshot {
  margin: 1.35rem auto 2rem;
  padding: 0;
  width: 100%;
  max-width: 470px;
  background: #fff;
  border: 1px solid rgba(255, 91, 65, .16);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 5px 16px rgba(80, 25, 10, .07);
}
.home-screenshot.wide {
  max-width: 920px;
}
.home-screenshot img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  border-radius: 0;
}
@media (max-width: 600px) {
  .home-screenshot {
    width: 100%;
    max-width: 430px;
    margin: 1rem auto 1.5rem;
    border-radius: 12px;
  }
  .home-screenshot.wide {
    max-width: 100%;
  }
}


/* ===== Home screenshots: phone-sized display ===== */
#page-home .home-screenshot {
  width: min(100%, 300px);
  max-width: 300px;
  margin: 1.2rem auto 1.7rem;
}
#page-home .home-screenshot.wide {
  width: min(100%, 360px);
  max-width: 360px;
}
#page-home .home-screenshot img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
}
@media (max-width: 600px) {
  #page-home .home-screenshot {
    width: min(100%, 300px);
    max-width: 300px;
    margin: 1rem auto 1.4rem;
  }
  #page-home .home-screenshot.wide {
    width: min(100%, 360px);
    max-width: 360px;
  }
}


/* ===== Home game icons: portrait cards, responsive grid ===== */
#page-home .game-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}
#page-home .game-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .7rem;
  padding: .8rem;
  border-radius: 14px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
#page-home .game-img-box {
  width: min(100%, 132px);
  height: auto;
  aspect-ratio: 222 / 300;
  margin: 0 auto;
  flex: 0 0 auto;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #fff7f4;
}
#page-home .game-img-box img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 12px;
}
#page-home .game-info {
  min-width: 0;
  text-align: center;
}
#page-home .game-info h3 {
  font-size: 1rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
#page-home .game-info p {
  font-size: .82rem;
  line-height: 1.35;
  min-height: 2.2em;
}
#page-home .game-install-btn {
  display: block;
  width: 100%;
  margin-top: auto;
  padding: .55rem .5rem;
  text-align: center;
  border-radius: 8px;
}
@media (max-width: 900px) {
  #page-home .game-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .85rem;
  }
}
@media (max-width: 600px) {
  #page-home .game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
  }
  #page-home .game-card {
    padding: .7rem;
    gap: .55rem;
  }
  #page-home .game-img-box {
    width: min(100%, 124px);
  }
  #page-home .game-info h3 {
    font-size: .96rem;
  }
  #page-home .game-info p {
    font-size: .78rem;
    min-height: 2.1em;
  }
  #page-home .game-install-btn {
    padding: .5rem .35rem;
    font-size: .82rem;
  }
}
@media (hover: hover) and (pointer: fine) {
  #page-home .game-card:hover {
    transform: translateY(-2px);
  }
}
@media (prefers-reduced-motion: reduce) {
  #page-home .game-card {
    transition: none;
  }
  #page-home .page-section.active {
    animation: none;
  }
}


/* TOC DROPDOWN FIX */
.toc-dropdown {
  width: 100%;
}

.toc-dropdown > summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.toc-dropdown > summary::-webkit-details-marker {
  display: none;
}

.toc-dropdown .toc-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.toc-dropdown[open] > .toc-content {
  max-height: 1500px;
}

.toc-icon {
  display: inline-block;
  transition: transform 0.3s ease;
}

.toc-dropdown[open] .toc-icon {
  transform: rotate(180deg);
}

/* FINAL TOC FIX */
#tocContent {
  display: none !important;
  max-height: none !important;
  overflow: visible !important;
}

#tocContent.open {
  display: block !important;
  max-height: none !important;
}

#tocButton {
  width: 100%;
  cursor: pointer;
}

#toc-icon {
  transition: transform 0.25s ease;
}

#tocButton[aria-expanded="true"] #toc-icon {
  transform: rotate(180deg);
}
