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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: #e2e0e8;
  color: #1a1a2e;
  min-height: 100vh;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 80px;
  background: #f0f2f5;
  min-height: 100vh;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.12);
  border-left: 2px solid #d1cde0;
  border-right: 2px solid #d1cde0;
  position: relative;
}

header {
  text-align: center;
  padding: 24px 0 12px;
}

header h1 {
  font-size: 28px;
  font-weight: 700;
  color: #6c5ce7;
}

#status-bar {
  font-size: 13px;
  color: #636e72;
  margin-top: 4px;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.hidden {
  display: none !important;
}

.card {
  background: #fff;
  border-radius: 16px;
  padding: 32px 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.card.centered {
  text-align: center;
  margin-top: 24px;
}

.card h2 {
  font-size: 22px;
  margin-bottom: 12px;
}

.card p {
  color: #636e72;
  line-height: 1.5;
  margin-bottom: 20px;
}

.join-options {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 16px;
}

.join-divider {
  display: flex;
  align-items: center;
  margin: 12px 0;
  color: #b2bec3;
  font-size: 13px;
}

.join-divider::before,
.join-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #dfe6e9;
}

.join-divider span {
  padding: 0 12px;
}

.btn-link {
  background: none;
  border: none;
  color: #636e72;
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
  margin-top: 8px;
}

.btn-link:hover {
  color: #6c5ce7;
}

.hint {
  font-size: 13px;
  color: #b2bec3;
  margin-top: 16px;
}

.section-hint {
  font-size: 13px;
  color: #636e72;
  margin-bottom: 16px;
  line-height: 1.4;
}

