:root {
  --primary: #f472b6; /* Sakura Pink */
  --primary-hover: #ec4899;
  --secondary: #38bdf8; /* Sky Blue */
  --accent: #fcd34d; /* Warm Yellow */
  --bg-color: #f8fafc; /* Very light blue/gray */
  --text-main: #334155;
  --text-muted: #64748b;
  --card-bg: #ffffff;
  --border-radius: 20px;
  --shadow-color: rgba(244, 114, 182, 0.15);
}

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

body {
  font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Segoe UI', sans-serif;
  background-color: var(--bg-color);
  background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
  background-size: 20px 20px;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 20px;
}

header {
  width: 100%;
  max-width: 1200px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  background: var(--card-bg);
  padding: 15px 30px;
  border-radius: 100px;
  box-shadow: 0 4px 20px var(--shadow-color);
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  position: relative;
  display: inline-block;
}

.logo::after {
  content: "✨";
  position: absolute;
  top: -5px;
  right: -20px;
  font-size: 1.2rem;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s;
  padding: 8px 16px;
  border-radius: 20px;
}

.nav-link:hover {
  color: var(--primary);
  background: rgba(244, 114, 182, 0.1);
}

/* Layout for side banners */
.page-wrapper {
  display: flex;
  width: 100%;
  max-width: 1200px;
  gap: 24px;
  justify-content: center;
  align-items: flex-start;
}

.side-banner {
  display: none; /* hidden on very small screens */
  flex-shrink: 0;
}

@media (min-width: 1024px) {
  .side-banner {
    display: block;
    width: 160px; /* standard ad size */
  }
}

.main-content {
  flex: 1;
  max-width: 800px;
  width: 100%;
}

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 40px;
  box-shadow: 0 10px 30px var(--shadow-color);
  animation: floatUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  border: 3px solid #fff;
}

.text-center {
  text-align: center;
}

h1 {
  font-size: 2.2rem;
  margin-bottom: 16px;
  color: var(--text-main);
  font-weight: 800;
}

p {
  color: var(--text-muted);
  line-height: 1.7;
  font-size: 1.05rem;
}

/* Images */
.hero-image {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 24px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  background-color: #f1f5f9;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 9999px;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
  text-decoration: none;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 6px 20px rgba(244, 114, 182, 0.4);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 25px rgba(244, 114, 182, 0.5);
}

.btn-large {
  font-size: 1.3rem;
  padding: 18px 48px;
  margin-top: 20px;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.links-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

@media (min-width: 600px) {
  .links-grid {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Forms */
.form-group {
  margin-bottom: 24px;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.95rem;
}

.form-control {
  width: 100%;
  padding: 14px 16px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  color: var(--text-main);
  font-size: 1rem;
  transition: all 0.3s;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(244, 114, 182, 0.15);
}

textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

.help-text {
  font-size: 0.85rem;
  color: var(--primary);
  margin-top: 4px;
  display: block;
}

/* Link Builder in Admin */
.link-builder-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}
.link-builder-row input {
  flex: 1;
}
.remove-link-btn {
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: bold;
}

/* Voting Buttons */
.vote-container {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 30px;
}

.btn-vote {
  background: white;
  border: 2px solid #e2e8f0;
  color: var(--text-main);
  padding: 12px 24px;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.btn-vote.voted {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.btn-good:hover:not(.voted) {
  border-color: #10b981;
  color: #10b981;
  background: #ecfdf5;
}
.btn-good.voted {
  background: #10b981;
  color: white;
  border-color: #10b981;
}

.btn-bad:hover:not(.voted) {
  border-color: #ef4444;
  color: #ef4444;
  background: #fef2f2;
}
.btn-bad.voted {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
}

/* HTML Content Display */
.html-content {
  text-align: left;
  line-height: 1.8;
  color: var(--text-main);
  font-size: 1.05rem;
}
.html-content h2, .html-content h3 {
  color: var(--primary);
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}
.html-content ul, .html-content ol {
  margin-left: 20px;
  margin-bottom: 1em;
}
.html-content p {
  margin-bottom: 1em;
  color: var(--text-main);
}
.html-content strong {
  background: linear-gradient(transparent 60%, rgba(253, 224, 71, 0.8) 0);
}

/* Animations */
@keyframes floatUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255,255,255,0.4);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s ease-in-out infinite;
}

#lottery-result {
  margin-top: 40px;
  display: none;
  background: linear-gradient(to bottom, #ffffff, #f8fafc);
}
