@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&family=Noto+Serif+SC:wght@500;700&display=swap');
:root {
    --bg-color: #f8f9fc;
    --primary-text: #2d3748;
    --secondary-text: #4a5568;
    --accent-color: #6b46c1;
    --accent-light: #805ad5;
    --card-bg: #ffffff;
    --card-bg-light: #f7fafc;
    --border-color: #e2e8f0;
    --hover-bg: #f6f6ff;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 15px rgba(107, 70, 193, 0.15);
}
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent; 
}
button, .option-item {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}
.hidden, .fade-out { pointer-events: none !important; }
.modal, .overlay { pointer-events: auto; }
.modal.hidden, .overlay.hidden { pointer-events: none !important; }
body, #quiz-container {
    -webkit-touch-callout: none;
}
body {
    font-family: 'Noto Sans SC', sans-serif;
    background-color: var(--bg-color);
    color: var(--primary-text);
    min-height: 100vh;
    padding: 20px;
    padding-bottom: constant(safe-area-inset-bottom);
    padding-bottom: env(safe-area-inset-bottom);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(107, 70, 193, 0.05) 0%, transparent 20%),
        radial-gradient(circle at 90% 70%, rgba(107, 70, 193, 0.03) 0%, transparent 30%),
        url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"%3E%3Cg fill="%23e2e8f0" fill-opacity="0.5"%3E%3Ccircle cx="50" cy="50" r="1.5"/%3E%3Ccircle cx="10" cy="10" r="1"/%3E%3Ccircle cx="90" cy="90" r="1"/%3E%3Ccircle cx="10" cy="90" r="1"/%3E%3Ccircle cx="90" cy="10" r="1"/%3E%3Ccircle cx="30" cy="70" r="0.5"/%3E%3Ccircle cx="70" cy="30" r="0.5"/%3E%3Ccircle cx="20" cy="50" r="0.75"/%3E%3Ccircle cx="80" cy="50" r="0.75"/%3E%3C/g%3E%3C/svg%3E');
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    transition: background-color 1s ease;
    -webkit-font-smoothing: antialiased;
}
#start-screen .notice-bar {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--card-bg-light) 0%, #f8fafc 50%, #ffffff 100%);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    text-align: center;
    gap: 8px;
    color: var(--secondary-text);
    font-size: 16px;
    line-height: 1.5;
    word-break: break-word;
}
#start-screen .notice-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.35);
    flex: 0 0 8px;
}
#start-screen .notice-bar a {
    color: #0078ff;
    text-decoration: none;
    font-weight: 500;
}
#start-screen .notice-bar a:hover {
    text-decoration: underline;
}
#start-screen h1, #start-screen h2, #start-screen .start-description { text-align: center; }
#start-screen p {
    text-align: center;
    max-width: 80%;
    margin-left: auto;
    margin-right: auto;
}
#quiz-container {
    width: 100%;
    max-width: 700px;
    background-color: var(--card-bg);
    border-radius: 24px;
    box-shadow: var(--shadow), var(--shadow-glow);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    transform: perspective(1000px) rotateX(0deg);
    -webkit-transform: perspective(1000px) rotateX(0deg);
}
#quiz-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 4px;
    background: linear-gradient(90deg, var(--accent-color), transparent);
    opacity: 0.8;
}
.screen {
    padding: 40px;
    animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 450px;
    display: flex;
    flex-direction: column;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); filter: blur(5px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}
