:root {
  --hw-bg: #fafaf8;
  --hw-surface: #ffffff;
  --hw-paper-alt: #f3f1eb;
  --hw-ink: #1a1d20;
  --hw-dark-ink: #1a1d20;
  --hw-muted: #525860;
  --hw-line: #d3d6da;
  --hw-border-strong: #d3d6da;
  --hw-green: #3d7539;
  --hw-green-dark: #2e5c2b;
  --hw-green-tint: #e9f2e8;
  --hw-yellow: #b59f3b;
  --hw-gray: #6c7177;
  --hw-cb-orange: #f5793a;
  --hw-cb-blue: #85c0f9;
  --hw-danger: #c93b3b;
  --hw-key-bg: #e6e4dc;
  --hw-white: #ffffff;
  --hw-radius: 12px;
  --hw-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body.hw-body {
  margin: 0;
  background: var(--hw-bg);
  color: var(--hw-ink);
  font-family: var(--hw-sans);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
}

.hw-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--hw-ink);
  color: var(--hw-white);
  padding: 10px 16px;
  z-index: 100;
  border-radius: 6px;
}
.hw-skip:focus {
  left: 12px;
  top: 12px;
}

/* Top Navigation */
.hw-topbar {
  background: var(--hw-surface);
  border-bottom: 1px solid var(--hw-line);
}

.hw-topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 9px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hw-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--hw-ink);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.hw-brand-tile {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: var(--hw-green);
  color: var(--hw-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  box-shadow: 0 2px 0 var(--hw-green-dark);
}

.hw-brand-tile-sm {
  width: 28px;
  height: 28px;
  font-size: 0.95rem;
}

.hw-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.hw-nav-link {
  color: var(--hw-ink);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  transition: background-color 0.15s ease;
}

.hw-nav-link:hover {
  background: var(--hw-paper-alt);
}

/* Main Container */
.hw-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 16px 44px;
}

.hw-hero-head {
  max-width: 920px;
  margin: 0 auto 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  text-align: left;
}

.hw-hero-head .hw-breadcrumb {
  flex-basis: 100%;
  margin-bottom: 2px;
}

.hw-hero-h1 {
  margin: 0;
  font-size: clamp(1.65rem, 2.6vw, 2.05rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--hw-ink);
}

.hw-hero-sub {
  margin: 0;
  color: var(--hw-muted);
  font-size: 0.94rem;
}

.hw-page-head {
  max-width: 760px;
  margin: 0 auto 24px;
}

.hw-page-h1 {
  margin: 8px 0 10px;
  font-size: clamp(1.75rem, 3.5vw, 2.35rem);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hw-page-meta {
  margin: 0;
  color: var(--hw-muted);
  font-size: 0.92rem;
}

.hw-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--hw-muted);
  margin-bottom: 10px;
}

.hw-breadcrumb a {
  color: var(--hw-green-dark);
  text-decoration: none;
  font-weight: 600;
}

.hw-breadcrumb a:hover {
  text-decoration: underline;
}

/* Game Stage */
.hw-stage-wrap {
  max-width: 920px;
  margin: 0 auto 28px;
}

.hw-stage-frame {
  position: relative;
  width: 100%;
  height: clamp(480px, 64vh, 550px);
  min-height: 480px;
  background: var(--hw-surface);
  border: 2px solid var(--hw-ink);
  border-radius: 14px;
  box-shadow: 0 6px 0 var(--hw-ink);
  overflow: hidden;
}

.hw-stage-frame:fullscreen,
.hw-stage-frame:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  max-height: none;
  min-height: 100vh;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.hw-stage-cover,
.hw-stage-loader,
.hw-stage-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.hw-stage-cover {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--hw-bg);
}

.hw-stage-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.96;
}

.hw-cover-overlay {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 26px;
  background: var(--hw-surface);
  border: 2px solid var(--hw-ink);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  text-align: center;
  max-width: 90%;
}

.hw-cover-tiles {
  display: flex;
  gap: 6px;
}

.hw-cover-tiles span {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--hw-white);
  font-weight: 800;
  font-size: 1.05rem;
}

.hw-t-g { background: var(--hw-green); }
.hw-t-y { background: var(--hw-yellow); color: var(--hw-dark-ink); }
.hw-t-a { background: var(--hw-gray); }

