:root {
    --bg: #ffe8d4;
    --ink: #2c1a0e;
    --accent: #c4622d;
    --soft: #f5d5be;
    --border: #d4a882;
    --green: #4a7c59;
    --yellow: #c4962d;
    --red: #b03a2e;
    --green-bg: #d4edda;
    --yellow-bg: #fff3cd;
    --red-bg: #f8d7da;
  }

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

  body {
    background-color: var(--bg);
    background-image: 
      radial-gradient(ellipse at 20% 20%, rgba(196,98,45,0.08) 0%, transparent 50%),
      radial-gradient(ellipse at 80% 80%, rgba(196,98,45,0.06) 0%, transparent 50%),
      url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c4622d' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cormorant Garamond', serif;
    padding: 2rem;
  }

  .game-container {
    max-width: 560px;
    width: 100%;
  }

  .header {
    text-align: center;
    margin-bottom: 2.5rem;
  }

  .header .ornament {
    color: var(--accent);
    font-size: 1.2rem;
    letter-spacing: 0.4em;
    display: block;
    margin-bottom: 0.5rem;
    opacity: 0.7;
  }

  .header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    color: var(--ink);
    line-height: 1;
    margin-bottom: 0.3rem;
  }

  .header .subtitle {
    font-style: italic;
    color: var(--accent);
    font-size: 1rem;
    letter-spacing: 0.05em;
  }

  .riddle-card {
    background: rgba(255,255,255,0.5);
    border: 1.5px solid var(--border);
    border-radius: 2px;
    padding: 2rem 2.5rem;
    margin-bottom: 2rem;
    position: relative;
    box-shadow: 4px 4px 0 rgba(196,98,45,0.12);
  }

  .riddle-label {
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.8rem;
    display: block;
  }

  .riddle-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    line-height: 1.7;
    color: var(--ink);
    font-style: italic;
  }

  .attempts-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
  }

  .attempts-label {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
  }

  .attempt-dots {
    display: flex;
    gap: 0.4rem;
  }

  .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: transparent;
    transition: all 0.3s ease;
  }

  .dot.used { background: var(--accent); border-color: var(--accent); }
  .dot.correct { background: var(--green); border-color: var(--green); }

  .guesses-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
    min-height: 10px;
  }

  .guess-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideIn 0.3s ease;
  }

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

  .guess-word {
    flex: 1;
    padding: 0.6rem 1.2rem;
    border-radius: 2px;
    font-family: 'Playfair Display', serif;
    font-size: 1.05rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: center;
  }

  .guess-word.correct {
    background: var(--green-bg);
    color: var(--green);
    border: 1.5px solid var(--green);
  }

  .guess-word.synonym {
    background: var(--yellow-bg);
    color: var(--yellow);
    border: 1.5px solid var(--yellow);
  }

  .guess-word.wrong {
    background: var(--red-bg);
    color: var(--red);
    border: 1.5px solid var(--red);
  }

  .guess-hint {
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: #888;
    font-style: italic;
    white-space: nowrap;
  }

  .input-area {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  .word-input {
    flex: 1;
    padding: 0.8rem 1.2rem;
    background: rgba(255,255,255,0.7);
    border: 1.5px solid var(--border);
    border-radius: 2px;
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: var(--ink);
    outline: none;
    transition: border-color 0.2s;
  }

  .word-input:focus { border-color: var(--accent); }
  .word-input::placeholder { color: #c4a882; font-style: italic; }

  .submit-btn {
    padding: 0.8rem 1.8rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 2px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 3px 3px 0 rgba(44,26,14,0.2);
  }

  .submit-btn:hover { background: #a84e22; transform: translate(-1px,-1px); box-shadow: 4px 4px 0 rgba(44,26,14,0.2); }
  .submit-btn:active { transform: translate(1px,1px); box-shadow: 1px 1px 0 rgba(44,26,14,0.2); }
  .submit-btn:disabled { background: var(--border); cursor: not-allowed; transform: none; box-shadow: none; }

  .error-msg {
    font-size: 0.85rem;
    color: var(--red);
    font-style: italic;
    text-align: center;
    height: 1.2em;
    transition: opacity 0.3s;
  }

  .legend {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
  }

  .legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: #8a6a52;
  }

  .legend-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
  }

  .legend-dot.g { background: var(--green); }
  .legend-dot.y { background: var(--yellow); }
  .legend-dot.r { background: var(--red); }

  .result-banner {
    text-align: center;
    padding: 1.5rem;
    border-radius: 2px;
    margin-bottom: 1rem;
    animation: fadeIn 0.5s ease;
  }

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

  .result-banner.win {
    background: var(--green-bg);
    border: 1.5px solid var(--green);
    color: var(--green);
  }

  .result-banner.lose {
    background: var(--red-bg);
    border: 1.5px solid var(--red);
    color: var(--red);
  }

  .result-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    margin-bottom: 0.3rem;
  }

  .result-sub {
    font-size: 0.9rem;
    font-style: italic;
    opacity: 0.8;
  }

  .new-game-btn {
    display: block;
    width: 100%;
    padding: 0.8rem;
    margin-top: 1rem;
    background: transparent;
    border: 1.5px solid var(--accent);
    color: var(--accent);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.2s;
  }

  .new-game-btn:hover { background: var(--accent); color: white; }

  .share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.8rem;
    margin-top: 0.75rem;
    background: var(--accent);
    border: none;
    color: white;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.2s;
    box-shadow: 3px 3px 0 rgba(44,26,14,0.2);
  }

  .share-btn:hover { background: #a84e22; transform: translate(-1px,-1px); box-shadow: 4px 4px 0 rgba(44,26,14,0.2); }
  .share-btn:active { transform: translate(1px,1px); box-shadow: 1px 1px 0 rgba(44,26,14,0.2); }

  .share-btn.copied {
    background: var(--green);
    box-shadow: 3px 3px 0 rgba(44,26,14,0.15);
    transform: none;
  }

  .emoji-grid {
    font-size: 1.3rem;
    letter-spacing: 0.15em;
    margin: 0.75rem 0 0.25rem;
    line-height: 1.8;
  }

  .footer {
    display: flex;
    position: fixed;
    bottom: 0px;
    width: 100%;
    height: 28px;
    background: #fee5d1d4;
    align-items: center;
    justify-content: center;
  }

  .rb-technologies {
    margin-left: 4px;
    color: #c4622d;
  }


  @media (max-width: 430px) {
          .input-area {
            flex-direction: column;
          }
        }