/* VoiceEarn Pro — Frontend Styles */
:root {
  --vep-primary: #6C47FF;
  --vep-primary-dark: #5535e0;
  --vep-secondary: #00D4AA;
  --vep-accent: #FF6B6B;
  --vep-success: #22C55E;
  --vep-warning: #F59E0B;
  --vep-dark: #0F0E17;
  --vep-card: #1A1B2E;
  --vep-card2: #222338;
  --vep-text: #E8E8F0;
  --vep-text-muted: #9899A8;
  --vep-border: rgba(255,255,255,0.08);
  --vep-radius: 16px;
  --vep-radius-sm: 8px;
  --vep-shadow: 0 8px 32px rgba(0,0,0,0.4);
  --vep-font: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ---- Reset ---- */
.vep-wrap * { box-sizing: border-box; margin: 0; padding: 0; }
.vep-wrap { font-family: var(--vep-font); color: var(--vep-text); }

/* ---- Mic Bar ---- */
.vep-mic-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  background: linear-gradient(135deg, var(--vep-primary), var(--vep-primary-dark));
  color: #fff; padding: 12px 20px;
  display: flex; align-items: center; gap: 12px; font-size: 14px;
  box-shadow: 0 2px 12px rgba(108,71,255,0.4);
}
.vep-mic-bar .vep-mic-icon { font-size: 18px; }
.vep-mic-bar span { flex: 1; }
.vep-mic-dismiss { background: none; border: none; color: #fff; cursor: pointer; font-size: 18px; opacity: .7; }
.vep-mic-dismiss:hover { opacity: 1; }

/* ---- Auth Page ---- */
.vep-auth-wrap {
  min-height: 100vh;
  background: radial-gradient(ellipse at top left, #1a0a40, var(--vep-dark));
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.vep-auth-container {
  background: var(--vep-card);
  border: 1px solid var(--vep-border);
  border-radius: var(--vep-radius);
  padding: 40px;
  width: 100%; max-width: 460px;
  box-shadow: var(--vep-shadow);
}
.vep-logo { text-align: center; margin-bottom: 32px; }
.vep-logo-icon { font-size: 56px; line-height: 1; margin-bottom: 8px; }
.vep-logo-title { font-size: 28px; font-weight: 800; color: #fff; }
.vep-logo-title span { color: var(--vep-secondary); }
.vep-logo-tagline { color: var(--vep-text-muted); font-size: 14px; margin-top: 4px; }

.vep-auth-tabs {
  display: flex; background: rgba(255,255,255,0.05); border-radius: var(--vep-radius-sm);
  padding: 4px; margin-bottom: 28px;
}
.vep-tab-btn {
  flex: 1; padding: 10px; border: none; background: transparent; color: var(--vep-text-muted);
  border-radius: 6px; cursor: pointer; font-size: 14px; font-weight: 600; transition: all .2s;
}
.vep-tab-btn.active { background: var(--vep-primary); color: #fff; }

.vep-tab-content { display: none; }
.vep-tab-content.active { display: block; }

.vep-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vep-form-group { margin-bottom: 18px; }
.vep-form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--vep-text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px; }
.vep-form-group input, .vep-form-group select {
  width: 100%; padding: 12px 14px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--vep-border);
  border-radius: var(--vep-radius-sm); color: var(--vep-text); font-size: 14px;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.vep-form-group input:focus { border-color: var(--vep-primary); box-shadow: 0 0 0 3px rgba(108,71,255,.2); }
.vep-input-icon { position: relative; }
.vep-input-icon input { padding-right: 40px; }
.vep-eye-btn { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 14px; color: var(--vep-text-muted); }
.vep-checkbox { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--vep-text-muted); }

.vep-form-notice { padding: 10px 14px; border-radius: var(--vep-radius-sm); font-size: 13px; margin-bottom: 12px; display: none; }
.vep-form-notice.error { background: rgba(255,107,107,.15); color: #FF6B6B; border: 1px solid rgba(255,107,107,.3); }
.vep-form-notice.success { background: rgba(34,197,94,.15); color: #22C55E; border: 1px solid rgba(34,197,94,.3); }

/* ---- Buttons ---- */
.vep-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--vep-radius-sm); font-size: 14px; font-weight: 600;
  cursor: pointer; border: none; transition: all .2s; text-decoration: none;
}
.vep-btn-primary { background: var(--vep-primary); color: #fff; }
.vep-btn-primary:hover { background: var(--vep-primary-dark); transform: translateY(-1px); }
.vep-btn-success { background: var(--vep-success); color: #fff; }
.vep-btn-success:hover { background: #16A34A; }
.vep-btn-secondary { background: var(--vep-card2); color: var(--vep-text); border: 1px solid var(--vep-border); }
.vep-btn-ghost { background: transparent; color: var(--vep-text-muted); border: 1px solid var(--vep-border); }
.vep-btn-ghost:hover { color: var(--vep-text); border-color: rgba(255,255,255,.2); }
.vep-btn-white { background: #fff; color: var(--vep-primary); font-size: 13px; padding: 8px 14px; }
.vep-btn-link { background: none; border: none; color: var(--vep-secondary); font-size: 13px; padding: 6px 8px; text-decoration: underline; cursor: pointer; }
.vep-btn-full { width: 100%; }
.vep-btn-sm { padding: 7px 14px; font-size: 13px; }
.vep-btn-xs { padding: 4px 10px; font-size: 12px; }
.vep-btn.disabled, .vep-btn:disabled { opacity: .4; cursor: not-allowed; transform: none !important; }

/* ---- Notice ---- */
.vep-notice { padding: 12px 16px; background: var(--vep-card); border: 1px solid var(--vep-border); border-radius: var(--vep-radius-sm); }

/* ---- Dashboard ---- */
.vep-dashboard-wrap {
  min-height: 100vh;
  background: radial-gradient(ellipse at top, #110d2a, var(--vep-dark));
  padding: 0 0 40px;
}

.vep-header {
  background: rgba(26,27,46,.95); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--vep-border);
  padding: 14px 24px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}
.vep-logo-sm { font-size: 16px; color: var(--vep-text); }

.vep-wallet-badge {
  display: flex; align-items: center; gap: 8px;
  background: rgba(108,71,255,.15); border: 1px solid rgba(108,71,255,.3);
  border-radius: 20px; padding: 8px 16px;
}
.vep-wallet-label { font-size: 12px; color: var(--vep-text-muted); font-weight: 600; text-transform: uppercase; }
.vep-wallet-amount { font-size: 16px; font-weight: 800; color: var(--vep-secondary); }
.vep-header-right { display: flex; align-items: center; gap: 16px; }
.vep-user-badge { display: flex; align-items: center; gap: 10px; }
.vep-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--vep-primary);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
}
.vep-user-name { font-size: 14px; color: var(--vep-text); }

.vep-dashboard-grid {
  display: grid; grid-template-columns: 340px 1fr; gap: 24px;
  padding: 24px; max-width: 1200px; margin: 0 auto;
}

/* ---- Card ---- */
.vep-card {
  background: var(--vep-card); border: 1px solid var(--vep-border);
  border-radius: var(--vep-radius); padding: 24px;
  box-shadow: var(--vep-shadow);
}
.vep-card + .vep-card { margin-top: 20px; }
.vep-card-header {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px; font-weight: 600; color: var(--vep-text-muted);
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--vep-border);
}

/* ---- Wallet Panel ---- */
.vep-wallet-card { text-align: center; }
.vep-wallet-header { font-size: 13px; font-weight: 600; color: var(--vep-text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 20px; }
.vep-wallet-balance-display { margin-bottom: 24px; }
.vep-balance-currency { font-size: 14px; color: var(--vep-text-muted); }
.vep-balance-amount {
  font-size: 52px; font-weight: 900; color: var(--vep-secondary);
  line-height: 1.1; letter-spacing: -2px;
  transition: all .3s;
}
.vep-balance-amount.bump { animation: vep-bump .3s ease; }
.vep-balance-subtitle { font-size: 12px; color: var(--vep-text-muted); margin-top: 4px; }

@keyframes vep-bump {
  0% { transform: scale(1); } 50% { transform: scale(1.08); } 100% { transform: scale(1); }
}

.vep-wallet-actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.vep-withdraw-hint { font-size: 11px; display: block; opacity: .7; }

.vep-withdraw-progress { margin-bottom: 20px; }
.vep-progress-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--vep-text-muted); margin-bottom: 8px; }
.vep-progress-bar { background: rgba(255,255,255,.08); border-radius: 10px; height: 8px; overflow: hidden; }
.vep-progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--vep-primary), var(--vep-secondary));
  border-radius: 10px; transition: width .5s ease;
}

