/* ====== GLOBAL ====== */
/* ===== BACKGROUND EFFECT ===== */
body::before,
body::after {
  content: "";
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
    z-index: 5; /* ← 背景より上、UIより下 */
  mix-blend-mode: overlay; /* ← 色をなじませる */

}

/* ノイズ層（静的ザラつき） */
body::before {
  background:
    radial-gradient(circle at 50% 50%, rgba(255,140,0,0.06), transparent 70%),
    url("https://grainy-gradients.vercel.app/noise.svg");
  background-size: cover;
  opacity: 0.15;
  animation: flicker 8s infinite alternate ease-in-out;
}
.glitch-text {
  display: inline-block;
  animation: flickerText 1.5s infinite alternate;
}

@keyframes flickerText {
  0%   { opacity: 1; }
  45%  { opacity: 0.9; }
  50%  { opacity: 0.6; }
  55%  { opacity: 0.95; }
  60%  { opacity: 0.8; }
  100% { opacity: 1; }
}


/* スキャンライン層（動く光） */
body::after {
  background: repeating-linear-gradient(
    0deg,
    rgba(255,140,0,0.08) 0px,   /* オレンジ寄りの光 */
    rgba(255,140,0,0.08) 1px,
    transparent 2px,
    transparent 3px
  );
  animation: scan 5s linear infinite;
  opacity: 0.15;
}

/* ノイズがゆらめく */
@keyframes flicker {
  0%   { opacity: 0.1; filter: hue-rotate(0deg); }
  50%  { opacity: 0.25; filter: hue-rotate(30deg); }
  100% { opacity: 0.1; filter: hue-rotate(-30deg); }
}

/* スキャンラインが上下に流れる */
@keyframes scan {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

/* ===== BASIC ===== */
body {
  margin: 0;
  font-family: 'Noto Sans JP', sans-serif;
  background: #0a0a0a;
  color: #f5f5f5;
  scroll-behavior: smooth;
}

h1, h2 {
  font-family: 'Noto Serif JP', serif;
  letter-spacing: 2px;
}

section {
  padding: 80px 20px;
  text-align: center;
}

/* ====== HEADER ====== */
.header {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 40px;
  z-index: 1000;
}

.logo {
  font-family: 'Orbitron', sans-serif;
  font-size: 22px;
  color: #ff8c00;
  letter-spacing: 1px;
}

.nav ul {
  display: flex;
  list-style: none;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.nav a {
  color: #fff;
  text-decoration: none;
  transition: color 0.3s;
}
.nav a:hover {
  color: #ff8c00;
}

/* ====== INTRO ====== */
.intro {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center; /* ← 文字を中央寄せ */
  text-align: center;
  color: #fff;
  background: 
    linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), /* ← 画像の上に暗いフィルター */
    url("./picture/mine.png"); /* ← 画像パス */
  background-size: cover; /* ← 全画面にフィット */
  background-position: center;
  background-repeat: no-repeat;
}


.intro h1 {
  font-size: 36px;
  margin-bottom: 20px;
  color: #ff8c00;
}

/* ====== WORKS ====== */
.works {
  background: #111;
}
.tab {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}
.tab button {
  background: none;
  color: #fff;
  border: 1px solid #ff8c00;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.3s;
}
.tab button:hover {
  background: #ff8c00;
  color: #000;
}
.tab-content {
  display: none;
  margin-top: 20px;
}
.tab-content.active {
  display: block;
}

/* ====== NAME CHANGE ====== */
.namechange {
  background: #0d0d0d;
}
#nameInput {
  padding: 8px;
  border: none;
  border-radius: 4px;
}
.username {
  color: #ff8c00;
  font-weight: bold;
}

/* ====== CLAP ====== */
.clap {
  background: #111;
}
#clapButton {
  background: #ff8c00;
  color: #000;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  font-weight: bold;
}
#clapResult {
  margin-top: 20px;
  min-height: 60px;
}
/* ====== LINKS ====== */
.links {
  background: #0a0a0a;
  padding: 100px 20px;
  text-align: center;
  position: relative;
}

.links h2 {
  color: #ff8c00;
  font-size: 28px;
  letter-spacing: 2px;
  margin-bottom: 40px;
  position: relative;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 30px;
  max-width: 900px;
  margin: 0 auto;
}