.hw-play-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 2px solid var(--hw-ink);
  background: var(--hw-green);
  color: var(--hw-white);
  font-family: inherit;
  font-size: 1.12rem;
  font-weight: 800;
  padding: 13px 30px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--hw-ink);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.15s ease;
}

.hw-play-btn:hover {
  background: var(--hw-green-dark);
}

.hw-play-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--hw-ink);
}

.hw-cover-hint {
  margin: 0;
  font-size: 0.88rem;
  color: var(--hw-muted);
  font-weight: 600;
}

/* Loader */
.hw-stage-loader {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--hw-bg);
  z-index: 3;
}

.hw-stage-frame[data-gf-state="loading"] [data-gf-loading] {
  display: flex;
}

.hw-stage-frame[data-gf-state="loading"] [data-gf-cover],
.hw-stage-frame[data-gf-state="playing"] [data-gf-cover] {
  display: none;
}

.hw-flip-row {
  display: flex;
  gap: 8px;
}

.hw-flip-tile {
  width: 44px;
  height: 44px;
  border-radius: 7px;
  background: var(--hw-green);
  color: var(--hw-white);
  font-weight: 800;
  font-size: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  animation: hwTileFlip 1.2s ease-in-out infinite;
}

.hw-flip-tile:nth-child(2) { animation-delay: 0.12s; background: var(--hw-yellow); color: var(--hw-dark-ink); }
.hw-flip-tile:nth-child(3) { animation-delay: 0.24s; background: var(--hw-green); }
.hw-flip-tile:nth-child(4) { animation-delay: 0.36s; background: var(--hw-gray); }
.hw-flip-tile:nth-child(5) { animation-delay: 0.48s; background: var(--hw-green); }

@keyframes hwTileFlip {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.15); }
}

@media (prefers-reduced-motion: reduce) {
  .hw-flip-tile { animation: none; }
}

.hw-loader-text {
  margin: 0;
  font-weight: 700;
  color: var(--hw-ink);
  font-size: 0.98rem;
}

/* Action Bar */
.hw-action-bar {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.hw-act-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 7px 13px;
  border-radius: 9px;
  border: 1.5px solid var(--hw-border-strong);
  background: var(--hw-surface);
  color: var(--hw-ink);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.hw-act-btn:hover {
  border-color: var(--hw-ink);
  background: var(--hw-paper-alt);
}

.hw-act-quiet {
  background: var(--hw-paper-alt);
  color: var(--hw-ink);
  padding: 7px 11px;
}

.hw-act-btn[aria-pressed="true"],
.hw-act-btn[data-gf-liked] {
  background: var(--hw-green-tint);
  border-color: var(--hw-green);
  color: var(--hw-green-dark);
}

[data-gf-like-count]:empty,
[data-gf-comment-count]:empty,
.hw-share-toast:empty {
  display: none;
}

.hw-act-fs {
  margin-left: auto;
  background: var(--hw-ink);
  color: var(--hw-white);
  border-color: var(--hw-ink);
}

.hw-act-fs:hover {
  background: var(--hw-green-dark);
  border-color: var(--hw-green-dark);
}

.hw-share-toast {
  font-size: 0.85rem;
  color: var(--hw-green-dark);
  font-weight: 700;
}

/* Editorial Content */
.hw-prose {
  max-width: 760px;
  margin: 0 auto 40px;
  background: var(--hw-surface);
  border: 1px solid var(--hw-line);
  border-radius: var(--hw-radius);
  padding: 28px 30px;
  font-size: 1.04rem;
  line-height: 1.72;
}

.hw-prose h2 {
  margin: 1.65em 0 0.55em;
  font-size: 1.45rem;
  line-height: 1.28;
  font-weight: 800;
  letter-spacing: -0.015em;
  border-bottom: 2px solid var(--hw-paper-alt);
  padding-bottom: 6px;
}

.hw-prose h2:first-child {
  margin-top: 0;
}

.hw-prose h3 {
  margin: 1.3em 0 0.4em;
  font-size: 1.15rem;
  font-weight: 700;
}

.hw-prose p {
  margin: 0 0 1em;
}

.hw-prose ul,
.hw-prose ol {
  margin: 0 0 1.1em;
  padding-left: 1.35em;
}

.hw-prose li + li {
  margin-top: 0.35em;
}

.hw-prose a {
  color: var(--hw-green-dark);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hw-prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 20px auto;
  border-radius: 10px;
  border: 1px solid var(--hw-line);
}

.hw-prose code {
  background: var(--hw-paper-alt);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.9em;
  font-weight: 700;
}

.hw-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 0.94rem;
  display: block;
  overflow-x: auto;
}

