:root {
  --bg-color: #f4f4f6;
  --card-bg: #ffffff;
  --card-border: rgba(0, 0, 0, 0.06);
  --text-primary: #111111;
  --text-secondary: #6e6e73;
  --accent: #111111;
  --button-bg: #f5f5f7;
  --button-hover: #e8e8ed;
  --radius: 18px;
  --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px 16px;
}

.app-container {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.brand-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
}

.brand-logo {
  height: 28px;
  width: auto;
  object-fit: contain;
}

.glass-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.input-group {
  margin-bottom: 14px;
}

.input-group:last-child {
  margin-bottom: 0;
}

input, textarea {
  width: 100%;
  background: #fbfbfd;
  border: 1px solid #d2d2d7;
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 15px;
  font-weight: 400;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, textarea:focus {
  border-color: #111111;
  box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.08);
  background: #ffffff;
}

input::placeholder, textarea::placeholder {
  color: #86868b;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  background: #f1f1f3;
  padding: 4px;
  border-radius: 14px;
  margin-bottom: 16px;
}

.mode-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-tab.active {
  background: #ffffff;
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.tappy-btn {
  width: 100%;
  background: #111111;
  border: none;
  border-radius: var(--radius);
  color: #ffffff;
  font-family: var(--font-family);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 18px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(17, 17, 17, 0.2);
  transition: transform 0.1s ease, opacity 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tappy-btn:active {
  transform: scale(0.98);
}

.tappy-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.post-output-box {
  background: #fbfbfd;
  border: 1px solid #d2d2d7;
  border-radius: 14px;
  padding: 16px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 16px;
}

.action-deck {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.action-btn {
  background: var(--button-bg);
  border: 1px solid #d2d2d7;
  border-radius: 12px;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 500;
  padding: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.2s ease, transform 0.1s ease;
}

.action-btn:hover {
  background: var(--button-hover);
}

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

.action-btn.primary {
  background: #111111;
  color: #ffffff;
  border-color: transparent;
}

.gif-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  animation: fadeIn 0.2s ease;
}

.gif-modal.hidden {
  display: none;
}

.gif-sheet {
  width: 100%;
  max-height: 80vh;
  background: #ffffff;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
}

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

.gif-close-btn {
  background: rgba(0, 0, 0, 0.05);
  border: none;
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
}

.gif-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  overflow-y: auto;
  max-height: 50vh;
  padding-bottom: 20px;
}

.gif-item {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.gif-item:hover {
  transform: scale(1.02);
}

.gif-preview-container {
  position: relative;
  margin-bottom: 16px;
  border-radius: 12px;
  overflow: hidden;
  max-height: 200px;
}

.gif-preview-img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 12px;
}

.remove-gif-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 12px;
}

.app-footer {
  text-align: center;
  padding: 24px 0 12px 0;
}

.app-footer a {
  color: var(--text-secondary);
  font-size: 12px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.app-footer a:hover {
  color: var(--text-primary);
}

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