.vep-wallet-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 16px; }
.vep-stat {
  background: rgba(255,255,255,.04); border-radius: 10px; padding: 12px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.vep-stat-icon { font-size: 18px; }
.vep-stat-value { font-size: 20px; font-weight: 800; color: var(--vep-text); }
.vep-stat-label { font-size: 11px; color: var(--vep-text-muted); }

/* ---- Transactions ---- */
.vep-tx-card { }
.vep-tx-list { max-height: 260px; overflow-y: auto; }
.vep-tx-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--vep-border); font-size: 13px;
}
.vep-tx-item:last-child { border-bottom: none; }
.vep-tx-icon { font-size: 16px; margin-right: 8px; }
.vep-tx-info { flex: 1; }
.vep-tx-note { color: var(--vep-text); font-size: 13px; }
.vep-tx-date { color: var(--vep-text-muted); font-size: 11px; }
.vep-tx-amount { font-weight: 700; }
.vep-tx-amount.pos { color: var(--vep-success); }
.vep-tx-amount.neg { color: var(--vep-accent); }
.vep-tx-loading { text-align: center; color: var(--vep-text-muted); padding: 20px; }

/* ---- Game Panel ---- */
.vep-game-panel { }
.vep-game-card { }

.vep-game-status-bar {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--vep-text-muted); margin-bottom: 20px;
  padding-bottom: 12px; border-bottom: 1px solid var(--vep-border);
  flex-wrap: wrap; gap: 8px;
}
.vep-status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.vep-status-ok { background: var(--vep-success); box-shadow: 0 0 6px var(--vep-success); }
.vep-status-error { background: var(--vep-accent); }
.vep-status-unknown { background: var(--vep-warning); animation: vep-pulse 1.5s infinite; }
.vep-reward-badge { background: rgba(34,197,94,.1); color: var(--vep-success); border: 1px solid rgba(34,197,94,.2); border-radius: 20px; padding: 5px 12px; }

