/* りんごちゃんとおさんぽ — cartoon style */

:root {
  --ink: #1a1a2e;
  --cream: #fff8e7;
  --paper: #fffdf5;
  --red: #ff6b6b;
  --red-dark: #e85555;
  --orange: #ff9f43;
  --yellow: #ffd93d;
  --green: #6bcb77;
  --green-dark: #52b35c;
  --blue: #4d96ff;
  --blue-dark: #3a7fe8;
  --pink: #ff8fab;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --radius: 18px;
  --radius-sm: 12px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", sans-serif;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
  background-color: #ffe8a3;
  background-image:
    radial-gradient(circle, #ffb347 2px, transparent 2px);
  background-size: 28px 28px;
  min-height: 100vh;
}

a {
  color: var(--blue-dark);
  text-decoration: none;
  font-weight: 700;
}

a:hover {
  color: var(--red);
}

/* Floating doodles */
.bg-doodles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.doodle {
  position: absolute;
  font-size: 28px;
  opacity: 0.35;
  animation: float 6s ease-in-out infinite;
}

.d1 { top: 8%; left: 4%; animation-delay: 0s; }
.d2 { top: 20%; right: 6%; animation-delay: 1s; font-size: 22px; }
.d3 { top: 55%; left: 2%; animation-delay: 2s; }
.d4 { bottom: 15%; right: 4%; animation-delay: 0.5s; }
.d5 { top: 40%; right: 2%; animation-delay: 1.5s; font-size: 20px; }
.d6 { bottom: 30%; left: 6%; animation-delay: 2.5s; font-size: 24px; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(8deg); }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(-1deg); }
  50% { transform: rotate(1deg); }
}

#wrapper {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 16px auto;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 24px;
  box-shadow: 8px 8px 0 var(--ink);
  overflow: hidden;
}

/* Cartoon panel base */
.cartoon-panel {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Header */
.header-panel {
  position: relative;
  margin: 0;
  border: none;
  border-bottom: 3px solid var(--ink);
  border-radius: 0;
  box-shadow: none;
  background: linear-gradient(180deg, #fff0c2 0%, #ffe082 100%);
  padding: 20px 20px 16px;
}

.sticker {
  position: absolute;
  font-family: "Fredoka", "M PLUS Rounded 1c", sans-serif;
  font-weight: 700;
  font-size: 11px;
  padding: 6px 12px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  animation: wiggle 3s ease-in-out infinite;
}

.sticker-new {
  top: 14px;
  right: 16px;
  background: var(--red);
  color: #fff;
  transform: rotate(6deg);
}

.header-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--orange);
}

.blog-title {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.blog-title a {
  color: var(--ink);
  text-shadow: 2px 2px 0 var(--yellow);
}

.blog-title a:hover {
  color: var(--red);
}

.blog-description {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 500;
  color: #444;
}

.global-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.global-nav a {
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s;
}

.global-nav a:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--ink);
  background: var(--yellow);
  color: var(--ink);
  text-decoration: none;
}

.global-nav .nav-buy {
  background: var(--green);
  color: #fff;
}

.global-nav .nav-buy:hover {
  background: var(--green-dark);
  color: #fff;
}

/* Layout */
#content {
  display: grid;
  grid-template-columns: 1fr 250px;
  gap: 16px;
  padding: 16px;
  background: var(--cream);
}

#main {
  min-width: 0;
}

/* Entries */
.entry {
  margin-bottom: 16px;
  padding: 16px;
}

.entry:last-of-type {
  margin-bottom: 16px;
}

.entry-header {
  margin-bottom: 12px;
}

.badge-date {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 8px;
}

.comic-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  background: linear-gradient(transparent 60%, var(--pink) 60%);
  display: inline;
  line-height: 1.4;
}

.comic-title-sm {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}

.entry-body {
  font-size: 14px;
  font-weight: 500;
}

.prose p {
  margin: 0 0 12px;
}

.emphasis {
  color: var(--red);
  font-weight: 800;
}

.burst-line {
  padding: 10px 14px;
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

/* Speech bubbles */
.speech-bubble {
  position: relative;
  margin: 0 0 14px !important;
  padding: 12px 16px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

.speech-bubble::after {
  content: "";
  position: absolute;
  bottom: -14px;
  left: 28px;
  border: 10px solid transparent;
  border-top-color: var(--ink);
}

.speech-bubble::before {
  content: "";
  position: absolute;
  bottom: -9px;
  left: 31px;
  border: 7px solid transparent;
  border-top-color: #fff;
  z-index: 1;
}

.small-bubble {
  display: inline-block;
  margin-bottom: 12px !important;
}

.token-bubble::after,
.token-bubble::before {
  left: auto;
  right: 32px;
}

/* Comic photo frames */
.entry-photo {
  margin: 14px 0;
  text-align: center;
}

.comic-frame {
  display: inline-block;
  padding: 8px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 100%;
}

.comic-frame img {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  border-radius: calc(var(--radius-sm) - 4px);
  border: 2px solid var(--ink);
}

.comic-frame.small img {
  max-width: 300px;
}

.tilt-left {
  transform: rotate(-2deg);
}

.tilt-right {
  transform: rotate(2deg);
}

.photo-caption {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--red);
}

.omake-panel {
  margin-top: 14px;
  padding: 14px;
  background: #e8f4ff;
  border-style: dashed;
}

.omake-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 800;
  color: var(--blue-dark);
}

