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

body {
  min-height: 100vh;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, 0.02) 2px,
      rgba(0, 0, 0, 0.02) 4px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, 0.02) 2px,
      rgba(0, 0, 0, 0.02) 4px
    ),
    linear-gradient(
      180deg,
      #f5f5f0 0%,
      #eeeee8 50%,
      #e8e8e0 100%
    );
  background-attachment: fixed;
}

.game-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 15px 20px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #4a90a4 0%, #357a8c 100%);
  border-radius: 8px;
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

header h1 {
  color: white;
  font-size: 1.5rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  letter-spacing: 1px;
}

header .header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.puzzle-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

header .puzzle-number {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  white-space: nowrap;
}

.completion-icon {
  color: #6bcf6b;
  font-size: 1rem;
  font-weight: bold;
}

.completion-icon.hidden {
  display: none;
}

.header-btn {
  appearance: none;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  color: white;
  font-size: 1.2rem;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-family: inherit;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  border-color: rgba(255, 255, 255, 0.6);
  transform: scale(1.1);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.header-btn:active {
  transform: scale(0.95);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15), inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.header-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 2px;
}

.header-archive-btn {
  font-size: 1rem;
}

.answer-section {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 25px;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.15),
    0 1px 0 rgba(255, 255, 255, 0.8);
}

.guess-placeholder {
  display: none;
}

.guess-placeholder.active {
  display: block;
}

.guess-section {
  position: relative;
  padding: 20px;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  margin-bottom: 25px;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.15),
    0 1px 0 rgba(255, 255, 255, 0.8);
  transition: box-shadow 0.2s ease;
}

.guess-section.is-fixed {
  position: fixed;
  top: 10px;
  left: 50%;
  z-index: 100;
  transform: none;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.2),
    0 1px 0 rgba(255, 255, 255, 0.8);
}

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

.guess-button {
  padding: 10px 24px;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: linear-gradient(180deg, #4a90a4 0%, #357a8c 100%);
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow:
    0 3px 6px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.guess-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow:
    0 5px 10px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.guess-button:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.15),
    inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.guess-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.answer-label {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.context-text {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.6;
}

@media print {
  .context-text {
    break-inside: avoid;
    page-break-inside: avoid;
    orphans: 3;
    widows: 3;
  }
}

.context-before {
  margin-bottom: 12px;
}

.context-after {
  margin-top: 12px;
}

.answer-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 50px;
  align-items: center;
}

.submit-guess-btn {
  margin-top: 15px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 1.05rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  background: linear-gradient(180deg, #6bcf6b 0%, #4db84d 100%);
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.15),
    0 2px 4px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  display: block;
  width: 100%;
}

.submit-guess-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow:
    0 6px 12px rgba(0, 0, 0, 0.2),
    0 3px 6px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  background: linear-gradient(180deg, #7dd97d 0%, #5ac25a 100%);
}

.submit-guess-btn:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.15),
    inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.submit-guess-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: linear-gradient(180deg, #ccc 0%, #aaa 100%);
  color: #666;
}

