/* ==========================================================================
   《三國觀滄海》官方網站 － 首頁重製版
   ========================================================================== */

:root{
  --ink-900:#141210;
  --ink-800:#211d19;
  --ink-700:#2f2a24;
  --gold-300:#e8cf9a;
  --gold-400:#d8b876;
  --gold-500:#c9a15a;
  --gold-700:#8a6a34;
  --red-600:#8c2427;
  --red-700:#6f1a1d;
  --paper-100:#f6f1e4;
  --paper-200:#efe7d2;
  --muted:#a1a1a7;
  --vh: 1vh;

  --fs-root: clamp(13px, 1.05vw, 17px);
}

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

html,body{
  width:100%;
  height:100%;
  overflow-x:hidden;
  -webkit-text-size-adjust:100%;
}

body{
  font-family:"Noto Serif TC", "PingFang TC", "Microsoft JhengHei", serif;
  background:var(--ink-900);
  color:var(--paper-100);
  line-height:1.5;
}

img{ display:block; max-width:100%; -webkit-user-drag:none; user-select:none; }
a{ text-decoration:none; color:inherit; }
button{ font-family:inherit; border:none; background:none; cursor:pointer; color:inherit; }
ul,li{ list-style:none; }

.site{ position:relative; width:100%; height:100%; }

/* ==========================================================================
   捲動容器 / 分頁
   ========================================================================== */

.panels{
  position:relative;
  width:100%;
  height:100vh;
  height:calc(var(--vh, 1vh) * 100);
  overflow-y:scroll;
  overflow-x:hidden;
  scroll-snap-type:y mandatory;
  scroll-behavior:smooth;
}

.panel{
  position:relative;
  width:100%;
  height:100vh;
  height:calc(var(--vh, 1vh) * 100);
  scroll-snap-align:start;
  scroll-snap-stop:always;
  background-repeat:no-repeat;
  background-position:center center;
  background-size:cover;
  overflow:hidden;
}

.dots{
  position:fixed;
  right:clamp(10px, 1.8vw, 26px);
  top:50%;
  transform:translateY(-50%);
  z-index:40;
  display:flex;
  flex-direction:column;
  gap:14px;
}

.dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:rgba(246,241,228,.35);
  border:1px solid rgba(246,241,228,.5);
  cursor:pointer;
  transition:background .25s, transform .25s;
}
.dot.active{ background:var(--gold-400); transform:scale(1.3); }

/* ==========================================================================
   右上角社群列
   ========================================================================== */

.social-bar{
  position:fixed;
  top:clamp(10px,2vh,22px);
  right:clamp(52px,6vw,84px);
  z-index:50;
  display:flex;
  align-items:center;
}

.social-toggle{
  width:34px; height:34px;
  display:flex; align-items:center; justify-content:center;
}
.social-toggle img{ width:100%; height:100%; object-fit:contain; }

.social-list{
  display:flex;
  align-items:center;
  gap:14px;
  margin-right:12px;
  padding:6px 16px;
  border-radius:999px;
  background:rgba(20,18,16,.55);
  backdrop-filter:blur(4px);
  transform:translateX(12px);
  opacity:0;
  pointer-events:none;
  transition:opacity .25s ease, transform .25s ease;
}
.social-bar.open .social-list{ opacity:1; pointer-events:auto; transform:translateX(0); }

.social-item{
  width:20px; height:20px;
  background-repeat:no-repeat;
  background-position:center;
  background-size:contain;
  flex-shrink:0;
  transition:filter .2s, transform .2s;
}
.social-item:hover{ transform:translateY(-2px); filter:brightness(1.3); }

/* ==========================================================================
   右側可展開選單
   ========================================================================== */

.side-menu{
  position:fixed;
  right:clamp(6px,1vw,14px);
  top:50%;
  transform:translateY(-50%);
  z-index:45;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:10px;
  padding:14px 8px;
}