@keyframes vep-pulse { 0%,100% { opacity:1; } 50% { opacity:.4; } }

.vep-word-display {
  text-align: center; min-height: 160px;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  padding: 20px;
}
.vep-spinner {
  width: 40px; height: 40px; border: 3px solid var(--vep-border);
  border-top-color: var(--vep-primary); border-radius: 50%;
  animation: vep-spin .8s linear infinite; margin: 0 auto 12px;
}
@keyframes vep-spin { to { transform: rotate(360deg); } }

.vep-word-prompt { font-size: 13px; color: var(--vep-text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
.vep-word-text {
  font-size: clamp(32px, 5vw, 56px); font-weight: 900; color: #fff;
  letter-spacing: -1px; line-height: 1.1;
}
.vep-phonetic {
  font-size: 18px; color: var(--vep-primary); margin-top: 10px;
  font-style: italic; display: none;
}
.vep-phonetic.show { display: block; }

/* ---- Feedback ---- */
.vep-feedback {
  text-align: center; padding: 20px;
  animation: vep-fade-in .3s ease;
}
@keyframes vep-fade-in { from { opacity:0; transform: scale(.9); } to { opacity:1; transform: scale(1); } }
.vep-feedback-icon { font-size: 72px; line-height: 1; margin-bottom: 8px; }
.vep-feedback-message { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.vep-feedback-message.correct { color: var(--vep-success); }
.vep-feedback-message.incorrect { color: var(--vep-accent); }
.vep-feedback-heard { font-size: 14px; color: var(--vep-text-muted); font-style: italic; }

/* ---- Recording ---- */
.vep-recording-area { text-align: center; padding: 20px 0; }
.vep-waveform {
  display: flex; align-items: flex-end; justify-content: center; gap: 4px;
  height: 50px; margin-bottom: 12px;
}
.vep-wave-bar {
  width: 6px; background: var(--vep-primary); border-radius: 3px;
  height: 8px; transition: height .15s ease;
}
.vep-recording .vep-wave-bar { animation: vep-wave .6s ease-in-out infinite alternate; }
.vep-wave-bar:nth-child(2) { animation-delay: .1s; }
.vep-wave-bar:nth-child(3) { animation-delay: .2s; }
.vep-wave-bar:nth-child(4) { animation-delay: .05s; }
.vep-wave-bar:nth-child(5) { animation-delay: .3s; }
.vep-wave-bar:nth-child(6) { animation-delay: .15s; }
.vep-wave-bar:nth-child(7) { animation-delay: .25s; }
.vep-wave-bar:nth-child(8) { animation-delay: .1s; }
.vep-wave-bar:nth-child(9) { animation-delay: .35s; }
@keyframes vep-wave { to { height: 40px; background: var(--vep-secondary); } }

.vep-recording-label { font-size: 13px; color: var(--vep-text-muted); }

.vep-transcript-box {
  text-align: center; padding: 10px 16px;
  background: rgba(255,255,255,.04); border-radius: 8px; margin: 0 0 16px; font-size: 14px;
}
.vep-transcript-label { color: var(--vep-text-muted); }
.vep-transcript-text { color: var(--vep-secondary); font-style: italic; font-weight: 600; }

.vep-game-controls {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 20px 0 10px;
}

.vep-mic-button {
  width: 80px; height: 80px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--vep-primary), var(--vep-primary-dark));
  font-size: 32px; position: relative; overflow: hidden;
  box-shadow: 0 8px 24px rgba(108,71,255,.5);
  transition: transform .2s, box-shadow .2s;
  display: flex; align-items: center; justify-content: center;
}
.vep-mic-button:hover { transform: scale(1.05); box-shadow: 0 12px 32px rgba(108,71,255,.6); }
.vep-mic-button.recording {
  background: linear-gradient(135deg, var(--vep-accent), #c0392b);
  box-shadow: 0 8px 24px rgba(255,107,107,.5);
  animation: vep-mic-pulse 1s infinite;
}
@keyframes vep-mic-pulse { 0%,100% { box-shadow: 0 8px 24px rgba(255,107,107,.5); } 50% { box-shadow: 0 8px 36px rgba(255,107,107,.8); } }
.vep-mic-ripple {
  position: absolute; width: 100%; height: 100%; border-radius: 50%;
  background: rgba(255,255,255,.2); transform: scale(0);
}

.vep-hint-row { text-align: center; padding: 8px 0; }
.vep-text-muted { color: var(--vep-text-muted); font-size: 13px; }

/* ---- Instructions ---- */
.vep-instructions { margin-top: 20px; }
.vep-instructions h3 { font-size: 16px; margin-bottom: 16px; }
.vep-instructions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vep-instruction-item {
  display: flex; align-items: flex-start; gap: 10px;
  background: rgba(255,255,255,.03); padding: 12px; border-radius: 10px; font-size: 13px;
}
.vep-inst-icon { font-size: 18px; flex-shrink: 0; }

/* ---- Modals ---- */
.vep-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 9998;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.vep-modal {
  background: var(--vep-card); border: 1px solid var(--vep-border); border-radius: var(--vep-radius);
  width: 100%; max-width: 420px; box-shadow: var(--vep-shadow);
  animation: vep-modal-in .25s ease;
}
@keyframes vep-modal-in { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:none; } }
.vep-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--vep-border); }
.vep-modal-header h3 { font-size: 18px; font-weight: 700; }
.vep-modal-close { background: none; border: none; color: var(--vep-text-muted); font-size: 18px; cursor: pointer; }
.vep-modal-body { padding: 20px 24px; }
.vep-modal-body p { font-size: 14px; color: var(--vep-text-muted); margin-bottom: 16px; }
.vep-modal-footer { padding: 16px 24px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--vep-border); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .vep-dashboard-grid { grid-template-columns: 1fr; }
  .vep-header { flex-wrap: wrap; gap: 12px; }
  .vep-wallet-badge { order: 3; }
}
@media (max-width: 600px) {
  .vep-auth-container { padding: 24px 20px; }
  .vep-form-row { grid-template-columns: 1fr; }
  .vep-instructions-grid { grid-template-columns: 1fr; }
  .vep-dashboard-grid { padding: 12px; }
  .vep-header { padding: 12px 16px; }
  .vep-user-name { display: none; }
}

