﻿@charset "UTF-8";

@import url('https://fonts.googleapis.com/css2?family=LINE+Seed+JP:wght@400;700;800&display=swap');

:root {
  --bg: #FAFAF8;
  --surface: #FFFFFF;
  --border: #E8E4DD;
  --border-light: #F0EDE8;
  --text: #1C1A18;
  --text-sub: #5C5852;
  --text-muted: #948F86;
  --accent: #E27B6E;

  --hit: #5A9E6E;       /* 一致 */
  --hit-bg: #EDF7F1;
  --close: #C99B2E;     /* 惜しい */
  --close-bg: #FDF8EC;
  --miss: #7A7570;      /* 不一致 */
  --miss-bg: #F2EFEB;

  --font: "LINE Seed JP", -apple-system, "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}

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

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ==========================================================================
   Header
   ========================================================================== */
.w-header {
  border-bottom: 1px solid var(--border);
  background: rgba(250, 250, 248, 0.96);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0.8rem 0;
}

.w-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 90%;
  max-width: 680px;
  margin: 0 auto;
}

.w-back {
  font-size: 0.84rem;
  color: var(--text-sub);
  transition: color 0.15s ease;
}
.w-back:hover { color: var(--text); }

.w-logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text);
}

.w-header-right {
  display: flex;
  gap: 0.5rem;
}

.w-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.w-icon-btn:hover { border-color: var(--text); color: var(--text); }

/* ==========================================================================
   Main
   ========================================================================== */
.w-main {
  width: 90%;
  max-width: 680px;
  margin: 0 auto;
  padding: 1.5rem 0 4rem;
  flex: 1;
}

.mode-badge-wrap {
  text-align: center;
  margin-bottom: 1.2rem;
}

.mode-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--miss-bg);
  color: var(--text-sub);
  border: 1px solid var(--border);
}

/* ==========================================================================
   入力エリア
   ========================================================================== */
.guess-input-area {
  display: flex;
  gap: 0.7rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.autocomplete-wrap {
  flex: 1;
  position: relative;
}

.guess-input {
  width: 100%;
  padding: 0.65rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease;
}
.guess-input:focus { border-color: var(--accent); }
.guess-input:disabled { opacity: 0.5; }

.autocomplete-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  z-index: 100;
  max-height: 220px;
  overflow-y: auto;
  display: none;
}
.autocomplete-list.open { display: block; }

.autocomplete-item {
  padding: 0.55rem 1rem;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover, .autocomplete-item.focused { background: var(--bg); }
.autocomplete-item .ac-vocal { font-size: 0.75rem; color: var(--text-muted); }

.guess-btn {
  padding: 0.65rem 1.3rem;
  font-size: 0.92rem;
  font-weight: 800;
  background: var(--text);
  color: #FFF;
  border-radius: 8px;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.guess-btn:hover:not(:disabled) { opacity: 0.85; }
.guess-btn:disabled { opacity: 0.35; cursor: default; }

/* ==========================================================================
   ヒントテーブル
   ========================================================================== */
.hint-table-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hint-row {
  display: grid;
  grid-template-columns: 1fr 80px 80px 80px 60px 60px;
  gap: 6px;
  align-items: center;
}

.hint-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 0.25rem;
}

.hint-cell-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.hint-cell-attr {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
}

/* 実際の推測行 */
.guess-row {
  display: grid;
  grid-template-columns: 1fr 80px 80px 80px 60px 60px;
  gap: 6px;
  align-items: stretch;
  animation: slideIn 0.25s ease-out;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.guess-name-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
}

.guess-name-text {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.guess-name-vocal {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.hint-cell {
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.3rem;
  text-align: center;
  gap: 2px;
  min-height: 56px;
}

.hint-cell.hit   { background: var(--hit-bg);   border: 1.5px solid var(--hit);   color: var(--hit); }
.hint-cell.close { background: var(--close-bg); border: 1.5px solid var(--close); color: var(--close); }
.hint-cell.miss  { background: var(--miss-bg);  border: 1.5px solid var(--miss);  color: var(--miss); }

.hint-cell-label { font-size: 0.88rem; font-weight: 800; }
.hint-cell-sub   { font-size: 0.7rem; opacity: 0.75; line-height: 1.2; }

/* 残り試行数 */
.remaining-wrap {
  text-align: center;
  margin-top: 1rem;
}

.remaining-text {
  font-size: 0.84rem;
  color: var(--text-muted);
  font-weight: 700;
}

/* プレイヤー */
.answer-player-wrap {
  margin-top: 1.5rem;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.video-aspect {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
}
.video-aspect iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

/* ==========================================================================
   モーダル
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(2px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.active { display: flex; }

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.8rem;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 10px 28px rgba(0,0,0,0.1);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 0.8rem; right: 1rem;
  font-size: 1.3rem;
  color: var(--text-muted);
}
.modal-close:hover { color: var(--text); }

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 1rem;
  text-align: center;
}

/* 遊び方 */
.howto-desc {
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 1.2rem;
  color: var(--text-sub);
  text-align: center;
}

.howto-attrs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
  padding: 0.8rem;
  background: var(--bg);
  border-radius: 6px;
}

.howto-attr-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.88rem;
}

.howto-attrs-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.howto-attr-item {
  font-size: 0.84rem;
  color: var(--text-sub);
  line-height: 1.6;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border-light);
}
.howto-attr-item:last-child { border-bottom: none; }

/* 結果モーダル */
.result-header {
  text-align: center;
  margin-bottom: 1.2rem;
}

.result-status {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.3rem;
}

.result-answer {
  font-size: 1rem;
  color: var(--text-sub);
}

.result-emoji-grid {
  font-family: monospace;
  font-size: 1.1rem;
  line-height: 1.8;
  text-align: center;
  background: var(--bg);
  border-radius: 6px;
  padding: 0.8rem;
  margin-bottom: 1.2rem;
  letter-spacing: 2px;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.btn-share {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem;
  font-size: 0.92rem;
  font-weight: 800;
  background: #000;
  color: #FFF;
  border-radius: 8px;
  transition: opacity 0.15s;
}
.btn-share:hover { opacity: 0.8; }

.btn-next {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem;
  font-size: 0.92rem;
  font-weight: 700;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.15s;
}
.btn-next:hover { background: var(--miss-bg); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

.footer-notice {
  margin-bottom: 0.5rem;
}

.footer-owner {
  margin-bottom: 0.4rem;
}

.footer-owner a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-owner a:hover {
  color: var(--accent);
}

.footer-copy {
  color: var(--text-tertiary);
  font-size: 0.76rem;
}


/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 580px) {
  .hint-row, .guess-row {
    grid-template-columns: 1fr 68px 68px 64px 50px 50px;
    gap: 4px;
  }
  .hint-cell-label { font-size: 0.8rem; }
  .hint-cell-sub { font-size: 0.65rem; }
  .guess-name-text { font-size: 0.82rem; }
  .guess-name-vocal { font-size: 0.65rem; }
  .hint-cell-attr, .hint-cell-title { font-size: 0.7rem; }
}
/* ==========================================================================
   Spotify Floating Player
   ========================================================================== */
.floating-spotify {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 320px; /* プレイヤーの横幅 */
  z-index: 1000; /* 他の要素より上に表示 */
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); /* 少し影をつけて浮かせた感を出す */
  border-radius: 12px;
}

/* スマホなど画面が小さい時の調整 */
@media (max-width: 768px) {
  .floating-spotify {
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%); /* スマホでは中央下部に配置 */
    width: calc(100% - 30px);
    max-width: 360px;
  }
}