.hw-prose th,
.hw-prose td {
  border: 1px solid var(--hw-line);
  padding: 9px 12px;
  text-align: left;
  white-space: nowrap;
}

.hw-prose th {
  background: var(--hw-paper-alt);
  font-weight: 700;
}

.hw-prose blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  background: var(--hw-paper-alt);
  border-left: 4px solid var(--hw-green);
  border-radius: 0 8px 8px 0;
}

/* FAQ Section */
.hw-faq-sec,
.hw-comments-sec {
  max-width: 760px;
  margin: 0 auto 36px;
}

.hw-sec-title {
  margin: 0 0 16px;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hw-comment-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  padding: 2px 9px;
  border-radius: 99px;
  background: var(--hw-paper-alt);
  border: 1px solid var(--hw-border-strong);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--hw-ink);
}

.hw-faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hw-faq-item {
  background: var(--hw-surface);
  border: 1px solid var(--hw-line);
  border-radius: 10px;
  padding: 14px 18px;
}

.hw-faq-item summary {
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.hw-faq-item summary::-webkit-details-marker {
  display: none;
}

.hw-faq-item summary::after {
  content: "+";
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--hw-green-dark);
}

.hw-faq-item[open] summary::after {
  content: "−";
}

.hw-faq-ans {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--hw-paper-alt);
  color: var(--hw-muted);
  font-size: 0.96rem;
}

/* Comments */
.hw-comment-form {
  background: var(--hw-surface);
  border: 1px solid var(--hw-line);
  border-radius: var(--hw-radius);
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hw-comment-form[data-gf-replying] {
  margin-top: 12px;
  border-color: var(--hw-green);
  background: var(--hw-green-tint);
}

.hw-reply-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--hw-green-dark);
  font-weight: 700;
}

.hw-comment-form[data-gf-replying] .hw-reply-banner {
  display: flex;
}

.hw-reply-cancel {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--hw-muted);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}

.hw-form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.hw-input,
.hw-textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.96rem;
  padding: 10px 12px;
  border: 1.5px solid var(--hw-border-strong);
  border-radius: 8px;
  background: var(--hw-surface);
  color: var(--hw-ink);
}

.hw-input:focus,
.hw-textarea:focus {
  outline: 2px solid var(--hw-green);
  outline-offset: 1px;
}

.hw-form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hw-submit-btn {
  appearance: none;
  border: 1.5px solid var(--hw-ink);
  background: var(--hw-ink);
  color: var(--hw-white);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.94rem;
  padding: 9px 18px;
  border-radius: 8px;
  cursor: pointer;
}

.hw-comment-msg {
  font-size: 0.9rem;
  color: var(--hw-green-dark);
  font-weight: 600;
}

.hw-comments-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hw-comments-list[data-gf-empty]::before {
  content: "No comments yet. Share your best winning streak, favorite starting word, or longest word length solved!";
  display: block;
  padding: 18px;
  background: var(--hw-surface);
  border: 1px dashed var(--hw-border-strong);
  border-radius: 10px;
  color: var(--hw-muted);
  font-size: 0.94rem;
}

.hw-comments-list[data-gf-off]::before {
  content: "Comments are currently closed for this page.";
  display: block;
  color: var(--hw-muted);
}

.hw-comment-card {
  background: var(--hw-surface);
  border: 1px solid var(--hw-line);
  border-radius: 10px;
  padding: 14px 16px;
}

.hw-comment-card[data-gf-owner] {
  border-left: 4px solid var(--hw-green);
  background: var(--hw-green-tint);
}

.hw-c-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.88rem;
}

.hw-c-name {
  font-weight: 800;
  color: var(--hw-ink);
}

.hw-c-owner-badge {
  display: none;
  background: var(--hw-green);
  color: var(--hw-white);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 99px;
  text-transform: uppercase;
}

[data-gf-owner] .hw-c-owner-badge {
  display: inline-block;
}

.hw-c-to {
  color: var(--hw-green-dark);
  font-weight: 700;
}

.hw-c-time {
  color: var(--hw-muted);
  margin-left: auto;
}