@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-20px); filter: blur(5px); }
}
.fade-out { animation: fadeOut 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
h1, h2, h3 { color: var(--primary-text); margin-bottom: 16px; position: relative; }
h1 {
    font-family: 'Noto Serif SC', serif;
    font-size: 2.2em; letter-spacing: 3px; text-align: center;
    background: linear-gradient(90deg, var(--accent-color), var(--primary-text));
    -webkit-background-clip: text; background-clip: text; color: transparent;
    margin-bottom: 20px;
    animation: textGlow 3s ease-in-out infinite alternate;
}
@keyframes textGlow { from { text-shadow: 0 0 10px rgba(107,70,193,.1);} to { text-shadow:0 0 20px rgba(107,70,193,.2);} }
h2 { font-size: 1.6em; color: var(--accent-color); margin-top: 0; text-align: center; font-weight: 500; }
h3.question-title { text-align: left; font-size: 1.3em; margin-bottom: 30px; line-height: 1.8; padding-left: 4px; border-left: 3px solid var(--accent-color); }
p { color: var(--secondary-text); line-height: 1.8; margin-bottom: 30px; font-size: 1.05em; }
.start-button, .restart-button, .browse-button, .back-button {
    display: block;
    width: 220px;
    margin: 30px auto 0;
    padding: 16px 20px;
    background: linear-gradient(45deg, var(--accent-color), var(--accent-light));
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(107, 70, 193, 0.2);
    position: relative;
    overflow: hidden;
    z-index: 1;
    min-height: 44px; 
    -webkit-appearance: none;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
.back-button { width: auto; padding: 10px 20px; margin: 0 0 20px 0; background: transparent; color: var(--accent-color); border: 1px solid var(--accent-color); }
.back-button:hover { background-color: rgba(107,70,193,.05); }
.start-button::after, .restart-button::after, .browse-button::after {
    content: '';
    position: absolute; top:-50%; left:-50%; width:200%; height:200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    transform: rotate(30deg); transition: all .6s ease; z-index: -1;
}
.start-button:hover, .restart-button:hover, .browse-button:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(107,70,193,.3); }
.start-button:hover::after, .restart-button:hover::after, .browse-button:hover::after { left:120%; }
.button-group { display:flex; justify-content:center; gap:15px; margin-top:30px; }
.option-list { list-style:none; padding:0; margin:0 0 20px 0; flex-grow:1; }
.option-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    margin-bottom: 16px;
    padding: 20px 25px;
    cursor: pointer;
    transition: all .3s cubic-bezier(.4,0,.2,1);
    display: flex; align-items: flex-start; position: relative; overflow: hidden;
    will-change: transform, background-color;
    -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
    touch-action: manipulation;
}
.option-item::before { content:''; position:absolute; top:0; left:0; width:0; height:100%; background-color: rgba(107,70,193,.05); transition: width .4s ease; z-index:0; }
.option-item:hover { background-color: var(--hover-bg); border-color: var(--accent-color); transform: translateX(6px); box-shadow: 0 4px 12px rgba(0,0,0,.05); }
.option-item:hover::before { width:100%; }
.option-item.selected {
    background-color: rgba(107,70,193,.08);
    border-color: var(--accent-light);
    transform: translateX(3px) scale(1.01);
    box-shadow: 0 8px 18px rgba(107,70,193,.12);
}
.option-prefix { font-weight:700; color: var(--accent-color); margin-right:15px; font-size:1.2em; min-width:24px; text-align:center; position:relative; z-index:1; }
.option-text   { color: var(--primary-text); line-height:1.7; position:relative; z-index:1; }
.start-button:active, .restart-button:active, .browse-button:active {
    transform: translateY(0); box-shadow: 0 4px 12px rgba(107,70,193,.20); filter: saturate(1.05);
}
#progress-bar-container { width:100%; background-color: rgba(226,232,240,.5); height:8px; position:relative; overflow:hidden; border-radius:4px; margin-bottom:30px; }
#progress-bar { width:0%; height:100%; background: linear-gradient(90deg, var(--accent-color), var(--accent-light)); transition: width .6s cubic-bezier(.4,0,.2,1); position:relative; }
#progress-bar::after { content:''; position:absolute; top:0; left:0; width:40px; height:100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.3), transparent); animation: progressShine 2s infinite; }
@keyframes progressShine { 0% { transform: translateX(-100px);} 100% { transform: translateX(700px);} }
.interlude-screen { display:none; }
#result-screen { text-align:center; padding:50px 40px; }
#result-screen h2 { font-family: 'Noto Serif SC', serif; font-size:2em; margin-bottom:20px; letter-spacing:1px; }
#result-screen h3 { font-size:2.2em; color: var(--accent-color); margin-bottom:35px; text-align:center; font-weight:700; text-shadow:0 0 15px rgba(107,70,193,.2); animation: pulse 3s infinite; }
@keyframes pulse { 0%{transform:scale(1);} 50%{transform:scale(1.05);} 100%{transform:scale(1);} }
#result-screen p {
    text-align: left; max-width: 90%; margin: 0 auto 40px;
    line-height: 1.9; font-size: 1.1em; padding: 25px;
    background-color: rgba(247,250,252,.8); border-radius: 16px; border: 1px solid rgba(226,232,240,.8);
    transition: all .5s ease;
}
#result-screen p:hover { border-color: rgba(107,70,193,.3); box-shadow: 0 0 20px rgba(107,70,193,.08); }
.hidden { display:none; }
.screen-footer { text-align:center; font-size:.9em; color: var(--secondary-text); margin-top:40px; opacity:.7; }
.loader { width:48px; height:48px; border:3px solid var(--accent-color); border-bottom-color:transparent; border-radius:50%; display:inline-block; box-sizing:border-box; animation: rotation 1s linear infinite; margin:20px auto; }
@keyframes rotation { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg);} }
#animal-guide { max-height: 600px; overflow-y: auto; padding-right: 15px; -webkit-overflow-scrolling: touch; }
.animal-card { background-color: rgba(247, 250, 252, .8); border-radius: 16px; border: 1px solid rgba(226,232,240,.8); padding:20px; margin-bottom:20px; transition: all .3s ease; }
.animal-card {
    background-color: rgba(247, 250, 252, .9);
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, .9);
    padding: 20px;
    margin-bottom: 20px;
    transition: transform .25s ease, border-color .25s ease, background-color .25s ease;
    box-shadow: none;
}
.animal-card:hover {
    transform: translateY(-3px);
    border-color: rgba(107, 70, 193, .25);
    background-color: rgba(255, 255, 255, .95);
    box-shadow: none;
}
.animal-card h3 { color: var(--accent-color); margin-bottom:10px; }
.animal-card p { margin-bottom:0; font-size:1em; }
.option-item.selected::after{
    content:'✓'; position:absolute; right:20px; top:50%;
    transform: translateY(-50%); color: var(--accent-color);
    font-size:1.5em; font-weight:bold; animation: checkmark .5s cubic-bezier(.4,0,.2,1);
}
@keyframes checkmark { 0%{transform: translateY(-50%) scale(0); opacity:0;} 70%{transform: translateY(-50%) scale(1.2); opacity:1;} 100%{transform: translateY(-50%) scale(1); opacity:1;} }
@media (max-width: 600px) {
    body { padding:10px; min-height:100vh; padding-bottom: calc(50px + env(safe-area-inset-bottom)); }
    .screen { padding: 25px 20px; min-height: auto; }
    h1 { font-size: 1.8em; } h2 { font-size: 1.4em; }
    h3.question-title { font-size: 1.15em; padding-left: 3px; }
    .option-item { padding: 16px 20px; }
    .interlude-screen { padding: 40px 20px; }
    #result-screen { padding: 30px 20px; }
    #result-screen h3 { font-size: 1.8em; }
    .button-group { flex-direction: column; align-items: center; }
}
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@supports (-webkit-touch-callout: none) {
    .start-button, .restart-button, .browse-button, .back-button {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-tap-highlight-color: transparent;
    }
}
#option-list.pointer-guard {
  pointer-events: none !important;
}
.history-tip {
    margin-top: 2px;
    font-size: 1em;
    color: var(--secondary-text);
    line-height: 1.6;
    text-align: center;
}
.history-list {
  margin-top: 20px;
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 6px;
  scroll-behavior: smooth;
}
.history-list::-webkit-scrollbar {
  width: 6px;
}
.history-list::-webkit-scrollbar-track {
  background: rgba(99,102,241,.05);
  border-radius: 3px;
}
.history-list::-webkit-scrollbar-thumb {
  background: rgba(99,102,241,.2);
  border-radius: 3px;
  transition: background .2s ease;
}
.history-list::-webkit-scrollbar-thumb:hover {
  background: rgba(99,102,241,.3);
}
.history-item {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.85), rgba(255,255,255,0.95));
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 18px;
  padding: 16px 18px 14px;
  margin: 0 0 16px 12px;                 
  box-shadow: 0 6px 22px rgba(15, 23, 42, 0.06);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.history-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.1), 
              0 4px 12px rgba(99, 102, 241, 0.08); 
  border-color: rgba(99, 102, 241, 0.25);
}
.history-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px 12px;
  align-items: center;
  margin-bottom: 8px;
}
.history-icon {
  font-size: 22px;
  line-height: 1;
  filter: saturate(1.1);
}
.history-time {
  font-size: .9em;
  color: var(--secondary-text, #64748b);
  opacity: .9;
}
.history-result-badge {
  justify-self: end;
  font-size: .75rem;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(99,102,241,.10);
  color: #4f46e5; 
  border: 1px solid rgba(99,102,241,.25);
  font-weight: 600;
  letter-spacing: .2px;
  white-space: nowrap;
}
.history-desc {
  font-size: .95em;
  line-height: 1.65;
  color: var(--primary-text, #0f172a);
  margin: 2px 0 6px;
}
.history-answers-wrap {
  margin-top: 8px;
  border-top: 1px dashed rgba(226, 232, 240, 0.9);
  padding-top: 10px;
}
.history-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  padding: 8px 10px;
  border-radius: 18px;
  border: 1px solid var(--border-color, #e5e7eb);
  background: #fff;
  cursor: pointer;
  user-select: none;
  transition: background .2s ease, border-color .2s ease, transform .15s ease;
}
.history-toggle:hover {
  background: rgba(99,102,241,.06);
  border-color: rgba(99,102,241,.25);
}
.history-toggle:active {
  transform: translateY(1px);
}
.history-toggle[aria-expanded="true"] .chev {
  transform: rotate(90deg);
}
.chev {
  display: inline-block;
  transition: transform .2s ease;
}
.history-answer-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
}
.history-answer-item {
  padding: 8px 0;
  border-top: 1px dashed rgba(226, 232, 240, 0.8);
}
.history-answer-item:first-child { border-top: none; }
.history-question {
  font-size: .92em;
  color: var(--primary-text, #0f172a);
  font-weight: 500; 
}
.history-answer {
  font-size: .85em;
  color: var(--secondary-text, #64748b);
  margin-top: 2px;
}
.collapse {
  height: 0;
  overflow: hidden;
  opacity: .0;
  transition: height .25s ease, opacity .25s ease;
}
.collapse.show {
  height: auto;
  opacity: 1;
}
.history-empty {
  margin-top: 28px;
  font-size: .95em;
  color: var(--secondary-text, #64748b);
  text-align: center;
  padding: 40px 20px;
  position: relative;
}
.history-empty::before {
  content: "📝";
  display: block;
  font-size: 3em;
  margin-bottom: 12px;
  opacity: .5;
}
.history-empty::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(99,102,241,.05), transparent);
  border-radius: 50%;
  z-index: -1;
}
:root {
  --np-bg: #ffffff;
  --np-overlay: rgba(0,0,0,0.6);
  --np-border: rgba(243,244,246,1); 
  --np-radius: 24px;
  --np-shadow: 0 10px 40px rgba(0,0,0,0.15);
  --np-title-from: #4f46e5; 
  --np-title-to:   #2563eb; 
  --np-highlight-from: #ef4444; 
  --np-highlight-to:   #f97316; 
  --np-report-from:        #dc2626; 
  --np-report-to:          #b91c1c; 
  --np-report-hover-from:  #b91c1c; 
  --np-report-hover-to:    #991b1b; 
  --np-confirm-from:        #10b981; 
  --np-confirm-to:          #16a34a; 
  --np-confirm-hover-from:  #059669; 
  --np-confirm-hover-to:    #15803d; 
  --np-text-main:   #374151; 
  --np-text-strong: #b91c1c; 
  --np-text-box:    #1f2937; 
  --np-box-from:  #fef2f2;         
  --np-box-to:    #fff7ed;         
  --np-box-border:#fecacaCC;       
}
.np-overlay {
  position: fixed;
  inset: 0;
  background: var(--np-overlay);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}
.np-modal {
  width: 100%;
  max-width: 32rem; 
  background: var(--np-bg);
  border-radius: var(--np-radius);
  padding: 24px;
  box-shadow: var(--np-shadow);
  border: 1px solid var(--np-border);
  transform-origin: center;
  transition: transform .28s ease, opacity .28s ease;
  opacity: 1;
  transform: translateY(0) scale(1);
}
.np-title {
  text-align: center;
  font-weight: 800;
  font-size: 24px;
  line-height: 1.05;
  margin-bottom: 20px;
  letter-spacing: -0.03em;
  background: linear-gradient(90deg, var(--np-title-from), var(--np-title-to));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.np-main-text {
  text-align: center;
  color: var(--np-text-main);
  margin-bottom: 16px;
  font-size: 16px;
  font-weight: 600;
}
.np-highlight {
  background: linear-gradient(90deg, var(--np-highlight-from), var(--np-highlight-to));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
  display:block;
  font-size: 18px;
}
.np-warning {
  background: linear-gradient(90deg, var(--np-box-from), var(--np-box-to));
  border: 1px solid var(--np-box-border);
  padding: 16px;
  border-radius: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
  margin-bottom: 20px;
  display:flex;
  gap:12px;
  align-items:flex-start;
}
.np-warning p {
  margin:0;
  color: var(--np-text-box);
  font-weight:500;
  font-size:14px;
  text-align:justify;
  line-height: 1.6;
}
.np-warning-strong {
  font-weight: 700;
  color: var(--np-text-strong);
}
.np-actions {
  display:flex;
  flex-direction:column;
  gap:10px;
}
.np-btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight:700;
  cursor:pointer;
  border:none;
  text-decoration:none;
  width:100%;
  font-size:16px;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.np-btn-report {
  background: linear-gradient(90deg,var(--np-report-from), var(--np-report-to));
  color: #fff;
  box-shadow: 0 10px 30px rgba(220,38,38,0.18);
  transform: translateY(0);
}
.np-btn-report:hover {
  background: linear-gradient(90deg,var(--np-report-hover-from), var(--np-report-hover-to));
  box-shadow: 0 16px 40px rgba(185,28,28,0.26);
  transform: translateY(-1px);
}
.np-btn-report:active {
  transform: translateY(1px);
  box-shadow: 0 4px 16px rgba(153,27,27,0.25);
}
.np-btn-confirm {
  background: linear-gradient(90deg,var(--np-confirm-from), var(--np-confirm-to));
  color:#fff;
  box-shadow: 0 10px 30px rgba(16,185,129,0.18);
}
.np-btn-confirm:hover {
  background: linear-gradient(90deg,var(--np-confirm-hover-from), var(--np-confirm-hover-to));
  box-shadow: 0 16px 40px rgba(21,128,61,0.26);
  transform: translateY(-1px);
}
.np-btn-confirm:active {
  transform: translateY(1px);
  box-shadow: 0 4px 16px rgba(22,101,52,0.25);
}
@media (min-width:640px){
  .np-modal{ padding:32px; }
  .np-title{ font-size:28px; }
  .np-main-text{ font-size:18px; }
}
.np-hidden {
  opacity:0;
  transform: translateY(8px) scale(.98);
  pointer-events:none;
}
body.np-modal-open {
  overflow: hidden !important;
}
.np-btn:focus {
  outline: none;
}
.np-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(59,130,246,0.7);
}