.btn-primary {
  background: #6c5ce7;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover {
  background: #5a4bd1;
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-primary:disabled {
  background: #b2bec3;
  cursor: not-allowed;
}

.btn-secondary {
  background: #dfe6e9;
  color: #2d3436;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: #cdd5d8;
}

.btn-large {
  padding: 16px 48px;
  font-size: 18px;
}

.btn-small {
  padding: 6px 14px;
  font-size: 13px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.event-banner {
  background: linear-gradient(135deg, #6c5ce7, #a29bfe);
  color: #fff;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
}

.event-banner .btn-small {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

.event-banner .btn-small:hover {
  background: rgba(255,255,255,0.3);
}

.tab-bar {
  display: flex;
  gap: 0;
  background: #fff;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.tab {
  flex: 1;
  background: none;
  border: none;
  padding: 10px 4px;
  font-size: 13px;
  font-weight: 600;
  color: #636e72;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s;
  position: relative;
}

.tab.active {
  background: #6c5ce7;
  color: #fff;
}

.badge {
  position: absolute;
  top: 2px;
  right: 4px;
  background: #d63031;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
}

.tab-content {
  display: none;
}

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

.recommended-tags-section {
  background: #fff;
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 14px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

.recommended-tags-label {
  font-size: 13px;
  font-weight: 600;
  color: #636e72;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.recommended-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.recommended-tag {
  display: inline-block;
  background: linear-gradient(135deg, #e8e5fc, #f0edff);
  color: #6c5ce7;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #d5d0f5;
  cursor: pointer;
  transition: all 0.2s;
}

.recommended-tag:hover {
  background: #6c5ce7;
  color: #fff;
  border-color: #6c5ce7;
}

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

.feed-header h2 {
  font-size: 20px;
}

.post-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

.post-card .post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.post-card .post-user {
  font-size: 13px;
  color: #636e72;
  font-weight: 500;
}

.post-card .post-time {
  font-size: 12px;
  color: #b2bec3;
}

.post-card .post-body {
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 12px;
  color: #2d3436;
}

.post-card .post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.post-tags-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.post-card .post-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid #f0f2f5;
}

.like-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 2px solid #dfe6e9;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #636e72;
  cursor: pointer;
  transition: all 0.2s;
}

.like-btn:hover {
  border-color: #e84393;
  color: #e84393;
}

.like-btn.liked {
  background: #fde8f0;
  border-color: #e84393;
  color: #e84393;
}

.like-btn .heart {
  font-size: 16px;
  transition: transform 0.2s;
}

.like-btn:active .heart {
  transform: scale(1.3);
}

.like-count {
  font-size: 12px;
  color: #b2bec3;
}

.tag {
  display: inline-block;
  background: #e8e5fc;
  color: #6c5ce7;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.empty-state {
  text-align: center;
  color: #b2bec3;
  padding: 40px 0;
  font-size: 15px;
}

.compose-form {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

.compose-form h2 {
  margin-bottom: 16px;
}

textarea {
  width: 100%;
  border: 2px solid #dfe6e9;
  border-radius: 10px;
  padding: 14px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s;
}

textarea:focus {
  outline: none;
  border-color: #6c5ce7;
}

.tags-section {
  margin: 16px 0;
}

.tags-section label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
  color: #2d3436;
}

.tag-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.tag-input-row input {
  flex: 1;
  border: 2px solid #dfe6e9;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.tag-input-row input:focus {
  outline: none;
  border-color: #6c5ce7;
}

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 24px;
  margin-bottom: 8px;
}

.tag-removable {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #6c5ce7;
  color: #fff;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.tag-removable .remove-tag {
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  opacity: 0.7;
  margin-left: 2px;
}

.tag-removable .remove-tag:hover {
  opacity: 1;
}

.suggested-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.suggested-label {
  font-size: 12px;
  color: #b2bec3;
}

.tag-suggestion {
  background: #f0f0f5;
  border: 1px solid #dfe6e9;
  color: #636e72;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.tag-suggestion:hover {
  background: #e8e5fc;
  color: #6c5ce7;
  border-color: #6c5ce7;
}

.tag-suggestion.selected {
  background: #6c5ce7;
  color: #fff;
  border-color: #6c5ce7;
}

.notif-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.notif-card.unread {
  border-left: 3px solid #6c5ce7;
  background: #faf9ff;
}

.notif-icon {
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  background: #e8e5fc;
  color: #6c5ce7;
  padding: 6px 10px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.notif-body {
  flex: 1;
}

.notif-message {
  font-size: 14px;
  line-height: 1.4;
  color: #2d3436;
}

.notif-time {
  font-size: 12px;
  color: #b2bec3;
  margin-top: 4px;
}

.match-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

.match-card .match-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.match-status {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}

.match-status.nearby {
  background: #00b894;
  color: #fff;
}

.match-status.away {
  background: #dfe6e9;
  color: #636e72;
}

.match-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.match-time {
  font-size: 12px;
  color: #b2bec3;
  margin-top: 8px;
}

.my-post {
  border-left: 3px solid #6c5ce7;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #2d3436;
  color: #fff;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  z-index: 100;
  animation: fadeInUp 0.3s ease;
  max-width: 90%;
  text-align: center;
}

.toast.error {
  background: #d63031;
}

.toast.match {
  background: #6c5ce7;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  animation: fadeIn 0.2s ease;
  padding: 24px;
}

.dialog-box {
  background: #fff;
  border-radius: 20px;
  padding: 32px 28px 24px;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  text-align: center;
  animation: scaleIn 0.25s ease;
}

.dialog-icon {
  font-size: 14px;
  font-weight: 700;
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dialog-icon.icon-match {
  background: #e8e5fc;
  color: #6c5ce7;
}

.dialog-icon.icon-proximity {
  background: #d4efdf;
  color: #00b894;
}

.dialog-icon.icon-like {
  background: #fde8f0;
  color: #e84393;
}

.dialog-icon.icon-codeword {
  background: #d6eaff;
  color: #0066ff;
}

.dialog-title {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 10px;
}

.dialog-message {
  font-size: 15px;
  color: #636e72;
  line-height: 1.5;
  margin-bottom: 8px;
}

.dialog-extra {
  margin-bottom: 20px;
}

.dialog-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dialog-action-btn {
  width: 100%;
  padding: 14px;
  font-size: 15px;
}

.dialog-dismiss-btn {
  width: 100%;
  padding: 12px;
  font-size: 14px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.codeword-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #0066ff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 40px 24px;
}

.codeword-logo {
  font-size: 32px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
  position: absolute;
  top: 48px;
  left: 50%;
  transform: translateX(-50%);
}

.codeword-instruction {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 24px;
  text-align: center;
}

.codeword-word {
  font-size: 48px;
  font-weight: 800;
  color: #fff;
  text-align: center;
  letter-spacing: 2px;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  margin-bottom: 60px;
}

.btn-codeword-back {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  padding: 14px 40px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  position: absolute;
  bottom: 60px;
}

.btn-codeword-back:hover {
  background: rgba(255, 255, 255, 0.3);
}

.btn-confirm-talk {
  background: #00b894;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 10px;
}

.btn-confirm-talk:hover {
  background: #00a383;
}

.btn-confirm-talk:disabled {
  background: #b2bec3;
  cursor: not-allowed;
}

.btn-confirm-talk.waiting {
  background: #fdcb6e;
  color: #2d3436;
}

.btn-view-codeword {
  background: #0066ff;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
}

.btn-view-codeword:hover {
  background: #0055dd;
}

.notif-post-preview {
  background: #f8f8fc;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 8px;
  font-size: 13px;
  color: #2d3436;
  line-height: 1.4;
  border-left: 3px solid #6c5ce7;
}

.notif-post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.match-confirm-area {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f0f2f5;
}

.confirm-status {
  font-size: 12px;
  color: #636e72;
  margin-top: 6px;
}

@media (max-width: 480px) {
  #app {
    padding: 0 12px 80px;
  }
  .card {
    padding: 24px 16px;
  }
  .tab {
    font-size: 12px;
    padding: 8px 2px;
  }
}