.answer-slot {
  min-width: 60px;
  height: 40px;
  border: 2px dashed #ccc;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.answer-slot.filled {
  border: none;
  background: linear-gradient(180deg, #fff 0%, #f0f0f0 100%);
  box-shadow:
    0 3px 6px rgba(0, 0, 0, 0.15),
    0 1px 2px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: #333;
  font-weight: 500;
  padding: 0 12px;
  min-width: auto;
}

.answer-slot.correct {
  background: linear-gradient(180deg, #6bcf6b 0%, #4db84d 100%);
  color: white;
}

.answer-slot.locked-correct {
  background: linear-gradient(180deg, #6bcf6b 0%, #4db84d 100%);
  color: white;
  cursor: default;
}

.answer-slot.free-word {
  background: linear-gradient(180deg, #b8d4e8 0%, #9ec5db 100%);
  color: #2c5282;
  cursor: default;
  font-weight: 500;
  border: none;
  box-shadow:
    0 3px 6px rgba(0, 0, 0, 0.15),
    0 1px 2px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.scraps-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.scrap-row {
  background: rgba(255, 255, 255, 0.5);
  border-radius: 10px;
  padding: 15px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.scrap-row.completed {
  opacity: 0.7;
}

.scrap-row.locked {
  opacity: 0.5;
  pointer-events: none;
}

.row-indicator {
  font-size: 0.75rem;
  color: #888;
  margin-bottom: 8px;
}

.scrap-words {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.word-magnet {
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  background: linear-gradient(180deg, #fff 0%, #e8e8e8 100%);
  box-shadow:
    0 3px 6px rgba(0, 0, 0, 0.12),
    0 1px 2px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: #333;
}

.word-magnet:hover:not(.selected):not(:disabled) {
  transform: translateY(-2px);
  box-shadow:
    0 5px 10px rgba(0, 0, 0, 0.15),
    0 2px 4px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.word-magnet:active:not(.selected):not(:disabled) {
  transform: translateY(1px);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.1),
    inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.word-magnet.selected {
  background: linear-gradient(180deg, #4a90a4 0%, #357a8c 100%);
  color: white;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.word-magnet:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.word-magnet.non-selectable {
  opacity: 0.3;
  background: linear-gradient(180deg, #f5f5f5 0%, #e0e0e0 100%);
  color: #999;
  cursor: default;
}

.word-magnet.wrong-disabled {
  background: linear-gradient(180deg, #e57373 0%, #d32f2f 100%);
  color: white;
  opacity: 0.6;
  cursor: not-allowed;
}

.word-magnet.correct-reveal {
  background: linear-gradient(180deg, #6bcf6b 0%, #4db84d 100%);
  color: white;
  animation: correctPop 0.4s ease;
}

.word-magnet.wrong-reveal {
  background: linear-gradient(180deg, #e57373 0%, #d32f2f 100%);
  color: white;
  animation: wrongShake 0.4s ease;
}

@keyframes correctPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

@keyframes wrongShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.success-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 100;
}

.success-overlay.show {
  opacity: 1;
  visibility: visible;
}

.success-content {
  background: white;
  padding: 40px;
  border-radius: 16px;
  text-align: center;
  max-width: 400px;
  margin: 20px;
  transform: scale(0.8);
  transition: transform 0.3s ease;
}

.success-overlay.show .success-content {
  transform: scale(1);
}

.success-content h2 {
  font-size: 2rem;
  margin-bottom: 15px;
  color: #4db84d;
}

.success-content .target-sentence {
  font-size: 1.2rem;
  color: #333;
  margin-bottom: 20px;
  font-style: italic;
}

.success-content .stats {
  color: #666;
  margin-bottom: 20px;
}

.success-content .share-section {
  margin: 20px 0;
  padding: 20px 0;
  border-top: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
}

.success-content .share-prompt {
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 12px;
}

.success-content .completion-share-text {
  font-size: 1.1rem;
  color: #333;
  margin-bottom: 15px;
  font-weight: 500;
}

.success-content button {
  padding: 12px 30px;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  background: linear-gradient(180deg, #4a90a4 0%, #357a8c 100%);
  color: white;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.success-content button:hover {
  transform: scale(1.05);
}

.success-content .success-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.success-content .freestyle-btn {
  padding: 12px 30px;
  font-size: 1rem;
  border: 2px solid #4a90a4;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0%, #f5f5f5 100%);
  color: #4a90a4;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
}

.success-content .freestyle-btn:hover {
  background: linear-gradient(180deg, #e3f2f7 0%, #d1e9f0 100%);
  border-color: #357a8c;
  color: #357a8c;
  transform: scale(1.05);
}

.success-content .generate-share-btn {
  padding: 12px 24px;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  background: linear-gradient(180deg, #4a90a4 0%, #357a8c 100%);
  color: white;
  cursor: pointer;
  transition: transform 0.2s ease;
  margin-bottom: 10px;
}

.success-content .generate-share-btn:hover {
  transform: scale(1.05);
}

.success-content .share-link-container {
  margin: 15px 0;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.success-content .share-link-container.hidden {
  display: none;
}

.success-content .share-link-input {
  flex: 1;
  padding: 10px 12px;
  font-size: 0.85rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #f5f5f5;
  min-width: 200px;
}

.success-content .copy-link-btn {
  padding: 10px 16px;
  font-size: 0.9rem;
  border: none;
  border-radius: 6px;
  background: linear-gradient(180deg, #6bcf6b 0%, #4db84d 100%);
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.success-content .copy-link-btn:hover {
  transform: scale(1.05);
}

.success-content .copy-completion-btn {
  padding: 12px 24px;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  background: linear-gradient(180deg, #6bcf6b 0%, #4db84d 100%);
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  margin: 10px 0;
}

.success-content .copy-completion-btn:hover {
  transform: scale(1.05);
}

.wrong-guesses-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 15px 0;
  max-height: 300px;
  overflow-y: auto;
}

.wrong-guess-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  background: linear-gradient(180deg, #fff 0%, #f5f5f5 100%);
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.wrong-guess-option:hover {
  border-color: #4a90a4;
  background: linear-gradient(180deg, #f8f8f8 0%, #efefef 100%);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.wrong-guess-option input[type="radio"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #4a90a4;
  flex-shrink: 0;
}

.wrong-guess-option label {
  flex: 1;
  cursor: pointer;
  font-size: 0.95rem;
  color: #333;
  line-height: 1.4;
  margin: 0;
}

.wrong-guess-option:has(input[type="radio"]:checked) {
  background: linear-gradient(180deg, #e3f2f7 0%, #d1e9f0 100%);
  border-color: #4a90a4;
  box-shadow:
    0 0 0 2px rgba(74, 144, 164, 0.2),
    0 3px 6px rgba(0, 0, 0, 0.15);
}

.no-wrong-guesses {
  color: #999;
  font-style: italic;
  padding: 20px;
  text-align: center;
}

.rules-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 200;
}

.rules-overlay.show {
  opacity: 1;
  visibility: visible;
}

.rules-content {
  background: white;
  padding: 35px;
  border-radius: 16px;
  text-align: left;
  max-width: 500px;
  width: 90%;
  margin: 20px;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  max-height: 85vh;
  overflow-y: auto;
}

.rules-overlay.show .rules-content {
  transform: scale(1);
}

.rules-content h2 {
  font-size: 2rem;
  margin-bottom: 20px;
  color: #4a90a4;
  text-align: center;
}

.rules-text {
  color: #333;
  line-height: 1.6;
}

.rules-text p {
  margin-bottom: 15px;
}

.rules-text p:first-child {
  text-align: center;
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.rule-step {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  margin: 20px 0;
  padding: 15px;
  background: linear-gradient(180deg, #f8f8f8 0%, #f0f0f0 100%);
  border-radius: 10px;
  border-left: 4px solid #4a90a4;
}

.step-number {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: linear-gradient(180deg, #4a90a4 0%, #357a8c 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.step-text {
  flex: 1;
  padding-top: 4px;
}

.rules-note {
  margin-top: 25px;
  padding: 15px;
  background: #fff9e6;
  border-radius: 8px;
  border: 1px solid #ffe680;
  font-style: italic;
  text-align: center;
  color: #666;
}

.rules-close-btn {
  width: 100%;
  padding: 14px 30px;
  margin-top: 25px;
  font-size: 1.1rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  background: linear-gradient(180deg, #6bcf6b 0%, #4db84d 100%);
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.rules-close-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
  background: linear-gradient(180deg, #7dd97d 0%, #5ac25a 100%);
}

.rules-close-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Shared Guess Overlay */
.shared-guess-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(74, 144, 164, 0.95) 0%, rgba(53, 122, 140, 0.95) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 300;
  backdrop-filter: blur(10px);
  overflow-y: auto;
  padding: 20px 0;
}

.shared-guess-overlay.show {
  opacity: 1;
  visibility: visible;
}

.shared-guess-content {
  background: white;
  padding: 45px;
  border-radius: 20px;
  text-align: center;
  max-width: 500px;
  width: 90%;
  margin: auto;
  transform: scale(0.7) rotate(-5deg);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.4),
    0 0 100px rgba(74, 144, 164, 0.3);
  position: relative;
  overflow: visible;
  max-height: none;
}

.shared-guess-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #4a90a4 0%, #6bcf6b 50%, #4a90a4 100%);
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.shared-guess-overlay.show .shared-guess-content {
  transform: scale(1) rotate(0deg);
}

.shared-guess-icon {
  font-size: 4rem;
  margin-bottom: 15px;
  animation: bounce 1s ease infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.shared-guess-content h2 {
  font-size: 2.2rem;
  margin-bottom: 10px;
  color: #4a90a4;
  background: linear-gradient(135deg, #4a90a4 0%, #6bcf6b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.shared-guess-subtitle {
  font-size: 1rem;
  color: #666;
  margin-bottom: 25px;
  font-style: italic;
}

.shared-guess-display {
  background: linear-gradient(180deg, #f8f8f8 0%, #efefef 100%);
  padding: 25px;
  border-radius: 12px;
  margin: 25px 0;
  border: 2px solid #e0e0e0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08);
  text-align: center;
  font-size: 1rem;
  color: #555;
  font-style: italic;
  line-height: 1.7;
}

.shared-context-before,
.shared-context-after {
  display: inline;
}

.shared-guess-preview {
  display: inline;
}

.shared-guess-preview-word {
  display: inline;
  padding: 2px 6px;
  background: linear-gradient(180deg, #4a90a4 0%, #357a8c 100%);
  color: white;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  font-style: normal;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  animation: popIn 0.5s ease backwards;
  margin: 0 2px;
  white-space: nowrap;
}

.shared-guess-preview-word.free-word {
  background: linear-gradient(180deg, #b8d4e8 0%, #9ec5db 100%);
  color: #2c5282;
}

@keyframes popIn {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.shared-guess-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 10px;
}

.shared-guess-btn {
  padding: 14px 28px;
  font-size: 1.05rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  flex: 1;
  max-width: 200px;
}

.shared-guess-btn.primary {
  background: linear-gradient(180deg, #6bcf6b 0%, #4db84d 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(77, 184, 77, 0.4);
}

.shared-guess-btn.primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 16px rgba(77, 184, 77, 0.5);
  background: linear-gradient(180deg, #7dd97d 0%, #5ac25a 100%);
}

.shared-guess-btn.secondary {
  background: linear-gradient(180deg, #fff 0%, #f5f5f5 100%);
  color: #4a90a4;
  border: 2px solid #4a90a4;
  box-shadow: 0 4px 12px rgba(74, 144, 164, 0.2);
}

.shared-guess-btn.secondary:hover {
  transform: translateY(-2px) scale(1.02);
  background: linear-gradient(180deg, #f8f8f8 0%, #e8e8e8 100%);
  box-shadow: 0 6px 16px rgba(74, 144, 164, 0.3);
}

.shared-guess-btn:active {
  transform: translateY(0) scale(0.98);
}

@media (max-width: 600px) {
  .shared-guess-overlay {
    padding: 10px 0;
  }

  .shared-guess-content {
    padding: 25px 20px;
    width: 95%;
  }

  .shared-guess-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
  }

  .shared-guess-content h2 {
    font-size: 1.6rem;
    margin-bottom: 8px;
  }

  .shared-guess-subtitle {
    font-size: 0.9rem;
    margin-bottom: 15px;
  }

  .shared-guess-display {
    padding: 20px 15px;
    margin: 15px 0;
    font-size: 0.95rem;
  }

  .shared-guess-actions {
    flex-direction: column;
    margin-top: 5px;
  }

  .shared-guess-btn {
    max-width: 100%;
    padding: 12px 24px;
    font-size: 1rem;
  }
}

.confetti {
  position: fixed;
  pointer-events: none;
  z-index: 101;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #f00;
  animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

.history-section {
  background: rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  padding: 15px 20px;
  margin-bottom: 25px;
}

.history-section.hidden {
  display: none;
}

.history-label {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.history-attempts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.attempt-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  align-items: center;
}

.attempt-number {
  font-size: 0.75rem;
  color: #999;
  margin-right: 8px;
  min-width: 20px;
}

.attempt-word {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.9rem;
}

.attempt-word.correct {
  background: linear-gradient(180deg, #6bcf6b 0%, #4db84d 100%);
  color: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.attempt-word.wrong {
  background: #e0e0e0;
  color: #888;
  text-decoration: line-through;
}

/* Archive Overlay */
.archive-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 200;
}

.archive-overlay.show {
  opacity: 1;
  visibility: visible;
}

.archive-content {
  background: white;
  padding: 30px;
  border-radius: 16px;
  max-width: 700px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.archive-content h2 {
  margin: 0 0 20px 0;
  text-align: center;
  color: #333;
  font-size: 2rem;
}

.archive-progress {
  text-align: center;
  margin-bottom: 25px;
  color: #666;
  font-size: 0.95rem;
}

.archive-progress-bar {
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  margin-top: 8px;
  overflow: hidden;
}

.archive-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4a90a4 0%, #6bcf6b 100%);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 25px;
}

.archive-card {
  position: relative;
  padding: 20px 15px;
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.archive-card.completed {
  background: linear-gradient(180deg, #6bcf6b 0%, #4db84d 100%);
  color: white;
}

.archive-card.incomplete {
  background: linear-gradient(180deg, #f5f5f5 0%, #e8e8e8 100%);
  color: #666;
}

.archive-card.current {
  border: 3px solid #4a90a4;
  box-shadow: 0 0 0 2px rgba(74, 144, 164, 0.3), 0 2px 6px rgba(0, 0, 0, 0.1);
}

.archive-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.archive-card-number {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 5px;
}

.archive-card-title {
  font-size: 0.75rem;
  opacity: 0.9;
  font-weight: 600;
  line-height: 1.3;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.archive-card-checkmark {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 1.2rem;
}

.archive-close-btn {
  width: 100%;
  padding: 12px;
  background: #4a90a4;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
  font-family: inherit;
}

.archive-close-btn:hover {
  background: #3a7084;
}

@media (max-width: 600px) {
  .game-container {
    padding: 10px;
  }

  header {
    padding: 12px 15px;
    gap: 10px;
  }

  header h1 {
    font-size: 1rem;
    flex-shrink: 1;
    min-width: 0;
  }

  header .puzzle-number {
    font-size: 0.75rem;
  }

  .header-btn {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    font-size: 0.95rem;
  }

  .header-archive-btn {
    font-size: 0.85rem;
  }

  .answer-section {
    padding: 15px;
  }

  .scrap-row {
    padding: 12px;
  }

  .word-magnet {
    padding: 6px 10px;
    font-size: 0.85rem;
  }

  .answer-slot {
    height: 35px;
    min-width: 50px;
  }

  .archive-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
  }

  .archive-card {
    padding: 15px 10px;
    min-height: 70px;
  }

  .archive-card-number {
    font-size: 1.3rem;
  }
}

/* No Puzzle Error */
.no-puzzle-error {
  text-align: center;
  padding: 40px 20px;
  margin: 20px 0;
}

.no-puzzle-error .error-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: 0.8;
}

.no-puzzle-error h2 {
  font-size: 1.8rem;
  color: #666;
  margin-bottom: 15px;
}

.no-puzzle-error p {
  font-size: 1.1rem;
  color: #888;
  line-height: 1.6;
}