.link-card {
  display: block;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,140,0,0.3);
  border-radius: 10px;
  padding: 25px;
  color: #fff;
  text-decoration: none;
  text-align: left;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.link-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255,140,0,0.2), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
}

.link-card:hover::before {
  opacity: 1;
}

.link-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 10px rgba(255,140,0,0.4);
  border-color: #ff8c00;
}

.link-code {
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  color: #ff8c00;
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.link-title {
  font-family: 'Noto Serif JP', serif;
  font-size: 20px;
  margin-bottom: 6px;
}

.link-desc {
  font-size: 14px;
  color: #ccc;
  line-height: 1.6;
}


/* ====== FOOTER ====== */
.footer {
  background: #000;
  color: #999;
  padding: 20px;
  font-size: 14px;
}

/* ===== モーダル ===== */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 3000;
  animation: fadeIn 0.3s ease;
}

.modal.active { display: flex; }

.modal-content {
  background: rgba(15, 15, 15, 0.95);
  border: 1px solid #ff8c00;
  padding: 30px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 0 20px rgba(255,140,0,0.3);
  color: #fff;
  width: 280px;
  animation: pop 0.4s ease;
}

.modal-content h3 {
  color: #ff8c00;
  margin-bottom: 10px;
}

.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.modal-buttons button {
  background: #ff8c00;
  color: #000;
  border: none;
  padding: 8px 20px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s;
}
.modal-buttons button:hover {
  background: #ffb347;
}


@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes pop {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
/* ===== 小説モーダル ===== */
.novel-modal {
  width: 80%;
  max-width: 700px;
  max-height: 80vh;
  overflow-y: auto;
  background: rgba(15, 15, 15, 0.95);
  border: 1px solid #ff8c00;
  border-radius: 10px;
  box-shadow: 0 0 30px rgba(255,140,0,0.3);
  color: #f5f5f5;
  padding: 30px 25px 50px;
  line-height: 1.8;
  position: relative;
  animation: modalPop 0.4s ease;
  transform-origin: center;
}

.novel-modal h3 {
  color: #ff8c00;
  font-size: 20px;
  margin-bottom: 15px;
  text-align: center;
  letter-spacing: 1px;
}

.novel-body p {
  text-align: left;
  margin-bottom: 1em;
}

.modal-close {
  position: absolute;
  right: 20px;
  bottom: 15px;
  background: transparent;
  border: 1px solid #ff8c00;
  color: #ff8c00;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}
.modal-close:hover {
  background: #ff8c00;
  color: #000;
}

/* スクロールバーもカスタム */
.novel-body::-webkit-scrollbar {
  width: 6px;
}
.novel-body::-webkit-scrollbar-thumb {
  background: #ff8c00;
  border-radius: 3px;
}


/* モーダル中は背景スクロールを止める */
body.modal-open {
  overflow: hidden;
}
/* ====== READ BUTTON ====== */
.read-btn {
  display: inline-block;
  padding: 12px 28px;
  margin-top: 20px;
  background: transparent;
  border: 1px solid #ff8c00;
  color: #ff8c00;
  font-family: 'Orbitron', sans-serif;
  font-size: 15px;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  transition: all 0.25s ease;
  overflow: hidden;
}

.read-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255,140,0,0.2), transparent, rgba(255,140,0,0.2));
  transform: translateX(-100%);
  transition: transform 0.4s ease;
}

.read-btn:hover::before {
  transform: translateX(100%);
}

.read-btn:hover {
  background: rgba(255,140,0,0.1);
  box-shadow: 0 0 12px rgba(255,140,0,0.5);
  color: #fff;
  transform: scale(1.03);
}

.read-btn:active {
  background: #ff8c00;
  color: #000;
  transform: scale(0.97);
  box-shadow: 0 0 20px rgba(255,140,0,0.7);
}
/* Novel navigation (added) */
.novel-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}
.modal-nav {
  background: transparent;
  border: 1px solid #ff8c00;
  color: #ff8c00;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}
.modal-nav:disabled {
  opacity: 0.5;
  cursor: default;
}
.modal-nav:hover:not(:disabled) {
  background: #ff8c00;
  color: #000;
}
