/* サイト全体の見た目。色はここの変数を変えると全ページに反映される。
   基調はオレンジ（#FF8C00）と白。 */
:root {
  --bg: #ffffff;
  --bg-soft: #fff6ea;                    /* うすいオレンジの地（カードなど） */
  --line: #ffd9a8;                       /* うすいオレンジの線 */
  --text: #3a2a18;                       /* 文字（こげ茶。白地で読みやすい濃さ） */
  --text-dim: #8a745c;
  --accent: #ff8c00;
  --accent-dark: #e67e00;                /* マウスを乗せたとき */
  --on-accent: #ffffff;
  --warn: #e0344f;                       /* R18 の印 */
  --shadow: rgba(0, 0, 0, 0.14);         /* マウスを乗せたときの影（薄いグレー） */
}

/* 暗い表示（ダークモード）の色。地と文字を入れ替え、オレンジは鮮やかさを落とす。 */
:root[data-theme="dark"] {
  --bg: #1a1612;
  --bg-soft: #262019;
  --line: #4d3b25;
  --text: #f6eee4;
  --text-dim: #b9a892;
  --accent: #d48e35;                     /* 暗い地ではまぶしいので、オレンジの鮮やかさを落とす（元は #ff8c00） */
  --accent-dark: #e2a558;                /* 暗い地では、マウスを乗せたとき明るくする */
  --warn: #ff6b82;
  --shadow: rgba(0, 0, 0, 0.45);         /* 暗い地では、薄い影は見えないので濃くする */
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* 縦のスクロールバーの場所をいつも空けておく。ページが短くなってバーが消えても、中身が横にずれない。 */
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.8;
}

a {
  color: inherit;
}

.wrap {
  width: min(960px, 100% - 32px);
  margin-inline: auto;
}

/* 上のメニュー（オレンジの帯に白い文字） */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--accent);
  color: var(--on-accent);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  min-height: 56px;
}

.site-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-decoration: none;
}

.site-name img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  display: block;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: 14px;
  font-weight: 800;
}

.site-nav a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
}

.site-nav a:hover {
  color: #fff;
}

/* 明るい表示・暗い表示の切り替えボタン（上のバーの右端） */
.theme-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(15deg);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 明るい表示のときは月（押すと暗くなる）、暗い表示のときは太陽（押すと明るくなる）を出す */
.theme-toggle .icon-sun,
:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

/* 最初に見える部分 */
.hero {
  padding: 72px 0 8px;                   /* 下は詰める（すぐ下の欄の上の余白と合わせて、すき間は48になる） */
}

.hero .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;               /* 名前の上端をアイコンの上端にそろえる（名義を入れ替えても位置が動かないように） */
  gap: 8px 28px;
}

/* アイコンは四角（角を少しだけ丸める）にして、名前の左に置く。上端を名前にそろえる */
.hero-icon {
  width: 148px;
  height: 148px;
  align-self: flex-start;
  border-radius: 14px;
  background: #fff;
  object-fit: cover;
  flex: none;
}

@media (max-width: 640px) {
  .hero-icon {
    width: 104px;
    height: 104px;
  }
}
/* アイコンと名前の下に、横幅いっぱいの行として置く（左端はアイコンの左端とそろう） */
.hero-links {
  flex-basis: 100%;
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 7vw, 58px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--accent);
}

.hero-kana {
  margin: 2px 0 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--text);
}

/* 名前の下の文字を押すと、もう一方の名義の表示に入れ替わる。ふだんは普通の文字に見せ、乗せたときだけ色を変える */
.hero-switch {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
}

/* 名義を入れ替えるときの動き。
   消えるとき：全体が少し沈みながら薄くなる。出るとき：アイコンがぽんと弾み、文字とリンクが順に浮かび上がる。 */