.side-menu-item{
  font-size:13px;
  letter-spacing:.1em;
  color:var(--paper-100);
  writing-mode:vertical-rl;
  padding:10px 5px;
  border-radius:999px;
  background:rgba(20,18,16,0);
  opacity:0;
  max-height:0;
  overflow:hidden;
  transform:translateX(10px);
  transition:opacity .25s ease, transform .25s ease, background .2s;
  pointer-events:none;
}
.side-menu.open .side-menu-item{
  opacity:1;
  max-height:140px;
  transform:translateX(0);
  pointer-events:auto;
  background:rgba(20,18,16,.5);
}
.side-menu-item:hover,
.side-menu-item.active{ color:var(--gold-300); background:rgba(140,36,39,.55); }

.side-menu-toggle{
  width:40px; height:40px;
  border-radius:50%;
  background:var(--ink-800) url('../assets/img/menu-btn.png') center/60% no-repeat, radial-gradient(circle, var(--gold-700), var(--ink-800));
  border:1px solid rgba(232,207,154,.4);
}
.side-menu-toggle:hover{ filter:brightness(1.15); }

/* ==========================================================================
   第一屏：首頁視覺
   ========================================================================== */

.panel-hero{ display:flex; }

.hero-age{
  position:absolute;
  left:clamp(14px,2vw,28px);
  bottom:clamp(70px,14vh,140px);
  width:clamp(34px,3.6vw,52px);
  z-index:3;
}

.hero-logo{
  position:absolute;
  left:clamp(14px,2vw,28px);
  top:clamp(14px,2.5vh,26px);
  width:clamp(120px,11vw,168px);
  z-index:3;
}

.hero-bottom{
  position:absolute;
  left:0; right:0; bottom:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  padding-bottom:clamp(14px,3vh,34px);
  z-index:2;
}

.hero-title{
  margin-bottom:clamp(6px,1.4vh,16px);
  text-align:center;
  line-height:0;
}
.hero-title img{
  width:clamp(300px, 44vw, 640px);
  max-width:88vw;
  height:auto;
  margin:0 auto;
}

.play-btn{
  position:relative;
  width:clamp(52px,5.2vw,72px);
  height:clamp(52px,5.2vw,72px);
  margin-bottom:clamp(10px,2vh,22px);
  background-image:url('../assets/img/play-seal.png');
  background-size:contain;
  background-repeat:no-repeat;
  background-position:center;
  animation:btnPulse 4s infinite;
}
.play-ring{
  position:absolute; inset:0; width:100%; height:100%;
  animation:spin 5s linear infinite;
}
.play-icon{
  position:absolute; left:50%; top:50%;
  width:38%;
  transform:translate(-50%,-52%);
  filter:brightness(0) invert(1);
}
@keyframes btnPulse{ 0%,100%{transform:scale(1);} 50%{transform:scale(1.08);} }
@keyframes spin{ from{transform:rotate(0deg);} to{transform:rotate(360deg);} }

.download-row{
  display:flex;
  align-items:center;
  gap:clamp(8px,1.2vw,18px);
  margin-bottom:clamp(8px,1.6vh,16px);
}

