:root{
  color-scheme:light;
  font:16px/1.5 "PingFang SC","Microsoft YaHei","Noto Sans CJK SC",system-ui,sans-serif;
  color:#263f38;background:#dee9d8;
}
*{box-sizing:border-box}
body{
  margin:0;min-height:100vh;min-height:100dvh;display:flex;
  padding:max(18px,env(safe-area-inset-top)) max(18px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left));
  background:radial-gradient(ellipse at 14% 8%,#f5f2d9,transparent 51%),radial-gradient(ellipse at 99% 97%,#bfd7c6,transparent 58%),#dee9d8;
}
button,input{font:inherit}
button{cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
button:focus-visible,input:focus-visible{outline:3px solid #985015;outline-offset:3px}
.invitation{
  display:grid;grid-template-columns:minmax(0,.92fr) minmax(0,1.08fr);width:100%;max-width:824px;margin:auto;
  overflow:hidden;border:1px solid #adbaa2;border-radius:24px;background:#fff9e9;
  box-shadow:0 3px 0 #b8c4b0,0 18px 42px #42664c23;
}
.letter{
  min-width:0;align-self:center;padding:38px 34px 20px;
  background-color:#fff9e9;background-image:repeating-linear-gradient(0deg,transparent 0 4px,#d8bc9508 4px 5px);
}
h1{margin:0;color:#244e43;font-size:clamp(32px,4.2vw,46px);line-height:1.17;letter-spacing:-.055em;font-weight:840}
.sender{display:block;margin-bottom:5px;color:#527164;font-size:.49em;line-height:1.25;font-weight:680;letter-spacing:0}
.game-name{font-family:ui-rounded,"Arial Rounded MT Bold","Avenir Next",system-ui,sans-serif;letter-spacing:-.055em}
#inviteHelp{margin:13px 0 25px;color:#4c6258;font-size:16px;line-height:1.55}
#inviteForm{display:block}
#inviteForm label{display:block;margin:0 0 6px;color:#334f43;font-size:16px;font-weight:720}
.code-field{display:flex;align-items:stretch;min-width:0;border:2px solid #a4b5a4;background:#fffefa;border-radius:11px}
.code-field:focus-within{border-color:#50796c}
#passcode{width:100%;min-width:0;min-height:49px;flex:1;padding:8px 10px 8px 13px;border:0;border-radius:9px;background:transparent;color:#254437;font-size:18px}
#passcode:focus-visible{outline-offset:-2px}
#passcode[type=text]{text-transform:uppercase}
#passcode::placeholder{font-size:16px;color:#69746b}
#togglePasscode{position:relative;display:flex;justify-content:center;align-items:center;flex:none;width:46px;min-height:46px;margin:0;padding:0;border:0;border-radius:9px;background:transparent;color:#485f52}
#togglePasscode:hover{background:#eaf0e3}
#togglePasscode:focus-visible{outline-offset:-3px}
.eye{display:block;position:relative;width:21px;height:14px;border:2px solid currentColor;border-radius:70% 24% 70% 24%;transform:rotate(18deg)}
.eye::before{content:'';position:absolute;left:5px;top:2px;width:6px;height:6px;border-radius:100%;background:currentColor}
#togglePasscode[aria-pressed=true]::after{content:'';position:absolute;width:25px;height:2px;border-radius:2px;background:currentColor;box-shadow:0 -1px #fffefa;transform:rotate(37deg)}
#enterGame{width:100%;min-height:50px;margin:13px 0 0;padding:9px 14px;border:1px solid #214f43;border-radius:11px;background:#34715c;color:#fffbed;box-shadow:0 3px 0 #214e42;font-size:18px;font-weight:750}
#enterGame:hover{background:#2c6653}
#enterGame:active{transform:translateY(2px);box-shadow:0 1px 0 #214e42}
#enterGame:disabled{background:#657e70;cursor:wait;box-shadow:0 2px 0 #465e52}
#status{min-height:1.5em;margin:9px 0 0;color:#754923;font-size:14px;line-height:1.5;overflow-wrap:anywhere}
.illustration{position:relative;isolation:isolate;display:flex;align-items:center;justify-content:center;overflow:hidden;min-height:325px;background:radial-gradient(ellipse at 58% 32%,#467666,transparent 72%),#315e50}
.illustration::before{content:'';position:absolute;inset:-35%;z-index:-1;opacity:.38;background:repeating-radial-gradient(ellipse at 18% 82%,transparent 0 17px,#e1e2b71f 17px 18px,transparent 18px 26px);transform:rotate(-16deg)}
.envelope{position:relative;flex:none;width:83%;max-width:320px;transform:rotate(-6deg);filter:drop-shadow(0 9px 5px #183c314d)}
.envelope::before{content:'';display:block;padding-top:83.333%}
.envelope-back{position:absolute;inset:15% 0 0;border-radius:5px;background:linear-gradient(155deg,#d9bd78,#cda65d);clip-path:polygon(0 35%,50% 0,100% 35%,100% 100%,0 100%)}
.postcard{position:absolute;left:6%;right:6%;top:3%;height:77%;padding:3.3%;background:#fff4cf;border:1px solid #d7ca9f;border-radius:3px;box-shadow:0 2px 3px #70563760;transform:rotate(7deg)}
.print{position:relative;overflow:hidden;height:100%;isolation:isolate;border:1px solid #729e8a;background:linear-gradient(160deg,#91c8bd,#c5ddbd)}
.sun,.cloud,.hill,.grove,.ground,.friend,.grass{display:block;position:absolute}
.sun{left:15%;top:12%;width:15%;height:0;padding-top:15%;border-radius:100%;background:#f8d475}
.cloud{left:48%;top:20%;width:23%;height:6%;border-radius:30px;background:#edf0d0}
.cloud::before{content:'';position:absolute;bottom:0;left:16%;width:45%;height:160%;border-radius:100% 100% 0 0;background:inherit}
.hill{bottom:18%;width:113%;height:35%;border-radius:51% 57% 0 0}
.hill.far{left:-21%;background:#7da48a;transform:rotate(5deg)}
.hill.near{right:-39%;bottom:12%;height:42%;background:#5d8c72;transform:rotate(-11deg)}
.grove{left:-4%;bottom:19%;width:20%;height:28%;border-radius:60% 74% 20% 55%;background:#57836a;box-shadow:12px 8px 0 -2px #507b62}
.ground{inset:64% -6% -12%;border-radius:54% 52% 0 0;background:linear-gradient(169deg,#a5b67b,#8fa56d)}
.friend{left:40%;bottom:32%;width:33%;height:46%;border-radius:43% 45% 21% 21% / 59% 58% 24% 23%;background:linear-gradient(130deg,#d7abc9,#c08fbb 65%,#ae7fae);clip-path:polygon(1% 82%,6% 71%,13% 62%,16% 54%,16% 37%,20% 29%,27% 24%,34% 25%,38% 26%,42% 14%,47% 10%,53% 11%,62% 18%,69% 18%,75% 16%,81% 18%,84% 24%,83% 37%,84% 47%,91% 61%,96% 71%,100% 81%,97% 89%,88% 93%,74% 94%,61% 91%,49% 94%,35% 96%,22% 94%,11% 93%,3% 90%)}
.friend::before,.friend::after{content:'';position:absolute;top:44%;width:4%;height:6%;border-radius:50%;background:#3c3540}
.friend::before{left:39%}.friend::after{right:28%}
.smile{position:absolute;left:46%;top:51%;width:17%;height:7%;border-bottom:2px solid #493948;border-radius:45%}
.grass{width:12%;height:12%;bottom:20%;background:#628763;clip-path:polygon(4% 100%,0 27%,31% 75%,47% 0,62% 75%,100% 22%,87% 100%)}
.grass.first{left:23%;bottom:19%}.grass.second{right:8%;bottom:16%;transform:scale(.75)}
.berry-stamp{position:absolute;top:-4%;right:-3%;display:flex;align-items:center;justify-content:center;width:23%;height:36%;border:4px solid #fff5d7;outline:3px dotted #fff1c9;background:#dfbd84;box-shadow:inset 0 0 0 1px #aa8458;transform:rotate(8deg)}
.berry{position:relative;width:45%;height:39%;margin-top:9%;border-radius:45% 46% 49% 46%;background:#ce6e50;background:linear-gradient(167deg,#ce6e50 67%,#e5aa62 69%)}
.berry::before,.berry::after{content:'';position:absolute;bottom:86%;width:69%;height:48%;background:#658856;border-radius:80% 10% 80% 15%;transform:rotate(7deg)}
.berry::before{left:39%}.berry::after{left:-10%;transform:scaleX(-1) rotate(-2deg);background:#7d9a64}
.envelope-front,.envelope-fold{position:absolute;inset:45% 0 0;border-radius:0 0 5px 5px}
.envelope-front{
  background:linear-gradient(to top right,#e7c888 49.7%,transparent 50.4%) left top/50.2% 52% no-repeat,
    linear-gradient(to top left,#e1bd7b 49.7%,transparent 50.4%) right top/50.2% 52% no-repeat,
    linear-gradient(20deg,#eaca8c,#e2bf7e) bottom/100% 49% no-repeat;
}
.envelope-fold{
  background:linear-gradient(to bottom right,transparent 49.5%,#f0d69a 50.4%) left bottom/50.2% 62% no-repeat,
    linear-gradient(to bottom left,transparent 49.5%,#eed196 50.4%) right bottom/50.2% 62% no-repeat;
}
@media(max-width:680px) and (orientation:portrait){
  body{padding:max(13px,env(safe-area-inset-top)) max(13px,env(safe-area-inset-right)) max(13px,env(safe-area-inset-bottom)) max(13px,env(safe-area-inset-left))}
  .invitation{grid-template-columns:minmax(0,1fr);max-width:420px;border-radius:20px}
  .illustration{min-height:0;height:clamp(142px,25vh,212px)}
  .envelope{width:clamp(151px,27vh,228px)}.envelope::before{padding-top:80%}
  .letter{padding:17px 22px 9px}
  h1{font-size:35px}.sender{margin-bottom:3px}
  #inviteHelp{margin:8px 0 15px}#enterGame{margin-top:10px}
}
@media(max-width:350px) and (orientation:portrait){
  .letter{padding-inline:16px}h1{font-size:31px}
}
@media(orientation:landscape) and (max-height:500px){
  body{padding:max(8px,env(safe-area-inset-top)) max(9px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(9px,env(safe-area-inset-left))}
  .invitation{grid-template-columns:minmax(0,.77fr) minmax(0,1.23fr);max-width:720px;border-radius:16px}
  .illustration{min-height:0}.letter{padding:12px 20px 3px}
  h1{font-size:29px}.sender{font-size:15px;margin-bottom:2px}
  #inviteHelp{margin:4px 0 9px;font-size:15px}#inviteForm label{margin-bottom:3px;font-size:15px}
  #passcode{min-height:44px}#togglePasscode{min-height:44px}#enterGame{min-height:44px;margin-top:6px;padding:5px 8px;font-size:16px}
  #status{margin-top:4px;min-height:1.3em}
}
@media(orientation:portrait) and (max-height:460px){
  .illustration{height:86px}.envelope{width:90px}.letter{padding-block:11px 5px}
}
@media(max-width:480px) and (max-height:410px){
  .invitation{grid-template-columns:minmax(0,1fr);max-width:400px}
  .illustration{display:none}.letter{padding:12px 16px 5px}
}
@media(max-height:230px), (max-width:480px) and (max-height:270px){
  .invitation{grid-template-columns:minmax(0,1fr)}
  .illustration{display:none}.letter{padding:8px 14px 4px}
  #inviteTitle,#inviteHelp{position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
}
@media(min-width:481px) and (max-height:230px){
  .invitation{max-width:570px}
  #inviteForm{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:9px;align-items:center}
  #inviteForm label,#status{grid-column:1 / 3}
  #enterGame{width:auto;min-width:96px;margin:0;padding:5px 12px}
}