body.persona-leaving main,
body.persona-leaving .site-nav {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

body.persona-entering main > * {
  animation: persona-rise 0.38s ease both;
}

body.persona-entering .hero-icon {
  animation: persona-pop 0.38s cubic-bezier(0.3, 1.5, 0.5, 1) both;
}

body.persona-entering .hero-links {
  animation: persona-rise 0.38s ease 0.06s both;
}

body.persona-entering .site-nav {
  animation: persona-fade 0.38s ease both;
}

@keyframes persona-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes persona-pop {
  from {
    opacity: 0;
    transform: scale(0.8) rotate(-6deg);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes persona-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}
/* 名義の入れ替え：選ばれていないほうの名義の部分は隠す */
body[data-persona-now="main"] [data-persona="alt"],
body[data-persona-now="alt"] [data-persona="main"] {
  display: none;
}

.hero-switch:hover {
  color: var(--accent);
}

.hero p {
  margin: 0;
  max-width: 34em;
  color: var(--text-dim);
}

section {
  padding: 56px 0;
}

/* 別名義（グーグー）の表示は、下に欄が続かないので、プロフィールの下の余白を残しておく */
.hero[data-persona="alt"] {
  padding-bottom: 64px;
}

/* プロフィールのすぐ下の欄は、上の余白を少し詰める */
#gallery {
  padding-top: 40px;
}

h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 24px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--accent);
}

/* 見出しの右に、うすい線を引く */
h2::after {
  content: "";
  flex: 1;
  height: 2px;
  background: var(--line);
}

/* ABOUT の欄：使用ツールの見出しと一覧 */
#about p {
  margin: 0;
}

.about-head {
  margin: 24px 0 8px;
  padding-left: 10px;
  border-left: 4px solid var(--accent);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.4;
}

.about-tools {
  border-collapse: collapse;
}

.about-tools th,
.about-tools td {
  padding: 6px 16px 6px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.about-tools th {
  padding-right: 28px;
  font-weight: 800;
  white-space: nowrap;
  color: var(--accent);
}
/* 作品の一覧 */
.works {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.work {
  display: block;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  overflow: hidden;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

a.work:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--shadow);
}

.work-thumb {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  background: var(--bg-soft);
  color: var(--text-dim);
  font-size: 13px;
}

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

/* ILLUSTRATION & ANIMATION の欄：くり返し再生する動画だけを、すき間なく収まるように並べる。
   左の列に横長を2本重ね、右の列に縦長を1本。列の幅を 3:2 にすると、左右の高さがほぼそろう
   （わずかな差は、動画の端を少し切って合わせる）。 */
.loops {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 14px;
}

.loop {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-soft);
  aspect-ratio: 5 / 3;
  transition: transform 0.2s, box-shadow 0.2s;
}

.loop:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--shadow);
}

.loop.tall {
  grid-column: 2;
  grid-row: 1 / span 2;
  aspect-ratio: auto;
}

.loop video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* せまい画面では1列にして、それぞれ元の形のまま見せる */
@media (max-width: 640px) {
  .loops {
    grid-template-columns: 1fr;
  }

  .loop.tall {
    grid-column: auto;
    grid-row: auto;
    aspect-ratio: 9 / 16;
    width: min(100%, 320px);
    margin-inline: auto;
  }
}
/* くり返し再生する動画。縦長でも横長でも、切り取らずに全体を枠の中に収める */
.work-loop {
  aspect-ratio: 4 / 3;
}

.work-loop video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* 縦長の絵を横長の枠に入れるとき、上のほう（顔のあたり）を見せる */
.work-thumb img.top {
  object-position: center 12%;
}

/* 動画のサムネイル：横長（16:9）にして、真ん中に再生のマークを重ねる */
.work-video {
  position: relative;
  aspect-ratio: 16 / 9;
}

.work-video::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M9 7v10l8-5z'/%3E%3C/svg%3E") center / 30px no-repeat;
  opacity: 0.92;
}

.work-body {
  padding: 14px 16px 16px;
}

.work-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 800;
}

.work-text {
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
}

/* 再生数など、説明の下に小さく出す数字 */
.work-meta {
  margin: 2px 0 0;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
}

.tag {
  display: inline-block;
  margin-bottom: 8px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.tag-r18 {
  background: var(--warn);
}

/* リンク・ボタン */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

/* リンクの行の上に付ける、小さな見出し（LINKS / CONTACT） */
.link-label {
  margin: 16px 0 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--accent);
}