.hw-c-text {
  margin: 0 0 8px;
  font-size: 0.97rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.hw-c-reply-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--hw-green-dark);
  cursor: pointer;
}

.hw-c-replies {
  margin-top: 10px;
  padding-left: 16px;
  border-left: 2px solid var(--hw-line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Blog Index Grid */
.hw-blog-grid {
  max-width: 920px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
}

.hw-post-card {
  display: flex;
  flex-direction: column;
  background: var(--hw-surface);
  border: 1.5px solid var(--hw-line);
  border-radius: var(--hw-radius);
  padding: 20px;
  text-decoration: none;
  color: var(--hw-ink);
  transition: border-color 0.15s ease, transform 0.12s ease;
}

.hw-post-card:hover {
  border-color: var(--hw-ink);
  transform: translateY(-2px);
}

.hw-post-tag {
  display: inline-block;
  align-self: flex-start;
  background: var(--hw-green-tint);
  color: var(--hw-green-dark);
  font-size: 0.76rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 99px;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.hw-post-card h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  line-height: 1.3;
}

.hw-post-card p {
  margin: 0 0 14px;
  color: var(--hw-muted);
  font-size: 0.93rem;
  flex: 1;
}

.hw-post-more {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--hw-green-dark);
}

/* Post CTA Box */
.hw-cta-box {
  max-width: 760px;
  margin: 0 auto 32px;
  background: var(--hw-paper-alt);
  border: 1.5px solid var(--hw-border-strong);
  border-radius: var(--hw-radius);
  padding: 20px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.hw-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hw-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  background: var(--hw-green);
  color: var(--hw-white);
  font-weight: 800;
  text-decoration: none;
  border-radius: 8px;
  border: 1.5px solid var(--hw-ink);
}

.hw-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  background: var(--hw-surface);
  color: var(--hw-ink);
  font-weight: 700;
  text-decoration: none;
  border-radius: 8px;
  border: 1.5px solid var(--hw-border-strong);
}

/* 404 Page */
.hw-notfound {
  max-width: 560px;
  margin: 40px auto;
  text-align: center;
  background: var(--hw-surface);
  border: 2px solid var(--hw-ink);
  border-radius: var(--hw-radius);
  padding: 36px 24px;
}

.hw-404-tiles {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 16px;
}

.hw-404-tiles span {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--hw-white);
  font-size: 1.6rem;
  font-weight: 800;
}

/* Footer */
.hw-footer {
  background: var(--hw-surface);
  border-top: 1px solid var(--hw-line);
  margin-top: 32px;
}

.hw-footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 16px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
}

.hw-footer-note {
  margin: 10px 0 0;
  color: var(--hw-muted);
  font-size: 0.9rem;
  max-width: 440px;
}

.hw-footer-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.hw-footer-heading {
  margin: 0 0 8px;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--hw-muted);
}

.hw-footer-col ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.hw-footer-col li + li {
  margin-top: 6px;
}

.hw-footer-col a {
  color: var(--hw-ink);
  text-decoration: none;
  font-size: 0.92rem;
}

.hw-footer-col a:hover {
  color: var(--hw-green-dark);
  text-decoration: underline;
}

.hw-footer-bottom {
  border-top: 1px solid var(--hw-line);
  text-align: center;
  padding: 14px 16px;
  font-size: 0.85rem;
  color: var(--hw-muted);
}

.hw-footer-bottom p {
  margin: 0;
}

/* ===================================================
   EMBEDDED HELLO WORDL GAME SHELL (/embed/hellowordl)
   =================================================== */
body.hw-embed-shell {
  margin: 0;
  padding: 0;
  background: var(--hw-bg);
  color: var(--hw-ink);
  font-family: var(--hw-sans);
  overflow-x: hidden;
  height: 100vh;
}

.hw-g-app {
  max-width: 560px;
  margin: 0 auto;
  padding: 6px 10px 6px;
  height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 4px;
  overflow-y: auto;
}

.hw-g-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--hw-line);
  padding-bottom: 4px;
  flex: 0 0 auto;
}