.dl-btn{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  width:clamp(108px,9.4vw,150px);
  height:clamp(50px,4.4vh,68px);
  border-radius:6px;
  border:1px solid var(--gold-500);
  background:linear-gradient(160deg,#3c3626,#221f18);
  color:var(--gold-300);
  font-size:clamp(13px,1.1vw,17px);
  letter-spacing:.05em;
  text-align:center;
  transition:transform .2s, filter .2s;
}
.dl-btn:hover{ transform:translateY(-3px); filter:brightness(1.12); }
.dl-btn .dl-icon{ font-size:1.15em; line-height:1; }
.dl-pay{ background:linear-gradient(160deg,#274442,#152b29); border-color:#6fa39c; color:#dff0ec; }

.dl-mid{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.dl-btn-small{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  width:clamp(100px,8.2vw,132px);
  height:clamp(24px,2.4vh,34px);
  border-radius:4px;
  border:1px solid var(--gold-500);
  background:linear-gradient(160deg,var(--red-600),var(--red-700));
  color:var(--gold-300);
  font-size:clamp(10px,.85vw,13px);
  white-space:nowrap;
  transition:transform .2s, filter .2s;
}
.dl-btn-small:hover{ transform:translateY(-2px); filter:brightness(1.12); }
.dl-btn-small.dl-ios{ background:linear-gradient(160deg,#3c3020,var(--ink-800)); }

.hero-tagline{
  font-size:clamp(11px,1vw,14px);
  letter-spacing:.15em;
  color:var(--red-600);
  background:var(--paper-100);
  padding:4px 18px;
  border-radius:999px;
  margin-bottom:clamp(10px,2vh,18px);
}

.hero-next{
  width:clamp(120px,11vw,180px);
  animation:floatY 2s infinite;
  opacity:.9;
}
@keyframes floatY{ 0%,100%{transform:translateY(0);} 50%{transform:translateY(-6px);} }

/* ==========================================================================
   第二屏：角色檔案
   ========================================================================== */

.panel-role{ display:flex; align-items:center; justify-content:center; }

.role-deco-left{
  position:absolute; left:0; bottom:0;
  width:100%; height:100%;
  object-fit:cover;
  object-position:left bottom;
  pointer-events:none;
  opacity:.9;
}
.role-deco-footer{
  position:absolute; right:0; bottom:0;
  width:clamp(140px,16vw,220px);
  z-index:2;
}

.role-stage{
  position:relative;
  z-index:3;
  width:min(1500px,96vw);
  height:100%;
  display:flex;
  align-items:flex-end;
  justify-content:flex-end;
}

/* 完整立繪：絕對定位，於左側滑入 */
.role-portrait-layer{
  position:absolute;
  left:0; bottom:0;
  width:60%;
  height:100%;
  pointer-events:none;
  z-index:2;
}
.role-portrait{
  position:absolute;
  left:0; bottom:0;
  max-height:96%;
  max-width:100%;
  width:auto;
  opacity:0;
  transform:translateX(-60px);
  transition:opacity .8s ease, transform .8s ease;
  filter:drop-shadow(0 20px 30px rgba(0,0,0,.45));
}
.role-portrait.active{ opacity:1; transform:translateX(0); }

/* 姓名 + 簡介：左上方 */
.role-info-layer{
  position:absolute;
  left:clamp(20px,4vw,80px);
  top:clamp(30px,8vh,90px);
  width:clamp(240px,30vw,420px);
  z-index:4;
  pointer-events:none;
}
.role-info-panel{
  display:none;
  background:linear-gradient(160deg, rgba(20,18,16,.72), rgba(20,18,16,.32));
  border:1px solid rgba(232,207,154,.32);
  border-radius:10px;
  padding:clamp(16px,1.8vw,28px);
}
.role-info-panel.active{ display:block; animation:fadeUp .8s ease .2s both; }
@keyframes fadeUp{ from{opacity:0; transform:translateY(16px);} to{opacity:1; transform:translateY(0);} }

.role-name{
  font-family:"LXGW WenKai TC","DFKai-SB","BiauKai","Kaiti TC","標楷體",serif;
  font-weight:400;
  font-size:clamp(30px,2.8vw,46px);
  color:var(--gold-300);
  margin-bottom:8px;
}
.role-tagline{
  font-size:clamp(12px,1vw,15px);
  color:var(--gold-400);
  border-left:3px solid var(--red-600);
  padding-left:10px;
  margin-bottom:14px;
  line-height:1.7;
}
.role-desc{
  font-size:clamp(12px,.95vw,14px);
  color:var(--paper-200);
  line-height:1.9;
  text-align:justify;
}

/* 五位角色豎條：全部顯示，橫向並排於右側 */
.role-strip-list{
  position:relative;
  z-index:5;
  display:flex;
  align-items:flex-end;
  height:82%;
  gap:0;
  padding-right:clamp(8px,2vw,40px);
}
.role-strip{
  position:relative;
  height:100%;
  aspect-ratio:622 / 3094;
  flex:0 0 auto;
  padding:0;
  overflow:hidden;
  transition:transform .3s ease, filter .3s ease;
}
.role-strip::after{
  content:"";
  position:absolute;
  right:0; top:8%;
  width:1px; height:84%;
  background:linear-gradient(180deg, transparent, rgba(232,207,154,.5), transparent);
}
.role-strip:last-child::after{ display:none; }
.role-strip img{
  height:100%;
  width:100%;
  object-fit:cover;
  object-position:top center;
  filter:grayscale(1) brightness(.82);
  transition:filter .4s ease, transform .4s ease;
}
.role-strip:hover,
.role-strip.active{ transform:translateY(-1%); }
.role-strip:hover img,
.role-strip.active img{ filter:grayscale(0) brightness(1); transform:scale(1.04); }

/* ==========================================================================
   第三屏：遊戲特色
   ========================================================================== */

.panel-feature{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:clamp(14px,3vh,34px); }
.panel-feature::before{
  content:"";
  position:absolute; inset:0;
  background:rgba(10,9,8,.35);
}

.feature-title{
  position:relative;
  z-index:2;
  text-align:center;
  color:var(--paper-100);
}
.feature-title-pinyin{
  display:block;
  font-family:sans-serif;
  font-size:clamp(10px,.9vw,13px);
  letter-spacing:.3em;
  color:var(--muted);
  margin-bottom:6px;
}
.feature-title h2{
  font-family:"LXGW WenKai TC","DFKai-SB","BiauKai","Kaiti TC","標楷體",serif;
  font-weight:400;
  font-size:clamp(30px,3.6vw,54px);
  letter-spacing:.08em;
}

.coverflow{
  position:relative;
  z-index:2;
  width:100%;
  max-width:1200px;
  height:min(52vh,420px);
  display:flex;
  align-items:center;
  justify-content:center;
}

.cf-track{
  position:relative;
  width:100%;
  height:100%;
  perspective:1400px;
}

.cf-slide{
  position:absolute;
  left:50%; top:50%;
  width:min(58vw,640px);
  aspect-ratio:16/9;
  transform:translate(-50%,-50%);
  transition:transform .5s ease, opacity .5s ease, z-index .5s;
  border-radius:8px;
  overflow:hidden;
  box-shadow:0 20px 50px rgba(0,0,0,.5);
}
.cf-slide img.cf-mask{ position:absolute; inset:0; width:100%; height:100%; object-fit:fill; pointer-events:none; }
.cf-slide img:first-child{ width:100%; height:100%; object-fit:cover; }

.cf-arrow{
  position:relative;
  z-index:3;
  width:clamp(32px,3vw,46px);
  height:clamp(32px,3vw,46px);
  border-radius:50%;
  border:1px solid var(--gold-500);
  background:rgba(20,18,16,.55);
  color:var(--gold-300);
  flex-shrink:0;
  display:flex;
  align-items:center;
  justify-content:center;
}
.cf-arrow::before{ content:""; width:9px; height:9px; border-top:2px solid currentColor; border-right:2px solid currentColor; }
.cf-arrow-left{ margin-right:clamp(8px,2vw,28px); }
.cf-arrow-left::before{ transform:rotate(-135deg) translate(1px,-1px); }
.cf-arrow-right{ margin-left:clamp(8px,2vw,28px); }
.cf-arrow-right::before{ transform:rotate(45deg); }
.cf-arrow:hover{ background:var(--red-600); color:var(--paper-100); }

/* ==========================================================================
   第四屏：頁尾
   ========================================================================== */

.panel-footer{
  background:var(--ink-900);
  display:flex;
  align-items:center;
  justify-content:center;
}

.beian{
  width:min(1000px,90vw);
  color:var(--muted);
  text-align:center;
  font-size:clamp(11px,.9vw,13px);
  line-height:1.7;
}
.beian-links{ margin-bottom:16px; }
.beian-links a:hover{ color:var(--gold-400); }
.beian-sep{ margin:0 10px; }

.beian-notify{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:clamp(14px,3vw,32px);
  flex-wrap:wrap;
}
.beian-icon img{ height:44px; width:auto; }
.beian-contact a:hover{ color:var(--gold-400); }
.beian-warning p{ text-align:left; white-space:normal; }

/* ==========================================================================
   預告片彈窗
   ========================================================================== */

.video-modal{
  position:fixed; inset:0;
  z-index:200;
  background:rgba(0,0,0,.85);
  display:none;
  align-items:center;
  justify-content:center;
  padding:20px;
}
.video-modal.open{ display:flex; }
.video-modal-inner{
  position:relative;
  width:min(920px,94vw);
  aspect-ratio:16/9;
  background:#000;
  border-radius:8px;
  overflow:hidden;
  box-shadow:0 20px 60px rgba(0,0,0,.6);
}
.video-frame{ width:100%; height:100%; }
.video-frame iframe{ width:100%; height:100%; border:0; }
.video-close{
  position:absolute;
  top:-38px; right:0;
  color:var(--paper-100);
  font-size:22px;
  z-index:2;
}

/* ==========================================================================
   響應式：平板
   ========================================================================== */

@media (max-width: 1023px){
  .role-stage{ height:78%; gap:14px; }
  .role-info{ width:clamp(200px,32vw,300px); }
  .coverflow{ height:min(42vh,360px); }
  .cf-slide{ width:min(70vw,560px); }
}

/* ==========================================================================
   響應式：手機
   ========================================================================== */

@media (max-width: 767px){
  .social-bar{ right:56px; top:10px; }
  .social-toggle{ width:26px; height:26px; }
  .side-menu{ right:2px; gap:8px; }
  .side-menu-item{ font-size:11px; }
  .side-menu-toggle{ width:34px; height:34px; }

  .hero-logo{ width:96px; top:12px; left:12px; }
  .hero-age{ width:30px; bottom:auto; top:52px; left:12px; }
  .hero-title img{
    width:min(76vw,360px);
  }
  .hero-bottom{ padding:0 10px 16px; width:100%; }
  .download-row{
    flex-wrap:wrap;
    justify-content:center;
    gap:8px;
    width:100%;
    max-width:340px;
  }
  .dl-btn{ flex:1 1 46%; width:auto; padding:0 10px; height:46px; }
  .dl-mid{ flex:1 1 100%; order:3; flex-direction:row; justify-content:center; gap:8px; }
  .dl-btn-small{ flex:1 1 46%; width:auto; padding:0 8px; height:30px; }

  /* 角色屏：手機改為上下結構 —— 立繪+簡介在上，豎條列在下 */
  .role-stage{
    flex-direction:column;
    height:94%;
    width:100vw;
    align-items:stretch;
    justify-content:flex-start;
    padding-top:8px;
  }
  .role-portrait-layer{
    position:absolute;
    left:0; right:0; bottom:auto; top:0;
    width:100%; height:50%;
    z-index:2;
  }
  .role-portrait{
    left:50%;
    bottom:0;
    transform:translateX(calc(-50% - 40px));
    max-height:100%;
  }
  .role-portrait.active{ transform:translateX(-50%); }

  .role-info-layer{
    position:absolute;
    left:10px; right:10px; top:auto; bottom:calc(24% + 10px);
    width:auto;
    z-index:4;
  }
  .role-info-panel{ padding:12px 14px; }
  .role-name{ font-size:26px; }
  .role-desc{ font-size:12px; }

  .role-strip-list{
    position:absolute;
    left:0; right:0; bottom:0;
    height:23%;
    justify-content:center;
    align-items:flex-end;
    gap:4px;
    padding:0 8px 8px;
    z-index:5;
  }
  .role-strip{ height:100%; }
  .role-strip::after{ display:none; }
  .role-strip img{
    object-position:top center;
    border:1px solid rgba(232,207,154,.25);
    border-radius:4px;
  }
  .role-strip.active img{ border-color:var(--gold-400); }
  .role-deco-footer{ display:none; }

  .feature-title h2{ font-size:clamp(26px,8vw,38px); }
  .coverflow{ height:min(30vh,240px); }
  .cf-slide{ width:78vw; }
  .cf-arrow{ display:none; }

  .beian-notify{ flex-direction:column; gap:10px; }
  .beian-warning p{ text-align:center; }
}