/* =============================================================
   COUNTDOWN TIMER
   ============================================================= */
.vep-countdown-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 0;
}

.vep-countdown-ring {
    position: relative;
    width: 90px;
    height: 90px;
}

.vep-countdown-ring svg {
    transform: rotate(-90deg);
}

.vep-countdown-num {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    font-weight: 800;
    color: #4ade80;
    line-height: 1;
}

.vep-countdown-label {
    font-size: 14px;
    font-weight: 600;
    color: #94a3b8;
    margin: 0;
}

.vep-countdown-warning {
    font-size: 12px;
    color: #f59e0b;
    margin: 0;
    opacity: 0.85;
}

/* Mic button countdown state */
.vep-mic-button.countdown {
    opacity: 0.6;
    cursor: default;
    transform: scale(0.95);
}


/* =============================================================
   HIDDEN WORD STATE (before countdown)
   ============================================================= */
.vep-word-hidden {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 24px 16px;
}
.vep-hidden-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 6px 16px;
}
.vep-lock-icon { font-size: 16px; }
.vep-hidden-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
    letter-spacing: 0.04em;
}
.vep-hidden-letters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    max-width: 340px;
}
.vep-letter-block {
    width: 28px;
    height: 36px;
    border-radius: 6px;
    border: 2px solid #334155;
    background: rgba(255,255,255,0.03);
    display: inline-block;
    position: relative;
}
.vep-letter-block::after {
    content: '';
    position: absolute;
    inset: 6px 5px;
    background: #334155;
    border-radius: 3px;
    opacity: 0.6;
}
.vep-letter-space {
    width: 16px;
    display: inline-block;
}
.vep-hidden-length {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}
.vep-hidden-hint {
    font-size: 13px;
    color: #94a3b8;
    text-align: center;
    margin: 0;
    line-height: 1.5;
}

