* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
  background-attachment: fixed;
  color: #e0e0e0;
  font-family: 'Noto Sans JP', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

#app {
  padding: 24px 16px 48px 16px;
  max-width: 720px;
  margin: 0 auto;
}

.site-header {
  text-align: center;
  margin-bottom: 28px;
}

.header-emoji {
  font-size: 42px;
  letter-spacing: 6px;
  margin-bottom: 4px;
}

.site-title {
  font-size: 26px;
  font-weight: 900;
  margin: 4px 0 8px 0;
  background: linear-gradient(90deg, #ff6b6b, #ffd93d, #6bcb77, #4d96ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.site-subtitle {
  font-size: 12px;
  color: #888;
  margin: 0;
}

.tabs {
  display: flex;
  gap: 4px;
  background: #111;
  border-radius: 12px;
  padding: 4px;
  max-width: 540px;
  margin: 0 auto 24px auto;
}

.tab {
  flex: 1;
  padding: 10px 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #666;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.tab.active {
  background: linear-gradient(135deg, #4d96ff, #6bcb77);
  color: #fff;
  font-weight: 700;
}

.panel {
  max-width: 560px;
  margin: 0 auto;
}

.row-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 20px;
}

.row-tab {
  padding: 6px 14px;
  border: 1px solid #333;
  border-radius: 20px;
  background: #111;
  color: #888;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.row-tab.active {
  border-color: #4d96ff;
  background: rgba(77, 150, 255, 0.13);
  color: #4d96ff;
  font-weight: 700;
}

.dict-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dict-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 14px 18px;
  border-left: 3px solid rgba(77, 150, 255, 0.33);
}

.dict-kana {
  font-size: 22px;
  font-weight: 900;
  color: #ffd93d;
  margin-bottom: 8px;
}

.dict-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
}

.dict-option.dim {
  opacity: 0.5;
}

.dict-emoji {
  font-size: 26px;
  width: 66px;
  text-align: center;
  flex-shrink: 0;
}

.dict-word {
  font-size: 13px;
  color: #aaa;
}

.hint {
  text-align: center;
  color: #888;
  font-size: 12px;
  margin-bottom: 20px;
  line-height: 1.7;
}

.quiz-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.quiz-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.quiz-badge {
  font-size: 11px;
  color: #4d96ff;
  font-weight: 700;
  background: rgba(77, 150, 255, 0.1);
  padding: 3px 10px;
  border-radius: 10px;
}

.quiz-clues {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.quiz-clue {
  background: #000;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.quiz-reveal {
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: #555;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.3s;
}

.quiz-reveal.revealed {
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.15), rgba(255, 217, 61, 0.15));
  color: #ffd93d;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 6px;
}

.field {
  display: block;
  margin-bottom: 16px;
}

.field-label {
  display: block;
  font-size: 12px;
  color: #888;
  margin-bottom: 6px;
  font-weight: 500;
}

.field input[type="text"],
.share-q input[type="text"],
textarea,
input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  background: #111;
  border: 1px solid #333;
  border-radius: 8px;
  color: #e0e0e0;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

textarea {
  resize: vertical;
  line-height: 1.5;
  word-break: break-all;
}

input[type="text"]:focus,
textarea:focus {
  border-color: #4d96ff;
}

.button-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.btn-primary,
.btn-ghost {
  padding: 10px 18px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.btn-primary {
  background: linear-gradient(135deg, #4d96ff, #6bcb77);
  color: #fff;
}

.btn-primary:hover {
  filter: brightness(1.1);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: #ccc;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

.encode-result {
  margin-top: 16px;
  padding: 16px;
  background: #000;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 26px;
  line-height: 1.6;
  word-break: break-all;
  min-height: 50px;
}

.encode-warn {
  margin-top: 10px;
  padding: 10px 14px;
  background: rgba(255, 217, 61, 0.08);
  border: 1px solid rgba(255, 217, 61, 0.3);
  border-radius: 10px;
  color: #ffd93d;
  font-size: 12px;
  line-height: 1.6;
}

.share-questions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.share-q {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.share-q-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #888;
}

.share-q-remove {
  background: transparent;
  border: none;
  color: #ff6b6b;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  padding: 2px 6px;
}

.share-q-preview {
  font-size: 20px;
  line-height: 1.5;
  word-break: break-all;
  min-height: 24px;
  color: #eee;
}

.share-output {
  margin-top: 16px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.share-output textarea {
  font-size: 12px;
  margin-bottom: 10px;
}

.play-header {
  text-align: center;
  margin-bottom: 20px;
}

.play-theme {
  font-size: 20px;
  font-weight: 900;
  color: #ffd93d;
  margin-bottom: 4px;
}

.play-author {
  font-size: 12px;
  color: #888;
}

.play-questions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.play-q {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.play-q.correct {
  border-color: #6bcb77;
  background: rgba(107, 203, 119, 0.08);
}

.play-q.wrong {
  border-color: #ff6b6b;
  background: rgba(255, 107, 107, 0.08);
}

.play-q-clues {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.play-q-clue {
  background: #000;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.play-q-answer {
  font-size: 11px;
  color: #6bcb77;
  margin-top: 6px;
}

.play-q-answer.bad {
  color: #ff6b6b;
}

.play-score {
  text-align: center;
  margin: 20px 0;
  padding: 18px;
  background: linear-gradient(135deg, rgba(77, 150, 255, 0.15), rgba(107, 203, 119, 0.15));
  border: 1px solid rgba(107, 203, 119, 0.3);
  border-radius: 14px;
  font-size: 20px;
  font-weight: 900;
  color: #ffd93d;
}

.play-create-cta {
  text-align: center;
  margin-top: 24px;
}

.site-footer {
  text-align: center;
  margin-top: 40px;
  padding: 16px;
  color: #444;
  font-size: 11px;
}

@media (max-width: 480px) {
  .site-title { font-size: 22px; }
  .header-emoji { font-size: 34px; letter-spacing: 4px; }
  .tab { font-size: 12px; padding: 9px 0; }
  .dict-emoji { width: 54px; font-size: 22px; }
  .quiz-clue, .play-q-clue { font-size: 20px; padding: 6px 10px; }
  .encode-result { font-size: 22px; }
}
