/* ============================================================
   Worship PWA — Main Stylesheet
   Dark, high-contrast, iPad-optimized
   ============================================================ */

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

:root {
  --bg:          #1a1a2e;
  --surface:     #16213e;
  --surface2:    #0f3460;
  --accent:      #4fc3f7;
  --accent2:     #e94560;
  --text:        #ffffff;
  --text-muted:  #a0aec0;
  --border:      rgba(255,255,255,0.1);
  --nav-h:       56px;
  --radius:      10px;
  --shadow:      0 4px 24px rgba(0,0,0,0.4);
}

html, body { height: 100%; overflow: hidden; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); -webkit-tap-highlight-color: transparent; }
#app { height: 100%; overflow: hidden; }

/* ---- LOADING ---- */
.loading-screen, .loading-shell { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; background: var(--bg); }
.spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- LOGIN ---- */
.login-screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); padding: 20px; }
.login-box { background: var(--surface); border-radius: 16px; padding: 40px 32px; width: 100%; max-width: 400px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px; }
.login-logo { font-size: 48px; text-align: center; }
.login-title { font-size: 24px; font-weight: 700; text-align: center; color: var(--accent); }
.login-error { color: var(--accent2); font-size: 14px; text-align: center; min-height: 20px; }

/* ---- APP SHELL ---- */
.app-shell { display: flex; flex-direction: column; height: 100vh; overflow: hidden; background: var(--bg); }
.view-content { flex: 1; overflow-y: auto; padding: 20px; -webkit-overflow-scrolling: touch; }

