/* ===== NGワード - Styles ===== */
:root {
  --game-accent: #FBE9A0;
}

body { overflow-x: hidden; }

/* --- Top Bar --- */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5rem 1rem;
  background: var(--surface);
  border-bottom: 3px solid var(--color-coral);
  box-shadow: var(--shadow-sm);
}
.top-bar .title { font-size: .85rem; font-weight: 600; color: var(--text-muted); }
.top-bar .title a { color: var(--text-muted); transition: color .2s; }
.top-bar .title a:hover { color: #d4c070; }
.top-bar .title span { color: var(--text); font-weight: 900; }
.top-bar-actions { display: flex; gap: .4rem; align-items: center; }
.icon-btn {
  background: var(--surface2); border: 2px solid var(--surface2);
  color: var(--text-muted); width: 30px; height: 30px; border-radius: 50%;
  font-size: .8rem; cursor: pointer; display: flex; align-items: center;
  justify-content: center; font-family: inherit; font-weight: 700;
  transition: border-color .2s, color .2s;
}
.icon-btn:hover { border-color: var(--game-accent); color: #5A3A3A; }

/* --- Game Page --- */
.game-page {
  max-width: 600px; margin: 0 auto; padding: .5rem .75rem;
  display: flex; flex-direction: column; gap: .6rem;
  min-height: calc(100vh - 48px);
}

/* --- Setup --- */
.setup-section {
  background: var(--surface); border-radius: var(--radius);
  padding: 1rem; box-shadow: var(--shadow);
}
.setup-section h4 {
  font-size: .75rem; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .05em; margin-bottom: .5rem; font-weight: 700;
}

.options-row { margin-top: .6rem; }
.option-group label { font-size: .7rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; display: block; margin-bottom: .25rem; }
.option-pills { display: flex; gap: .25rem; }
.option-pill {
  padding: .25rem .6rem; font-size: .75rem; border-radius: 999px;
  border: 2px solid var(--surface2); background: var(--surface);
  color: var(--text-muted); cursor: pointer; font-family: inherit;
  font-weight: 600; transition: all .15s;
}
.option-pill:hover { border-color: var(--game-accent); }
.option-pill.selected { background: var(--color-honey); color: #5A3A3A; border-color: transparent; }

.start-btn {
  margin-top: .8rem; width: 100%; padding: .7rem; font-size: 1.1rem;
  border-radius: 999px; background: var(--color-honey);
  color: #5A3A3A; box-shadow: 0 4px 14px rgba(251, 233, 160, .5);
  border: none; font-family: inherit; font-weight: 700; cursor: pointer;
  transition: box-shadow .2s, transform .1s;
}
.start-btn:hover { box-shadow: 0 6px 20px rgba(251, 233, 160, .6); }
.start-btn:active { transform: scale(.97); }

/* --- Phase Section --- */
.phase-section {
  background: var(--surface); border-radius: var(--radius);
  padding: 1.2rem 1rem; box-shadow: var(--shadow); text-align: center;
}
.round-counter {
  font-size: .7rem; color: var(--text-muted); font-weight: 600;
  margin-bottom: .6rem; letter-spacing: .02em;
}

/* --- Timer --- */
.timer-area {
  display: flex; justify-content: center; margin-bottom: .8rem;
  position: relative;
}
.timer-ring {
  position: relative; display: inline-flex;
  align-items: center; justify-content: center;
}
.timer-ring svg { display: block; }
.timer-text {
  position: absolute; font-size: 1.5rem; font-weight: 900;
  color: #22c55e; transition: color .3s; line-height: 1;
}
.timer-area.warning .timer-text { animation: pulse-warn .5s ease-in-out infinite alternate; }
@keyframes pulse-warn {
  from { transform: scale(1); }
  to { transform: scale(1.15); }
}

/* --- Card Area --- */
.card-area {
  background: var(--surface2); border-radius: 14px;
  padding: 1rem .8rem; margin-bottom: .8rem;
}
.target-label {
  font-size: .65rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: .3rem;
}
.target-word {
  font-size: 2.2rem; font-weight: 900; color: var(--text);
  margin-bottom: .7rem; line-height: 1.2; word-break: break-all;
}
.ng-label {
  font-size: .65rem; font-weight: 700; color: #ef4444;
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: .4rem;
}
.ng-badges {
  display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center;
}
.ng-badge {
  background: rgba(239, 68, 68, .1); border: 1.5px solid #ef4444;
  color: #ef4444; padding: .22rem .6rem; border-radius: 999px;
  font-size: .8rem; font-weight: 700;
}

/* --- Action Buttons --- */
.action-buttons {
  display: flex; gap: .5rem; justify-content: center;
}
.action-buttons .btn {
  flex: 1; padding: .7rem .5rem; font-size: 1rem; font-weight: 900;
  border-radius: 14px; border: none; cursor: pointer;
  font-family: inherit; transition: transform .1s, box-shadow .15s;
  max-width: 130px;
}
.action-buttons .btn:active { transform: scale(.95); }

.btn-correct {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff; box-shadow: 0 4px 14px rgba(34, 197, 94, .3);
}
.btn-correct:hover { box-shadow: 0 6px 20px rgba(34, 197, 94, .4); }

.btn-pass {
  background: var(--surface2); color: var(--text-muted);
  border: 2px solid var(--surface2) !important; box-shadow: none;
}
.btn-pass:hover { border-color: var(--text-muted) !important; }

.btn-ng {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff; box-shadow: 0 4px 14px rgba(239, 68, 68, .3);
}
.btn-ng:hover { box-shadow: 0 6px 20px rgba(239, 68, 68, .4); }

/* --- NG Flash --- */
@keyframes ng-flash-anim {
  0%   { outline: 0px solid rgba(239, 68, 68, 0); }
  30%  { outline: 6px solid rgba(239, 68, 68, .7); background: rgba(239, 68, 68, .05); }
  100% { outline: 0px solid rgba(239, 68, 68, 0); }
}
.ng-flash { animation: ng-flash-anim .5s ease-out forwards; }

/* --- Result Phase --- */
.result-section { text-align: center; }
.result-icon { font-size: 3rem; margin-bottom: .3rem; }
.result-title { font-size: 1.4rem; font-weight: 900; margin-bottom: .3rem; }
.result-word {
  font-size: 1.5rem; font-weight: 900;
  color: #d4c070; margin: .3rem 0 .5rem;
}
.result-details { font-size: .85rem; color: var(--text-muted); line-height: 1.8; }
.result-details strong { color: var(--text); }
.next-btn {
  margin-top: .7rem; padding: .6rem 2rem; font-size: 1rem;
  border-radius: 999px; background: var(--color-honey);
  color: #5A3A3A; border: none; font-family: inherit; font-weight: 700;
  cursor: pointer; box-shadow: 0 4px 14px rgba(251, 233, 160, .4);
  transition: box-shadow .15s;
}
.next-btn:hover { box-shadow: 0 6px 20px rgba(251, 233, 160, .5); }
.next-btn:active { transform: scale(.97); }

/* --- Scoreboard --- */
.score-section {
  background: var(--surface); border-radius: var(--radius);
  padding: .5rem .8rem; box-shadow: var(--shadow);
}
.score-section h4 {
  font-size: .7rem; color: var(--text-muted); margin-bottom: .3rem;
  text-transform: uppercase; letter-spacing: .05em; font-weight: 700;
}
.score-list { display: flex; flex-wrap: wrap; gap: .3rem .8rem; }
.score-item { font-size: .8rem; display: flex; gap: .3rem; align-items: center; }
.score-item .name { font-weight: 700; }
.score-item .pts { color: #d4c070; font-weight: 700; }

/* --- Log --- */
.log-section {
  background: var(--surface); border-radius: var(--radius);
  padding: .5rem .8rem; box-shadow: var(--shadow);
  flex: 1; min-height: 0; overflow-y: auto;
}
.log-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .3rem; }
.log-header h4 {
  font-size: .7rem; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .05em; font-weight: 700;
}
.clear-log-btn {
  background: var(--surface2); border: 2px solid var(--surface2); color: var(--text-muted);
  border-radius: 8px; padding: .15rem .5rem; font-size: .65rem; cursor: pointer;
  font-family: inherit; font-weight: 600; transition: border-color .2s, color .2s;
}
.clear-log-btn:hover { border-color: var(--primary); color: var(--primary); }
.log-entry {
  display: flex; justify-content: space-between; align-items: center;
  gap: .3rem; padding: .25rem 0; border-bottom: 1px solid var(--surface2); font-size: .75rem;
}
.log-entry:last-child { border-bottom: none; }
.log-entry .solved { color: var(--accent-green); }
.log-entry .unsolved { color: var(--primary); }

/* --- Help Modal --- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(90, 58, 58, .3); backdrop-filter: blur(4px);
  z-index: 100; align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay { display: none; }
.modal-overlay[style*="flex"] { display: flex !important; }
.modal-box {
  background: var(--surface); border-radius: var(--radius); padding: 1.5rem;
  max-width: 400px; width: 100%; max-height: 80vh; overflow-y: auto;
  position: relative; box-shadow: var(--shadow-lg);
}
.modal-box h3 { margin-bottom: .8rem; font-weight: 900; }
.modal-box ul { margin: 0 0 0 1.2rem; line-height: 1.8; font-size: .85rem; color: var(--text-muted); }
.modal-close {
  position: absolute; top: .5rem; right: .8rem; background: none; border: none;
  color: var(--text-muted); font-size: 1.4rem; cursor: pointer; transition: color .2s;
}
.modal-close:hover { color: var(--primary); }

/* --- Shared btn base (used for next-btn etc) --- */
.btn { display: inline-block; }
.btn-primary {
  background: var(--color-honey);
  color: #5A3A3A; border: none; border-radius: 999px;
  padding: .5rem 1.5rem; font-family: inherit; font-weight: 700;
  font-size: .9rem; cursor: pointer;
}

@media (max-width: 480px) {
  .game-page { padding: .4rem .5rem; }
  .target-word { font-size: 1.8rem; }
  .action-buttons .btn { font-size: .9rem; padding: .6rem .4rem; }
  .timer-text { font-size: 1.3rem; }
}