.hw-g-logo {
  margin: 0;
  text-align: center;
  font-size: clamp(1.1rem, 3.8vw, 1.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.hw-g-hell.is-hard {
  color: var(--hw-danger);
}

.hw-g-hell.is-ultra {
  color: var(--hw-danger);
  font-style: italic;
}

.hw-g-mode-link {
  appearance: none;
  border: 1px solid var(--hw-border-strong);
  background: var(--hw-surface);
  color: var(--hw-ink);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 7px;
  cursor: pointer;
}

.hw-g-mode-link.is-daily {
  background: var(--hw-green-tint);
  border-color: var(--hw-green);
  color: var(--hw-green-dark);
}

.hw-g-icons {
  display: flex;
  gap: 4px;
}

.hw-g-icon-btn {
  appearance: none;
  border: 1px solid var(--hw-line);
  background: var(--hw-surface);
  color: var(--hw-ink);
  min-width: 30px;
  height: 30px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hw-g-controls {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.8rem;
  flex: 0 0 auto;
}

.hw-g-len-group {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1 1 auto;
  min-width: 0;
}

.hw-g-len-group input[type="range"] {
  width: clamp(68px, 22vw, 116px);
  accent-color: var(--hw-green);
}

.hw-g-btn-sm {
  appearance: none;
  border: 1px solid var(--hw-border-strong);
  background: var(--hw-surface);
  color: var(--hw-ink);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
}

.hw-g-btn-sm:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.hw-g-board-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  min-height: 0;
  width: 100%;
  padding: 2px 0;
}

.hw-g-board {
  --tile-size: clamp(26px, calc((100vh - 280px) / 6), 44px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  max-width: 540px;
}

@media (min-height: 700px) {
  .hw-g-board {
    --tile-size: clamp(32px, calc((100vh - 270px) / 6), 54px);
  }
}

.hw-g-row {
  display: grid;
  grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr));
  gap: 4px;
  margin: 0 auto;
  width: min(100%, calc(var(--cols, 5) * var(--tile-size) + (var(--cols, 5) - 1) * 4px));
}

.hw-g-tile {
  aspect-ratio: 1 / 1;
  width: 100%;
  border: 2px solid var(--hw-border-strong);
  background: var(--hw-surface);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.85rem, 3.2vw, 1.35rem);
  font-weight: 800;
  text-transform: uppercase;
  user-select: none;
  color: var(--hw-ink);
}

.hw-g-tile.is-filled {
  border-color: var(--hw-ink);
}

.hw-g-tile.is-correct,
.hw-g-key.is-correct {
  background: var(--hw-green);
  border-color: var(--hw-green);
  color: var(--hw-white);
}

.hw-g-tile.is-elsewhere,
.hw-g-key.is-elsewhere {
  background: var(--hw-yellow);
  border-color: var(--hw-yellow);
  color: var(--hw-dark-ink);
}

.hw-g-tile.is-absent,
.hw-g-key.is-absent {
  background: var(--hw-gray);
  border-color: var(--hw-gray);
  color: var(--hw-white);
}

.hw-cb .hw-g-tile.is-correct,
.hw-cb .hw-g-key.is-correct {
  background: var(--hw-cb-orange);
  border-color: var(--hw-cb-orange);
  color: var(--hw-dark-ink);
}

.hw-cb .hw-g-tile.is-elsewhere,
.hw-cb .hw-g-key.is-elsewhere {
  background: var(--hw-cb-blue);
  border-color: var(--hw-cb-blue);
  color: var(--hw-dark-ink);
}

.hw-g-status {
  margin: 0;
  min-height: 18px;
  text-align: center;
  font-size: 0.82rem;
  line-height: 18px;
  font-weight: 700;
  color: var(--hw-ink);
  flex: 0 0 auto;
}

.hw-g-keyboard {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  user-select: none;
  flex: 0 0 auto;
}

.hw-g-krow {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.hw-g-key {
  appearance: none;
  border: 0;
  border-radius: 6px;
  background: var(--hw-key-bg);
  color: var(--hw-ink);
  font-family: inherit;
  font-weight: 700;
  font-size: clamp(0.75rem, 2.8vw, 0.9rem);
  height: clamp(32px, 6.5vh, 42px);
  flex: 1 1 0;
  max-width: 44px;
  padding: 0 2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.hw-g-key.is-wide {
  flex: 1.55 1 0;
  max-width: 68px;
  font-size: 0.78rem;
}

.hw-g-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--hw-muted);
  flex: 0 0 auto;
  margin-top: auto;
  padding-top: 2px;
}

