/* Dark Theme Variables */
:root {
  --bg: #0f0f10;
  --panel: #1a1a1c;
  --panel-light: #222224;
  --border: #2f2f33;
  --text: #f2f2f2;
  --muted: #b5b5b8;
  --accent: #ffffff;
  --green: #4ade80;
  --orange: #fbbf24;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #000;
  color: #fff;
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

.app {
  width: 100%;
  max-width: 500px;
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
}

/* Header & Icons */
.header-top-row {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
    gap: 15px;
}

.streak-badge {
    display: flex;
    align-items: top;
    gap: 0px;
    font-size: 13px;
    font-weight: bold;
    color: #fff;
    margin-right: 5px;
}

.streak-icon { width: 24px; height: 24px; object-fit: contain; }

.icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: bold;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.icon-btn:hover { border-color: #fff; color: #fff; background-color: #222; }

.header h1 {
  font-size: clamp(1.6rem, 7vw, 2.5rem);
  margin: 0;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.header p { margin: 5px 0 24px; color: var(--muted); }

/* Board */
.board { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }

.pair-card {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 18px;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  border-radius: 8px;
  width: 100%;
}

.link-icon { width: 24px; height: 24px; object-fit: contain; vertical-align: middle; }

/* Input Area */
.input-container { display: flex; gap: 8px; margin-bottom: 15px; position: relative; }

.guess-input {
  flex: 2;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: #fff;
  font-size: 16px;
  border-radius: 8px;
}

.submit-btn {
  flex: 1;
  padding: 18px;
  background: var(--panel-light);
  border: 1px solid var(--border);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
}

/* NEW: Shake Animation */
.shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

/* Feedback History */
.feedback { text-align: left; margin-top: 10px; }

.guess-row {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px;
    background: #151516; border: 1px solid var(--border); border-radius: 6px;
    margin-bottom: 8px; font-size: 14px; font-weight: 500;
}

.feedback-title { font-size: 15px; display: block; margin-bottom: 10px; color: var(--muted); }

/* Stats & Footer */
.stats-container { display: flex; justify-content: space-around; margin: 10px 0 20px; }
.stat-box { display: flex; flex-direction: column; align-items: center; }
.stat-number { font-size: 24px; font-weight: bold; color: #fff; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stats-header { margin: 20px 0 10px; color: #fff; font-size: 18px; font-weight: bold; text-transform: capitalize; }

.footer { margin-top: auto; padding: 30px 0 20px; color: #888; font-size: 15px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.footer p { margin: 0; }

.support-link {
    display: inline-block; color: #0070ba; text-decoration: none; font-size: 14px; font-weight: bold;
    border: 1px solid #0070ba; padding: 8px 16px; border-radius: 20px; transition: all 0.2s ease; background: transparent;
}
.support-link:hover { background-color: #0070ba; color: #fff; }

/* Modal */
.modal {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.85); display: none;
  justify-content: center; align-items: center; z-index: 1000;
}
.modal.show { display: flex; }
.modal-content {
  background: var(--panel); border: 1px solid var(--border); padding: 30px;
  border-radius: 12px; text-align: center; max-width: 90%; width: 340px; position: relative;
}
.modal-donate { width: 100%; margin-top: 10px; text-align: center; box-sizing: border-box; }

/* Instructions */
.instructions-body { text-align: left; margin: 20px 0; font-size: 15px; line-height: 1.5; color: var(--muted); }
.highlight-text { color: #fff; font-weight: bold; margin-bottom: 15px; }
.instructions-sub-header { color: #fff; font-weight: bold; margin-top: 15px; margin-bottom: 5px; }
.legend-box { background: #151516; padding: 12px; border-radius: 8px; border: 1px solid var(--border); margin-bottom: 15px; font-size: 14px; }
.legend-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; color: #eee; }
.legend-row:last-child { margin-bottom: 0; }
.color-box { width: 20px; height: 20px; border-radius: 4px; display: inline-block; border: 1px solid #444; flex-shrink: 0; }
.color-box.green { background-color: var(--green); }
.color-box.orange { background-color: var(--orange); }
.color-box.red { background-color: #ff4d4d; }
.color-box.white { background-color: #ffffff; border: 1px solid #ccc; }
.example-box { background: #000; padding: 15px; border-radius: 8px; margin: 5px 0 15px 0; border: 1px solid var(--border); text-align: center; }
.example-text { margin: 10px 0 0; color: var(--green); font-weight: bold; }
.hint-text { font-size: 0.9rem; color: #ccc; margin-top: 5px; font-style: italic; }
.instructions-list { padding-left: 20px; margin-bottom: 0; }
.instructions-list li { margin-bottom: 8px; }

/* Buttons */
.share-btn { background: var(--green); color: #000; border: none; padding: 14px; font-weight: 700; font-size: 16px; border-radius: 6px; cursor: pointer; width: 100%; margin-top: 10px; }
.secondary-btn { background: transparent; color: #888; border: 1px solid var(--border); padding: 12px; font-size: 14px; border-radius: 6px; cursor: pointer; width: 100%; margin-top: 10px; }
.hidden { display: none !important; }

/* Distribution Graph */
.distribution-container { width: 100%; max-width: 300px; margin: 0 auto 20px; display: flex; flex-direction: column; gap: 6px; }
.dist-row { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: bold; color: #fff; height: 24px; }
.dist-label { width: 15px; text-align: right; font-size: 12px; color: var(--muted); }
.dist-bar-container { flex-grow: 1; display: flex; justify-content: flex-start; }
.dist-bar {
    background-color: #3a3a3c; min-width: 24px; padding: 0 6px; text-align: right;
    display: flex; align-items: center; justify-content: flex-end; border-radius: 2px; width: 7%;
    color: #fff; font-size: 12px; transition: width 0.5s ease-in-out;
}
.dist-bar.highlight { background-color: var(--green); color: #000; }
.dist-bar.fail { background-color: #ff4d4d; color: #fff; }

/* NEW: Toast Notification */
#toast-msg {
    visibility: hidden;
    min-width: 150px;
    background-color: #fff;
    color: #000;
    text-align: center;
    border-radius: 4px;
    padding: 10px;
    position: fixed;
    z-index: 2000;
    left: 50%;
    top: 80px; /* Below header */
    transform: translateX(-50%);
    font-weight: bold;
    box-shadow: 0px 4px 10px rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
}

#toast-msg.show {
    visibility: visible;
    opacity: 1;
}
