@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&family=Playfair+Display:wght@500;600;700&display=swap');

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:#f5f1ec;color:#191715;font-family:"DM Sans",sans-serif;overflow-x:hidden}
button,input,select{font:inherit}
button{cursor:pointer}

header{
  height:70px;background:#fff;border-bottom:1px solid #e7dfd6;padding:0 5%;
  display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:20
}
.logo{font-weight:700;letter-spacing:3px}.logo span{font-weight:400}
.status{font-size:10px;letter-spacing:2px;color:#777}
.status i{display:inline-block;width:8px;height:8px;background:#c56b6b;border-radius:50%;margin-right:7px}
.status i.ready{background:#55a66b}

main{max-width:1250px;margin:auto;padding:36px 5% 70px}
.workspace{display:grid;grid-template-columns:minmax(0,1fr) 350px;gap:24px;align-items:start}
.camera-card,.panel{background:#fff;border:1px solid #e5ddd5;border-radius:20px}
.camera-card{padding:20px}

.camera-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:15px;gap:12px}
.camera-head p,.label{font-size:9px;letter-spacing:2.5px;font-weight:700;color:#a37a53;margin:0 0 6px}
.camera-head h1{font-family:"Playfair Display",serif;font-size:28px;margin:0}
.camera-head button,.secondary{
  border:1px solid #ddd5ce;background:#fff;border-radius:9px;padding:10px 13px;
  cursor:pointer;font-weight:700;font-size:11px
}

/* The page follows the device orientation only for the live-camera window. */
.camera{
  position:relative;background:#111;border-radius:15px;overflow:hidden;
  width:100%;aspect-ratio:4/5;display:flex;align-items:center;justify-content:center
}
.camera video{
  position:absolute;inset:0;width:100%;height:100%;opacity:0;pointer-events:none;z-index:1;
  object-fit:cover;object-position:center center;display:block
}
.camera #liveOverlay{
  position:absolute;inset:0;width:100%;height:100%;display:block;
  object-fit:cover;z-index:2;pointer-events:none
}
.camera canvas:not(#liveOverlay){display:none}
.camera-empty{
  position:absolute;inset:0;color:#fff;text-align:center;display:flex;align-items:center;
  justify-content:center;flex-direction:column;gap:7px;z-index:4
}
.camera-empty span{font-size:11px;color:#aaa}
.flash{position:absolute;inset:0;background:#fff;opacity:0;pointer-events:none;z-index:5}
.flash.on{animation:flash .25s}
.countdown{
  position:absolute;inset:0;display:none;align-items:center;justify-content:center;color:#fff;
  font-size:110px;font-weight:700;text-shadow:0 4px 25px #000;z-index:6
}
.countdown.show{display:flex}

.camera-portrait .camera{aspect-ratio:4/5}
.camera-landscape .camera{aspect-ratio:16/9}

.camera-actions{display:flex;justify-content:center;align-items:center;gap:18px;padding:20px 0 12px}
.capture{
  width:72px;height:72px;border-radius:50%;border:8px solid #e9e3dc;background:#191715;
  color:#fff;font-size:25px;cursor:pointer;box-shadow:0 5px 18px #0002
}
.mode{display:flex;justify-content:center;gap:5px;flex-wrap:wrap}
.modebtn{border:0;background:#f2efeb;padding:8px 13px;border-radius:999px;font-size:10px;cursor:pointer}
.modebtn.active{background:#191715;color:#fff}

aside{display:flex;flex-direction:column;gap:14px;min-width:0}
.panel{padding:17px}
.frames{display:flex;flex-direction:column;gap:7px}
.frame{
  padding:12px;text-align:left;border:1px solid #e1d9d1;border-radius:11px;
  background:#faf9f7;cursor:pointer
}
.frame span{display:block;color:#999;font-size:9px;margin-top:3px}
.frame.active{background:#191715;color:#fff;border-color:#191715}
.frame.active span{color:#c9c0b8}
.frame.cute{background:linear-gradient(135deg,#fff7fb,#fff);border-color:#f3c4d8}
.frame.cute.active{background:#7d3157;border-color:#7d3157}

.camera-select,.effects{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.camera-choice,.effect{
  border:1px solid #e1d9d1;border-radius:9px;background:#faf9f7;padding:10px 7px;
  font-size:10px;font-weight:700;cursor:pointer
}
.camera-choice.active,.effect.active{background:#191715;color:#fff;border-color:#191715}
.effects{grid-template-columns:repeat(2,1fr)}

.panel label{display:block;font-size:10px;font-weight:700;margin:11px 0}
.panel input,.panel select{
  width:100%;display:block;margin-top:5px;padding:10px;border:1px solid #ded7d0;
  border-radius:8px;font:inherit;font-size:11px;background:#fff
}
.crop-controls{margin-top:10px;padding-top:9px;border-top:1px solid #eee8e2}
.crop-controls label{position:relative}
.crop-controls input[type=range]{padding:0;accent-color:#191715}
#cropZoomValue{display:block;margin-top:4px;font-size:9px;color:#8b8179;text-align:right}

.effects-panel,.live-fun-panel{
  padding:16px;border:1px solid #f2c6da;border-radius:18px;
  background:linear-gradient(135deg,#fff7fb,#fff)
}
.live-fun-panel{border-color:#e8c9ef;background:linear-gradient(135deg,#fff8ff,#f8fbff)}
.effects-panel h3,.live-fun-panel h3{margin:0 0 7px;font-size:1.1rem}
.fun-help{margin:0 0 12px;color:#777;font-size:.85rem}
.effects-grid,.live-effects{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.effect-btn,.live-effect-btn,.sticker-btn{
  border:1px solid #e7c7ef;background:#fff;border-radius:12px;padding:9px 6px;
  min-height:44px;cursor:pointer;font-size:11px
}
.effect-btn.active,.live-effect-btn.active,.sticker-btn.active{background:#7d3157;color:#fff;border-color:#7d3157}
.sticker-picker{margin-top:13px;display:grid;gap:8px}
.sticker-list{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px}
.sticker-btn{font-size:22px;min-height:48px}

.result-types{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.result-type{
  min-width:0;min-height:74px;padding:9px 6px;border:1px solid #e1d9d1;border-radius:12px;
  background:#faf9f7;color:#2b2825;display:flex;flex-direction:column;
  align-items:center;justify-content:center;gap:2px;cursor:pointer;transition:.18s ease
}
.result-type b{font-size:19px;line-height:1;font-weight:700}
.result-type span{font-size:10px;font-weight:700}
.result-type small{font-size:8px;color:#999;text-transform:uppercase;letter-spacing:.4px}
.result-type:hover{transform:translateY(-1px);border-color:#cfc2b7;background:#fff}
.result-type.active{background:#191715;color:#fff;border-color:#191715;box-shadow:0 7px 18px rgba(25,23,21,.12)}
.result-type.active small{color:#c9c0b8}
.result-type-help{font-size:9px;line-height:1.45;color:#8b8179;margin:10px 2px 0}

.shots{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;min-height:55px}
.shots img{width:100%;aspect-ratio:16/9;object-fit:cover;border-radius:7px;background:#111}
.clear{
  width:100%;margin-top:9px;padding:9px;border:1px solid #ead5d5;
  background:#fff8f8;color:#a14b4b;border-radius:8px;cursor:pointer
}

.result-section{margin-top:58px;text-align:center}
.result-section h2{font-family:"Playfair Display",serif;font-size:32px;margin:0 0 18px}
.result-wrap{
  display:flex;justify-content:center;background:#ddd6ce;border-radius:22px;padding:20px;overflow:hidden
}
.result-wrap canvas{
  display:block;width:min(100%,900px);height:auto;box-shadow:0 20px 55px #0003;
  border-radius:4px;background:#fff
}
.result-actions{display:flex;justify-content:center;gap:10px;margin-top:15px}
.result-actions button{
  border:0;border-radius:9px;background:#191715;color:#fff;padding:12px 20px;font-weight:700;cursor:pointer
}
.result-actions button+button{background:#fff;color:#191715;border:1px solid #ddd}
footer{text-align:center;border-top:1px solid #e5ddd5;padding:25px;color:#999;font-size:10px;letter-spacing:1.5px}

@keyframes flash{0%{opacity:0}30%{opacity:1}100%{opacity:0}}

@media(max-width:850px){
  header{height:62px}
  .workspace{grid-template-columns:1fr}
  .camera-head h1{font-size:23px}
  .camera-head button{display:none}
  main{padding-top:24px}
  .result-wrap{padding:10px}
  .result-section h2{font-size:28px}
  .effects-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
}
@media(max-width:520px){
  main{padding-left:3.5%;padding-right:3.5%}
  .camera-card{padding:13px}
  .camera-head h1{font-size:21px}
  .camera-actions{gap:10px}
  .capture{width:64px;height:64px}
  .effects-grid,.live-effects{grid-template-columns:repeat(3,minmax(0,1fr))}
  .sticker-list{grid-template-columns:repeat(6,minmax(0,1fr))}
  .result-wrap{padding:7px}
  .result-actions button{padding:11px 16px}
  .result-types{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
  .result-type{min-height:68px}
  .result-type b{font-size:17px}
  .result-type span{font-size:9px}
  .result-type small{font-size:7px}
}


/* Upload photos from gallery */
.upload-row{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:7px;
  padding:0 0 8px;
}
.upload-btn{
  width:100%;
  border:1px dashed #cdbfb2;
  background:#faf7f3;
  color:#4c4037;
  border-radius:10px;
  padding:11px 14px;
  font-weight:700;
  font-size:11px;
  cursor:pointer;
  transition:.2s ease;
}
.upload-btn:hover{
  background:#f2ebe4;
  border-color:#a37a53;
  transform:translateY(-1px);
}
.upload-row small{
  color:#999;
  font-size:9px;
  text-align:center;
}


/* Scrapbook / paper result style */
.scrapbook-frame{background:linear-gradient(135deg,#fffaf0,#f5ead9)!important;border-color:#d8c1a1!important}
.scrapbook-frame.active{background:#5b4634!important;border-color:#5b4634!important}
.result-wrap.scrapbook-preview{background:#d8c9b8}

.sticker-controls{margin-top:10px;padding:12px;border:1px solid #e6ddd5;border-radius:12px;background:#fffaf6;display:grid;gap:9px}
.sticker-controls label{display:grid;grid-template-columns:90px 1fr 38px;align-items:center;gap:8px;font-size:10px;color:#574c45}
.sticker-controls select{grid-column:2/4;width:100%;padding:7px;border:1px solid #ddd3ca;border-radius:7px;background:#fff}
.sticker-controls input[type=range]{width:100%}
.sticker-controls output{font-size:10px;font-weight:700;text-align:right}
.sticker-controls small{font-size:9px;color:#999;line-height:1.45}
.sticker-layers{display:grid;gap:7px;margin-top:9px}
.sticker-layer{display:flex;align-items:center;gap:7px;padding:7px 9px;border:1px solid #e4d8cf;border-radius:10px;background:#fff;cursor:pointer}
.sticker-layer.active{border-color:#7d3157;box-shadow:0 0 0 2px rgba(125,49,87,.10)}
.sticker-layer .layer-emoji{font-size:22px;line-height:1}
.sticker-layer .layer-info{flex:1;font-size:10px;color:#6b5c54}
.sticker-layer .layer-remove{border:0;background:#f4ece7;border-radius:7px;padding:4px 7px;cursor:pointer}
.photo-position-controls{margin:10px 0;padding:11px;border:1px solid #e6ddd5;border-radius:12px;background:#fffaf6;display:grid;gap:8px}
.photo-position-title{font-size:11px;font-weight:700;color:#574c45}
.photo-position-card{padding:8px;border:1px solid #eadfd7;border-radius:10px;background:#fff}
.photo-position-card strong{display:block;font-size:10px;margin-bottom:5px;color:#574c45}
.photo-position-card label{display:grid;grid-template-columns:52px 1fr 38px;gap:7px;align-items:center;font-size:9px;color:#786c64;margin:4px 0}
.photo-position-card input{width:100%}
.photo-position-card output{text-align:right;font-size:9px;font-weight:700}

.photo-editor-card{overflow:hidden}
.photo-editor-card .photo-caption-input{font-size:10px!important;padding:8px!important}
.photo-sticker-title{font-size:9px;font-weight:700;color:#574c45;margin:8px 0 5px}
.photo-sticker-picker{display:grid;grid-template-columns:repeat(6,1fr);gap:5px;margin-bottom:6px}
.mini-sticker{border:1px solid #e7c7ef;background:#fff;border-radius:8px;padding:5px 2px;font-size:17px;min-height:34px;cursor:pointer}
.mini-sticker.active{background:#7d3157;color:#fff;border-color:#7d3157}
.photo-sticker-selected{display:flex;flex-wrap:wrap;gap:5px;min-height:24px;margin-bottom:7px}
.photo-sticker-selected span{display:inline-flex;align-items:center;gap:2px;padding:3px 5px;background:#f7eee9;border-radius:7px;font-size:16px}
.photo-sticker-selected button{border:0;background:transparent;color:#a14b4b;font-weight:700;cursor:pointer;padding:0 2px}
.photo-sticker-selected small{font-size:8px;color:#999}

.photo-editor-main-panel{border-color:#e3d4c7;background:linear-gradient(180deg,#fff,#fffaf6)}
.editor-hint{display:block;margin-top:7px;color:#9a8b80;font-size:9px;line-height:1.4}
.photo-editor-empty{padding:12px;border:1px dashed #dfd3ca;border-radius:10px;text-align:center;color:#9a8b80;font-size:10px;background:#fff}
.photo-card-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:7px}.photo-card-head span{font-size:9px;color:#a0806b;background:#f7eee8;padding:4px 7px;border-radius:99px}
.photo-adjust-title{font-size:9px;font-weight:700;color:#574c45;margin:10px 0 5px;padding-top:8px;border-top:1px solid #eee3db}
.photo-sticker-layer{display:grid;grid-template-columns:28px 24px 1fr;gap:4px;align-items:center;padding:7px;margin:5px 0;border:1px solid #eadfd7;border-radius:9px;background:#fffaf7}.photo-sticker-layer .ps-emoji{font-size:20px;text-align:center}.photo-sticker-layer>button{border:0;background:#f3e8e1;border-radius:6px;color:#9a4f4f;font-weight:700}.photo-sticker-layer label{grid-column:1/4;display:grid;grid-template-columns:35px 1fr 35px;gap:5px;align-items:center;font-size:8px}.photo-sticker-layer output{font-size:8px;text-align:right}.photo-editor-card .photo-sticker-selected>small{color:#a3948a;font-size:8px;line-height:1.35}
@media(max-width:760px){.photo-sticker-picker{grid-template-columns:repeat(6,1fr)}.photo-sticker-layer label{grid-template-columns:38px 1fr 38px}}
