* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: #b39574;
  color: #26150a;
  touch-action: manipulation;
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Noto Sans CJK JP", "Yu Gothic", sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  overflow: hidden;
}

#app {
  touch-action: none;
  position: fixed;
  inset: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px) 0;
  background: #b39574;
}

#c {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

h1, .sub, p, span, div {
  word-break: auto-phrase;
  text-wrap: pretty;
}

[hidden] { display: none !important; }

.panel {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 14px calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 10;
}

#title {
  background: rgba(58, 34, 14, 0.14);
  align-items: flex-end;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}

#title .box {
  width: 100%;
  max-width: 356px;
  background: rgba(251, 245, 234, 0.96);
  border: 2px solid #2d190b;
  border-radius: 18px;
  padding: 14px 16px 10px;
  text-align: center;
  box-shadow: 0 10px 28px rgba(38, 18, 4, 0.24);
}

h1 {
  font-size: 38px;
  letter-spacing: 3px;
  margin: 0 0 4px;
  white-space: nowrap;
  color: #26150a;
}

.sub {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: #5c3a1d;
}

button, .button {
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  color: #26150a;
  background: #fff;
  border: 2px solid #26150a;
  border-radius: 24px;
  min-height: 44px;
  padding: 8px 18px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
}

button.primary {
  background: #8c3d10;
  border-color: #26150a;
  color: #fffdf9;
}

button.big {
  width: 100%;
  min-height: 50px;
  font-size: 18px;
  border-radius: 25px;
}

#title-guide {
  margin-top: 6px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#title-guide .sn-guide-link {
  position: relative;
  min-height: 36px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
}

#result {
  background: #f4ead8;
  align-items: flex-start;
  padding-top: 10px;
}

.box.wide {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
}

#card {
  width: 100%;
  max-width: min(100%, calc(max(148px, 100dvh - 270px) * 1200 / 630));
  aspect-ratio: 1200 / 630;
  display: block;
  margin: 0 auto;
  border: 2px solid #2d190b;
  border-radius: 14px;
  background: #fbf6ec;
}

.row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}

#r-post {
  flex: 1.65;
  background: #1b1b1d;
  border-color: #1b1b1d;
  color: #fff;
  font-size: 16px;
  min-height: 46px;
  padding: 0 10px;
}

#r-post svg {
  width: 16px;
  height: 16px;
}

#again {
  flex: 1;
  font-size: 15px;
  min-height: 46px;
  padding: 0 8px;
}

#r-row {
  margin-top: 8px;
}

#r-after {
  margin-top: 10px;
}

#title-guide:empty {
  display: none;
}

:lang(ko) body {
  font-family: "Apple SD Gothic Neo", "Noto Sans KR", "Noto Sans CJK KR", "Malgun Gothic", sans-serif;
}

:lang(zh-Hans) body {
  font-family: "PingFang SC", "Noto Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
}

:lang(zh-Hant) body {
  font-family: "PingFang TC", "Noto Sans TC", "Noto Sans CJK TC", "Microsoft JhengHei", sans-serif;
}

:lang(en) body, :lang(es) body, :lang(pt) body, :lang(fr) body, :lang(de) body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

:lang(en) h1, :lang(es) h1, :lang(pt) h1, :lang(fr) h1, :lang(de) h1 {
  letter-spacing: 0;
  font-size: min(38px, 10vw);
}

html.lang-wait #app, html.lang-wait #title {
  visibility: hidden;
}

#t-lang {
  margin: -4px 0 10px;
}

.langsw {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: 6px 12px;
  border: 2px solid #2d190b;
  border-radius: 20px;
  background: #fff;
  color: #26150a;
  font-size: 14px;
  font-weight: 800;
}

.langsw svg {
  width: 16px;
  height: 16px;
}

.langsw select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  font-size: 16px;
  cursor: pointer;
}