/* WORD REVEAL — shown during countdown only */
.vep-word-reveal {
    animation: vep-word-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}
@keyframes vep-word-pop {
    0%   { opacity: 0; transform: scale(0.7) translateY(10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Difficulty pip badge */
.vep-diff-pip {
    display: flex;
    justify-content: center;
    margin-top: 4px;
}
.vep-diff-pip span {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 10px;
    letter-spacing: 0.03em;
}

/* =============================================================
   WORD REVEAL SYSTEM — Letter Tiles & States
   ============================================================= */

/* Idle state — locked */
.vep-word-idle {
    text-align: center;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.vep-word-lock {
    font-size: 40px;
    line-height: 1;
    opacity: 0.7;
}
.vep-idle-hint {
    font-size: 13px;
    color: #64748b;
    max-width: 280px;
    line-height: 1.5;
    margin: 0;
}

/* Memory state — word hidden during recording */
.vep-word-memory {
    text-align: center;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.vep-memory-label {
    font-size: 15px;
    font-weight: 700;
    color: #f59e0b;
    margin: 0;
}

/* Letter tiles */
.vep-word-blocks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}
.vep-letter-tile {
    width: 34px;
    height: 38px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    background: #1e293b;
    color: #94a3b8;
    border: 1px solid #334155;
    letter-spacing: 0;
}
.vep-letter-blur {
    color: transparent;
    background: #1e293b;
    border: 1px dashed #334155;
    text-shadow: 0 0 8px rgba(148,163,184,0.6);
    position: relative;
}
.vep-letter-blur::after {
    content: '?';
    position: absolute;
    color: #475569;
    font-size: 14px;
}
.vep-letter-space {
    width: 12px;
    display: inline-block;
}

/* Word reveal animation during countdown */
.vep-word-content .vep-word-reveal {
    animation: wordReveal 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes wordReveal {
    from { opacity: 0; transform: scale(0.85) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Word reveal header */
.vep-word-reveal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 6px;
}
.vep-memorise-tag {
    font-size: 12px;
    font-weight: 700;
    color: #f59e0b;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    animation: blink 1s step-end infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.vep-word-warn {
    font-size: 11px;
    color: #64748b;
    margin: 4px 0 0;
    opacity: 0.7;
}

/* Difficulty badge */
.vep-diff-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

/* Difficulty pip containers */
.vep-difficulty-pip,
#vep-difficulty-pip,
#vep-difficulty-pip-reveal { margin-bottom: 4px; }

/* Feedback word reveal */
.vep-feedback-word {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 6px 0;
}
.vep-feedback-word-text {
    font-size: 22px;
    font-weight: 800;
}

/* Level-up banner */
.vep-levelup-banner {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #1e3a5f, #1e4d2b);
    color: #fff;
    padding: 12px 28px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    z-index: 9999;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
    animation: slideDown 0.4s ease;
}
@keyframes slideDown {
    from { opacity:0; top:0; }
    to   { opacity:1; top:24px; }
}

/* =============================================================
   WORD STATE MACHINE — idle / reveal / memory
   ============================================================= */

/* IDLE state — locked tiles */
.vep-word-idle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 0;
}
.vep-word-lock {
    font-size: 40px;
    line-height: 1;
    opacity: 0.7;
}
.vep-idle-hint {
    font-size: 13px;
    color: #64748b;
    text-align: center;
    max-width: 280px;
}
.vep-word-blocks {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
}
.vep-letter-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 38px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 700;
    color: #f8fafc;
    transition: filter 0.3s;
}
.vep-tile-blur {
    filter: blur(6px);
    color: #94a3b8;
    user-select: none;
}
.vep-tile-space {
    width: 16px;
}
.vep-difficulty-pip {
    margin-bottom: 4px;
}
.vep-diff-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* REVEAL state — word fully visible */
.vep-word-reveal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.vep-memorise-tag {
    font-size: 12px;
    font-weight: 700;
    color: #facc15;
    background: rgba(250,204,21,0.1);
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid rgba(250,204,21,0.3);
    animation: pulse-tag 1s ease-in-out infinite alternate;
}
@keyframes pulse-tag {
    from { opacity: 0.7; } to { opacity: 1; }
}
.vep-word-reveal {
    animation: word-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes word-pop {
    0%   { transform: scale(0.7); opacity: 0; }
    100% { transform: scale(1);   opacity: 1; }
}
.vep-word-warn {
    font-size: 11px;
    color: #475569;
    margin-top: 4px;
}

/* MEMORY state — blurred tiles */
.vep-word-memory {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px 0;
}
.vep-memory-label {
    font-size: 14px;
    font-weight: 600;
    color: #94a3b8;
}
.vep-word-blocks-blur .vep-letter-tile {
    filter: blur(8px);
}

/* RESULT word display */
.vep-result-word {
    display: block;
    font-size: 28px;
    font-weight: 800;
    color: #f8fafc;
    margin-top: 8px;
}
.vep-result-phonetic {
    display: block;
    font-size: 14px;
    color: #64748b;
    font-style: italic;
}