/* ---- NAV ---- */
.app-nav { display: flex; align-items: center; gap: 4px; background: var(--surface); padding: 0 12px; height: var(--nav-h); flex-shrink: 0; border-bottom: 1px solid var(--border); }
.nav-logo { font-size: 24px; margin-right: 8px; }
.nav-btn { background: none; border: none; color: var(--text-muted); font-size: 15px; padding: 8px 12px; border-radius: var(--radius); cursor: pointer; transition: all 0.15s; white-space: nowrap; }
.nav-btn:hover, .nav-btn.active { background: var(--surface2); color: var(--text); }
.nav-btn.active { color: var(--accent); }
.nav-user { margin-left: auto; color: var(--text-muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.nav-sync-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-left: 8px; }
.nav-sync-dot.online  { background: #4caf50; }
.nav-sync-dot.offline { background: #ff5722; }

/* ---- INPUTS / BUTTONS ---- */
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-size: 16px; padding: 10px 14px; outline: none;
  -webkit-appearance: none; appearance: none;
}
input:focus, select:focus { border-color: var(--accent); }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M0 0l6 8 6-8z' fill='%23a0aec0'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
input[type=range] { accent-color: var(--accent); background: none; border: none; padding: 0; height: 32px; }
input[type=color] { width: 44px; height: 36px; padding: 2px; border-radius: 6px; cursor: pointer; }
input[type=search] { padding-right: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: var(--radius); font-size: 15px; font-weight: 500; cursor: pointer; border: none; transition: all 0.15s; white-space: nowrap; }
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { opacity: 0.85; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface2); }
.btn-danger { background: var(--accent2); color: #fff; }
.btn-danger:hover { opacity: 0.85; }
.btn-full { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---- LIBRARY ---- */
.library-header { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.library-header h2 { font-size: 22px; font-weight: 700; }
.library-actions { display: flex; gap: 10px; align-items: center; margin-left: auto; }
.search-input { width: 200px; }
.count-badge { font-size: 14px; color: var(--text-muted); font-weight: 400; margin-left: 6px; }
.song-list { display: flex; flex-direction: column; gap: 8px; }
.song-card { display: flex; align-items: center; background: var(--surface); border-radius: var(--radius); padding: 14px 16px; gap: 12px; cursor: pointer; transition: background 0.15s; border: 1px solid var(--border); }
.song-card:hover { background: var(--surface2); }
.song-card-info { flex: 1; min-width: 0; }
.song-title { font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 8px; }
.song-meta { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.key-edit-select { background: var(--surface2); border: 1px solid var(--border); color: #4fc3f7; border-radius: 6px; font-size: 12px; padding: 1px 4px; cursor: pointer; font-weight: 700; flex-shrink: 0; }
.empty-state { text-align: center; color: var(--text-muted); padding: 60px 20px; font-size: 16px; }

/* ---- SONG DISPLAY ---- */
.song-shell { display: flex; flex-direction: column; height: 100vh; overflow: hidden; position: relative; }
.song-topbar { display: flex; align-items: center; background: var(--surface); padding: 8px 10px; min-height: var(--nav-h); flex-shrink: 0; border-bottom: 1px solid var(--border); gap: 6px; transition: transform 0.2s ease; position: relative; z-index: 100; }
.song-topbar.hidden { transform: translateY(-100%); }
.song-topbar-center { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.song-topbar-title-row { display: flex; align-items: center; gap: 8px; max-width: 100%; overflow: hidden; }
.song-topbar-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-key-inline { font-weight: 600; color: #4fc3f7; white-space: nowrap; flex-shrink: 0; }
.song-topbar-key-row { display: flex; justify-content: center; padding: 2px 0 4px; }
.key-label-badge { background: rgba(0,0,0,0.3); padding: 2px 10px; border-radius: 12px; font-weight: 700; line-height: 1.3; white-space: nowrap; font-size: clamp(12px, var(--key-label-size, 16px), 22px); }
.key-label-topleft { display: none; } /* legacy */
.song-topbar.hidden ~ .key-label-topleft { display: none; }
.song-settings-panel { background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; overflow-y: auto; max-height: 50vh; }
.song-display { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 20px 16px; -webkit-overflow-scrolling: touch; line-height: 1.8; }
.lyric-line { white-space: normal; word-break: break-word; overflow-wrap: break-word; }

/* ---- CHORD/LYRIC RENDERING ---- */
.section-break { height: 24px; }
.section-label { font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.7; margin-bottom: 8px; padding-bottom: 4px; border-bottom: 1px solid var(--border); font-size: var(--section-size, 13px); color: var(--chord-color, #4fc3f7); }
.section-content { margin-bottom: 8px; }
.chord-lyric-line { display: flex; flex-wrap: wrap; align-items: flex-end; margin-bottom: 2px; row-gap: 0; }
.chord-pair { display: inline-flex; flex-direction: column; align-items: flex-start; vertical-align: bottom; }
.chord-text { font-family: 'Courier New', monospace; font-weight: 700; line-height: 1.2; white-space: pre; padding-right: 4px; color: var(--chord-color, #4fc3f7); font-size: var(--chord-size, 20px); margin-bottom: 1px; }
.chord-text.chord-empty { visibility: hidden; display: none; }
.lyric-text { line-height: 1.5; white-space: pre-wrap; color: var(--lyric-color, #ffffff); font-size: var(--lyric-size, 28px); font-family: var(--lyric-font, -apple-system, sans-serif); }
.lyric-line { margin-bottom: 2px; word-break: break-word; overflow-wrap: break-word; }
.blank-line { height: 12px; }

/* ---- SETTINGS PANEL ---- */
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 15px; }
.settings-card { background: var(--surface); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; border: 1px solid var(--border); }
.settings-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 12px; color: var(--accent); }

/* ---- TOGGLE SWITCH ---- */
.toggle { position: relative; display: inline-block; width: 48px; height: 26px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: #555; border-radius: 26px; transition: 0.2s; cursor: pointer; }
.toggle-slider::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: 0.2s; }
.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(22px); }

/* ---- POST-IT NOTE ---- */
.postit { position: fixed; z-index: 100; background: #fef9c3; color: #1a1a00; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.5); min-width: 120px; user-select: none; border: 1px solid #e5c100; cursor: pointer; }
.song-settings-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 320px;
  max-width: 85vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 16px;
  padding-top: calc(var(--nav-h) + 12px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 500;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
.song-settings-panel.open {
  transform: translateX(0);
}
.song-settings-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 499;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
.song-settings-overlay.open { display: block; }
.postit.minimized { min-width: 48px; }

/* Header hidden by default, shown on active */
.postit-header { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px; background: #fef9c3; border-radius: 8px 8px 0 0; cursor: grab; gap: 6px; overflow: hidden; max-height: 0; padding: 0; opacity: 0; transition: max-height 0.2s ease, opacity 0.2s ease, padding 0.2s ease; }
.postit.controls-visible .postit-header { max-height: 40px; padding: 4px 8px; opacity: 1; background: #f9e000; border-radius: 8px 8px 0 0; }
.postit.minimized.controls-visible .postit-header { border-radius: 8px; }

.postit-icon { font-size: 14px; }
.postit-minimize { background: none; border: none; cursor: pointer; font-size: 14px; color: #1a1a00; padding: 0 2px; line-height: 1; }

.postit-body { padding: 8px; }
.postit-text { min-height: 32px; outline: none; word-break: break-word; cursor: text; font-weight: 600; white-space: pre-wrap; }
.postit-text:empty::before { content: attr(data-placeholder); color: #a09000; font-style: italic; font-weight: 400; }

/* Size controls always visible, subtle by default */
.postit-size-controls { display: flex; gap: 4px; margin-top: 4px; justify-content: center; opacity: 0.25; transition: opacity 0.2s ease; }
.postit.controls-visible .postit-size-controls { opacity: 1; }

.postit-size-btn, .postit-align-btn { background: rgba(0,0,0,0.1); border: none; border-radius: 4px; cursor: pointer; padding: 2px 8px; font-size: 13px; color: #1a1a00; }
.postit-align-btn.active { background: rgba(0,0,0,0.25); }

/* ---- SETLIST NAV BAR ---- */
.setlist-nav-bar { display: flex; align-items: center; justify-content: space-between; background: var(--surface2); padding: 8px 12px; flex-shrink: 0; }
.setlist-position { font-size: 14px; color: var(--text-muted); flex: 1; text-align: center; }

/* ---- MODAL ---- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 500; padding: 20px; }
.modal-box { background: var(--surface); border-radius: 16px; padding: 24px; width: 100%; max-width: 440px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 18px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 20px; cursor: pointer; padding: 0 4px; }
.modal-hint { font-size: 13px; color: var(--text-muted); }

/* ---- BADGES ---- */
.badge-shared { background: rgba(79,195,247,0.2); color: var(--accent); font-size: 11px; padding: 2px 7px; border-radius: 20px; }
.badge-mine   { background: rgba(255,255,255,0.1); color: var(--text-muted); font-size: 11px; padding: 2px 7px; border-radius: 20px; }
.badge-role   { background: var(--surface2); color: var(--accent); font-size: 11px; padding: 2px 6px; border-radius: 4px; margin-left: 6px; }
.badge-you    { color: var(--text-muted); font-size: 12px; }
.capitalize   { text-transform: capitalize; }
.error-msg    { color: var(--accent2); text-align: center; padding: 40px; }

/* ---- TOAST ---- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--surface2); color: var(--text); padding: 12px 24px; border-radius: var(--radius); box-shadow: var(--shadow); z-index: 9999; animation: fadeInUp 0.2s ease; font-size: 15px; }
.toast-error   { background: var(--accent2); }
.toast-success { background: #388e3c; }
@keyframes fadeInUp { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ---- SAFE AREAS ---- */
.app-nav {
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  height: auto;
  min-height: var(--nav-h);
}
.song-topbar {
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  height: auto;
  min-height: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
}
.song-display, .view-content {
  padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
}

/* ---- AUTO-HIDE TOPBAR (handled in base rule above) ---- */

/* ---- SCROLLBARS ---- */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ---- SETLIST CARD ---- */
.setlist-card-actions { display: flex; gap: 8px; align-items: center; }

/* ---- NEXT SONG TAG ---- */
.next-song-tag { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(26,26,46,0.92); border-top: 1px solid var(--border); padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); text-align: center; color: var(--text-muted); font-size: 14px; z-index: 150; backdrop-filter: blur(8px); }
.next-song-tag span { display: inline-block; }
.song-nav-btn { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 160; background: rgba(79,195,247,0.15); border: 1px solid rgba(79,195,247,0.4); color: var(--accent); border-radius: 50%; width: 48px; height: 48px; font-size: 22px; cursor: pointer; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(8px); transition: background 0.15s; }
.song-nav-btn:hover { background: rgba(79,195,247,0.3); }
.song-nav-btn.prev { left: calc(16px + env(safe-area-inset-left, 0px)); }
.song-nav-btn.next { right: calc(16px + env(safe-area-inset-right, 0px)); }

/* ---- SETLIST EDITOR ---- */
.editor-shell { display: flex; flex-direction: column; overflow: hidden; }
.editor-topbar { display: flex; align-items: center; gap: 8px; padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px; background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.editor-topbar-title { flex: 1; font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.editor-meta { display: flex; align-items: center; gap: 12px; padding: 8px 16px; background: var(--bg); border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-muted); flex-wrap: wrap; flex-shrink: 0; }
.editor-song-list { flex: 1; overflow-y: auto; padding: 8px 0; }
.editor-footer { padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); background: var(--surface); flex-shrink: 0; }

/* ---- EDITOR SONG ITEMS ---- */
.editor-song-item { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface); transition: background 0.15s; touch-action: none; }
.editor-song-item:active { background: var(--surface-hover); }
.editor-song-item.is-dragging { background: rgba(79,195,247,0.12); border: 1px dashed #4fc3f7; opacity: 0.8; }
.drag-handle { color: var(--text-muted); cursor: grab; font-size: 20px; padding: 4px; user-select: none; flex-shrink: 0; }
.drag-handle:active { cursor: grabbing; }
.item-pos { color: var(--text-muted); font-size: 13px; width: 20px; text-align: right; flex-shrink: 0; }
.editor-song-info { flex: 1; min-width: 0; }
.editor-song-title { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.editor-song-artist { font-size: 12px; color: var(--text-muted); }
.editor-key-wrap { flex-shrink: 0; }
.editor-key-select { background: rgba(79,195,247,0.15); color: #4fc3f7; border: 1px solid #4fc3f7; border-radius: 8px; padding: 4px 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.editor-remove-btn { background: none; border: none; color: var(--text-muted); font-size: 18px; cursor: pointer; padding: 4px 8px; flex-shrink: 0; }
.editor-remove-btn:hover { color: #ef5350; }

/* ---- SONG PICKER MODAL ---- */
.picker-box { max-height: 80vh; display: flex; flex-direction: column; width: min(500px, 94vw); }
.picker-song-list { flex: 1; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; margin: 4px 0; }
.picker-song-item { border-bottom: 1px solid var(--border); }
.picker-song-item:last-child { border-bottom: none; }
.picker-song-item.already-in { opacity: 0.5; }
.picker-label { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; width: 100%; }
.picker-label input[type=checkbox] { width: 18px; height: 18px; flex-shrink: 0; accent-color: #4fc3f7; }
.picker-title { flex: 1; font-weight: 600; }
.picker-key { background: rgba(79,195,247,0.15); color: #4fc3f7; border-radius: 8px; padding: 2px 8px; font-size: 12px; font-weight: 600; }
.picker-artist { font-size: 12px; color: var(--text-muted); }

/* ---- SETTINGS SECTION LABELS ---- */
.settings-section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); padding: 4px 0 2px; margin-top: 4px; }

/* ---- CAPO BADGE ---- */
#capo-badge { font-weight: 700; font-size: 14px; min-width: 70px; }

/* ---- SONG KEY BADGE (always visible in topbar) ---- */
#song-key-badge { background: rgba(79,195,247,0.18); color: #4fc3f7; border: 1px solid #4fc3f7; border-radius: 12px; padding: 2px 10px; font-size: 13px; font-weight: 600; white-space: nowrap; }

/* ---- READ-ONLY KEY BADGE ---- */
.key-readonly-badge { background: rgba(255,255,255,0.08); color: var(--text-muted); border: 1px solid var(--border); border-radius: 8px; padding: 4px 12px; font-weight: 600; font-size: 15px; }

/* ---- SONG FOOTER (CCLI info) ---- */
.song-footer { font-size: 10px; color: var(--text-muted); opacity: 0.5; margin-top: 32px; padding-top: 8px; border-top: 1px solid var(--border); white-space: normal; word-break: break-word; line-height: 1.4; }

/* ---- FIXED GEAR BUTTON ---- */
#song-settings-toggle { position: fixed; top: calc(8px + env(safe-area-inset-top, 0px)); right: calc(8px + env(safe-area-inset-right, 0px)); z-index: 400; background: rgba(26,26,46,0.75); border-radius: 50%; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.back-key-row { position: fixed; top: calc(8px + env(safe-area-inset-top, 0px)); left: calc(8px + env(safe-area-inset-left, 0px)); z-index: 400; display: flex; align-items: center; }
.back-key-row #key-label-badge { display: none !important; }
.song-topbar #key-label-badge { display: inline !important; }
.back-song-btn { background: rgba(26,26,46,0.6); border: none; color: rgba(255,255,255,0.5); font-size: 13px; padding: 6px 10px; border-radius: 16px; cursor: pointer; backdrop-filter: blur(4px); white-space: nowrap; transition: color 0.15s, background 0.15s; }
.back-song-btn:hover { color: rgba(255,255,255,0.9); background: rgba(26,26,46,0.9); }

/* ============================================================
   PIN LOGIN — keypad, dots, links, modal forms
   ============================================================ */
.keypad-box { max-width: 360px; gap: 18px; }
.login-greeting { font-size: 26px; font-weight: 700; text-align: center; color: var(--text); }
.login-subtle { font-size: 14px; text-align: center; color: var(--text-muted); }

.pin-dots { display: flex; gap: 18px; justify-content: center; margin: 8px 0 4px; }
.pin-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: transparent; border: 2px solid var(--border);
  transition: background 0.12s, border-color 0.12s, transform 0.12s;
}
.pin-dot.filled { background: var(--accent); border-color: var(--accent); transform: scale(1.1); }

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 8px;
}
.keypad-key {
  background: var(--surface2, rgba(255,255,255,0.06));
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0;
  height: 64px;
  font-size: 26px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.08s, transform 0.08s;
}
.keypad-key:hover { background: rgba(255,255,255,0.10); }
.keypad-key:active { transform: scale(0.96); background: rgba(255,255,255,0.16); }
.keypad-back { font-size: 22px; color: var(--text-muted); }
.keypad-spacer { visibility: hidden; }

.login-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; }
.login-links a { color: var(--text-muted); text-decoration: none; }
.login-links a:hover { color: var(--accent); text-decoration: underline; }

.shake { animation: shake 0.32s ease-in-out; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

/* Numeric inputs in modals & login forms */
#login-pin, #spin-new, #spin-confirm, #arpin-new {
  font-size: 22px;
  letter-spacing: 8px;
  text-align: center;
}

/* Admin user list — extra badges and per-user action row */
.user-card-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.badge-pin {
  display: inline-block; margin-left: 6px; padding: 2px 8px;
  border-radius: 10px; font-size: 11px; font-weight: 600;
  background: rgba(79,195,247,0.15); color: #4fc3f7; border: 1px solid rgba(79,195,247,0.4);
}
.badge-pin-none { background: rgba(255,255,255,0.04); color: var(--text-muted); border-color: var(--border); }