/* 名前の下に並べる、外部リンク（サービスのマーク＋名前） */
.link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 18px 7px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}

.link:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: none;
}

/* 線で描いたマーク（塗らない） */
.link svg.stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.button {
  display: inline-block;
  padding: 10px 28px;
  border: 2px solid var(--accent);
  border-radius: 999px;
  background: var(--bg);
  color: var(--accent);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.button:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.button-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.button-primary:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

.site-footer {
  padding: 28px 0 40px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 12px;
  font-weight: 800;
}

/* 年齢確認のページ。いつも暗い地で、枠は作らず、文字とボタンだけを真ん中に置く。 */
.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background: #121010;
  color: #f6eee4;
}

.gate-box {
  width: min(520px, 100%);
  text-align: center;
}

.gate-box h1 {
  margin: 0 0 16px;
  font-size: 24px;
  font-weight: 800;
}

.gate-box p {
  margin: 0 0 12px;
  color: rgba(246, 238, 228, 0.72);
  font-size: 14px;
}

.gate-mark {
  display: inline-block;
  margin-bottom: 18px;
  padding: 2px 14px;
  border: 2px solid #ff6b82;
  border-radius: 8px;
  color: #ff6b82;
  font-weight: 800;
  letter-spacing: 0.1em;
}

/* 暗い地に合わせたボタン（「いいえ」は、ふちだけ） */
.gate .button {
  border-color: var(--accent);
  background: transparent;
  color: var(--accent);
}

.gate .button:hover,
.gate .button-primary {
  background: var(--accent);
  color: #fff;
}

.gate .button-primary:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}
.gate-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.note {
  margin-top: 20px;
  padding: 0;
  list-style: none;
  text-align: left;
  font-size: 13px;
  color: var(--text-dim);
}

.note li {
  padding-left: 1em;
  text-indent: -1em;
}

.note li::before {
  content: "・";
}

/* ゲームのページ：ゲームは全画面にせず、ページの中に枠で置く。 */
.game-section {
  padding: 10px 0 32px;
}

.game-title {
  margin: 0 0 16px;
  font-size: clamp(20px, 4vw, 28px);
  font-weight: 800;
  text-align: center;
}

/* ゲームの枠は、横も縦も画面いっぱいに広げる（ページのほかの部分より広く、画面の端近くまで使う）。
   ゲームの絵は縦長なので、左右の余ったところはゲーム側が黒く塗る。 */
.game-section .wrap {
  width: calc(100% - 20px);
}

.game-frame {
  position: relative;
  width: 100%;
  height: calc(100vh - 76px);            /* 画面の高さいっぱい（上のバー56＋上下のすき間20を引いたぶん） */
  min-height: 480px;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
}
.game-frame canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
  outline: none;
}

.game-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #000;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-align: center;
}

.game-bar {
  width: min(240px, 60vw);
  height: 12px;
  margin-top: 12px;
  padding: 1px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 4px;
}

.game-bar-fill {
  width: 0;
  height: 100%;
  border-radius: 2px;
  background: #fff;
}

.game-error {
  margin-top: 12px;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--warn);
  color: #fff;
  font-size: 13px;
  text-align: center;
}

.game-actions {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.button:disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

/* ゲームの下の説明書（readme）と操作方法 */
.readme {
  max-width: 760px;
  font-size: 14px;
}

.readme h2 {
  margin-top: 40px;
}

.readme h2:first-child {
  margin-top: 0;
}

.readme h3 {
  margin: 26px 0 8px;
  padding-left: 10px;
  border-left: 4px solid var(--accent);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.4;
}

.readme-note {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.readme a {
  color: var(--accent);
  font-weight: 800;
}

.readme ul {
  margin: 0;
  padding-left: 1.4em;
}

.readme table {
  width: 100%;
  border-collapse: collapse;
}

.readme th,
.readme td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.readme th {
  width: 12em;
  font-weight: 800;
  white-space: nowrap;
  color: var(--accent);
}

@media (max-width: 640px) {
  .readme th {
    width: auto;
    white-space: normal;
  }
}
[hidden] {
  display: none !important;
}