.entry-footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 2px dashed var(--ink);
}

.entry-meta {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12px;
  font-weight: 700;
  color: #555;
}

.entry-meta li {
  display: inline;
}

.entry-meta li + li::before {
  content: " · ";
}

/* Token panel */
.token-panel {
  position: relative;
  background: linear-gradient(135deg, #e8ffe8 0%, #fff0c2 100%);
  padding-top: 20px;
}

.sticker-token {
  top: -12px;
  right: 16px;
  background: var(--orange);
  color: var(--ink);
  font-size: 13px;
  transform: rotate(-4deg);
}

.token-lead {
  margin: 0 0 14px;
}

.ca-box {
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.ca-label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
}

.ca-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

#ca-address {
  flex: 1;
  min-width: 0;
  font-family: "Fredoka", monospace;
  font-size: 13px;
  font-weight: 600;
  word-break: break-all;
  background: var(--cream);
  padding: 8px 12px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  color: var(--ink);
}

.ca-hint {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--green-dark);
  min-height: 1em;
}

.action-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Cartoon buttons */
.btn {
  display: inline-block;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  border-radius: 999px;
  text-align: center;
  cursor: pointer;
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s, box-shadow 0.12s;
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
  text-decoration: none;
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.btn-cartoon {
  color: var(--ink) !important;
}

.btn-red {
  background: var(--red);
  color: #fff !important;
}

.btn-red:hover {
  background: var(--red-dark);
  color: #fff !important;
}

.btn-green {
  background: var(--green);
  color: #fff !important;
}

.btn-green:hover {
  background: var(--green-dark);
  color: #fff !important;
}

.btn-blue {
  background: var(--blue);
  color: #fff !important;
}

.btn-blue:hover {
  background: var(--blue-dark);
  color: #fff !important;
}

.copy-btn {
  background: var(--orange);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.copy-btn:hover {
  background: var(--yellow);
}

/* Comments */
.comments {
  padding: 16px;
  background: #fff5fb;
}

.comments-title {
  font-size: 18px;
  margin: 0 0 12px;
}

.comment-form {
  margin-bottom: 14px;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.comment-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  min-width: 120px;
}

.form-grow {
  flex: 1;
  min-width: 200px;
}

.comment-form input,
.comment-form textarea {
  padding: 8px 12px;
  border: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  background: #fff;
}

.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--yellow);
}

.comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.comment-item {
  padding: 12px 14px;
  margin-bottom: 8px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
}

.comment-item .comment-author {
  font-weight: 800;
  color: var(--red);
  margin-bottom: 4px;
  font-size: 12px;
}

.comment-item .comment-text {
  margin: 0;
  font-weight: 500;
}

/* Sidebar */
#sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sidebar-widget {
  padding: 14px;
}

.avatar-wrap {
  position: relative;
  width: 80px;
  margin: 0 auto 10px;
}

.profile-avatar {
  display: block;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-sm);
}

.avatar-badge {
  position: absolute;
  bottom: -4px;
  right: -8px;
  font-size: 22px;
  filter: drop-shadow(2px 2px 0 var(--ink));
}

.profile-text {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.55;
  margin: 0 0 10px;
  text-align: center;
}

.sidebar-actions {
  display: flex;
  gap: 6px;
}

.sidebar-actions a {
  flex: 1;
  padding: 7px 0;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 2px 2px 0 var(--ink);
  color: var(--ink);
}

.sidebar-actions a:hover {
  background: var(--yellow);
  text-decoration: none;
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink);
}

.sidebar-actions .sidebar-buy {
  background: var(--green);
  color: #fff;
}

.sidebar-actions .sidebar-buy:hover {
  background: var(--green-dark);
  color: #fff;
}

.token-info {
  margin: 0;
}

.token-info div {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 12px;
  font-weight: 600;
  border-bottom: 2px dashed #ddd;
}

.token-info div:last-child {
  border-bottom: none;
}

.token-info dt {
  color: #666;
  font-weight: 700;
}

.token-info dd {
  margin: 0;
  font-weight: 800;
}

.recent-posts {
  list-style: none;
  margin: 0;
  padding: 0;
}

.recent-posts li {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
}

.recent-posts a {
  color: var(--ink);
}

.recent-posts a:hover {
  color: var(--red);
}

/* Footer */
.footer-panel {
  margin: 0;
  border: none;
  border-top: 3px solid var(--ink);
  border-radius: 0;
  box-shadow: none;
  padding: 14px 20px;
  text-align: center;
  background: var(--yellow);
  font-size: 12px;
  font-weight: 700;
}

.footer-panel p {
  margin: 0;
}

.footer-panel p + p {
  margin-top: 4px;
}

.disclaimer {
  font-size: 10px;
  font-weight: 500;
  color: #666;
}

/* Responsive */
@media (max-width: 768px) {
  #wrapper {
    margin: 8px;
    border-radius: 16px;
    box-shadow: 5px 5px 0 var(--ink);
  }

  #content {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .blog-title {
    font-size: 21px;
    padding-right: 80px;
  }

  .sticker-new {
    top: 10px;
    right: 10px;
    font-size: 10px;
    padding: 4px 8px;
  }

  .comic-frame {
    transform: none !important;
  }

  .doodle {
    display: none;
  }
}