.hw-g-foot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Embed Panels (Settings / Stats / Rules) */
.hw-g-panel {
  display: none;
  flex-direction: column;
  gap: 12px;
  background: var(--hw-surface);
  border: 1.5px solid var(--hw-line);
  border-radius: 12px;
  padding: 16px;
  flex: 1 1 auto;
  overflow-y: auto;
}

.hw-g-panel.is-open {
  display: flex;
}

.hw-g-app.is-panel-open .hw-g-board-wrap,
.hw-g-app.is-panel-open .hw-g-controls,
.hw-g-app.is-panel-open .hw-g-keyboard,
.hw-g-app.is-panel-open .hw-g-foot,
.hw-g-app.is-panel-open .hw-g-status {
  display: none;
}

.hw-g-panel h2 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.hw-g-setting-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.hw-g-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  text-align: center;
}

.hw-g-stat-box {
  background: var(--hw-paper-alt);
  border-radius: 8px;
  padding: 8px 4px;
}

.hw-g-stat-num {
  display: block;
  font-size: 1.2rem;
  font-weight: 800;
}

.hw-g-stat-lbl {
  font-size: 0.72rem;
  color: var(--hw-muted);
}

.hw-g-board-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
}

.hw-g-board-list li {
  display: flex;
  justify-content: space-between;
  padding: 5px 8px;
  border-bottom: 1px solid var(--hw-line);
}

@media (max-width: 640px) {
  .hw-hide-sm {
    display: none !important;
  }
  .hw-topbar-inner {
    padding: 5px 10px;
    flex-wrap: nowrap;
    gap: 6px;
  }
  .hw-brand {
    font-size: 0.96rem;
    gap: 6px;
    flex-shrink: 0;
  }
  .hw-brand-tile {
    width: 26px;
    height: 26px;
    font-size: 0.9rem;
  }
  .hw-nav {
    flex-wrap: nowrap;
    gap: 2px;
  }
  .hw-nav-link {
    font-size: 0.78rem;
    padding: 4px 7px;
    white-space: nowrap;
  }
  .hw-main {
    padding: 5px 10px 32px;
  }
  .hw-hero-head {
    gap: 1px 8px;
    margin: 0 auto 5px;
  }
  .hw-hero-head .hw-breadcrumb {
    font-size: 0.72rem;
    line-height: 1.15;
    margin-bottom: 0;
    gap: 4px;
  }
  .hw-hero-h1 {
    font-size: 1.2rem;
    line-height: 1.15;
  }
  .hw-hero-sub {
    font-size: 0.76rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
  }
  .hw-stage-wrap {
    margin-bottom: 18px;
  }
  .hw-stage-frame {
    height: clamp(405px, 64svh, 465px);
    min-height: 405px;
  }
  .hw-action-bar {
    margin-top: 8px;
    flex-wrap: nowrap;
    gap: 5px;
  }
  .hw-act-btn {
    min-height: 36px;
    padding: 5px 6px;
    font-size: 0.75rem;
    gap: 4px;
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    white-space: nowrap;
  }
  .hw-act-fs {
    margin-left: 0;
  }
  .hw-prose {
    padding: 20px 16px;
  }
  .hw-footer-inner {
    grid-template-columns: 1fr;
  }
  .hw-g-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* ---- mobile polish 2026-11-18: 防横向溢出 / 触控区 / 表格可横滑 ---- */
html, body { overflow-x: hidden; }
img, svg, iframe, canvas { max-width: 100%; }
@media (max-width: 680px) {
  .hw-hero-h1 { font-size: clamp(22px, 6vw, 28px); line-height: 1.2; }
  .hw-hero-sub { font-size: 14px; margin-top: 10px; }
  .hw-hero-head { margin-bottom: 20px; }
  button, a[role="button"] { min-height: 44px; }
  table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}


/* ---- pass 2: 外框与文字层级 ---- */
.hw-stage-frame { border: 1px solid rgb(15 45 30 / .10); box-shadow: 0 8px 24px rgb(15 45 30 / .06); }
main p { line-height: 1.7; }
main p strong, main li strong { font-weight: 600; }
@media (max-width: 680px) {
  .hw-stage-wrap { padding-left: 0; padding-right: 0; }
  .hw-hero-head { padding-top: 8px; }
  .hw-stage-frame > div > div:last-child { gap: 8px; }
}
