/* styles.css */

:root{
  --green: #6b8f1a;
  --hover: #944736;
  --red:   #d32f2f;
  --text:  #111;
  --muted: #4b5563;
  --line:  #e5e7eb;
  --bg:    #ffffff;
  --soft:  #f6f7f9;
}

/* Base */
*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

img, svg{ max-width: 100%; height: auto; }

/* Container */
.container{
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
}

/* Header */
.site-header{ background: var(--green); }
.header-inner{
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
  height: 76px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 16px;
}
.brand{ display:flex; align-items:center; }
.brand img{
  display:block;
  width:120px;
  height:66.1px;
  object-fit: contain;
}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:0;
  cursor:pointer;
  text-decoration:none;
  user-select:none;
  border-radius: 6px;
  padding: 12px 18px;
  font-weight: 800;
  letter-spacing: .02em;
  white-space: nowrap;
  transition: background-color .15s ease, transform .05s ease, box-shadow .15s ease;
}
.btn:active{ transform: translateY(1px); }

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

.btn-support{
  background: var(--red);
  color:#fff;
  padding: 12px 22px;
}
.btn-support:hover{
  background: var(--hover);
  color:#fff;
}

/* Page */
.page{ padding: 34px 0 64px; }

.title{
  margin: 0 0 26px;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 900;
  letter-spacing: .01em;
}

.panel{ background: transparent; max-width: 100%; }

/* Desktop layout */
.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "left  right"
    "after right";
  gap: 42px;
  align-items:start;
}
.panel-left{ grid-area: left; }
.panel-right{ grid-area: right; }
.panel-after{ grid-area: after; }

/* Steps */
.step{
  padding: 18px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  max-width: 100%;
}
.step + .step{ margin-top: 18px; }
.step-last{ margin-top: 22px; }

.step-head{
  display:flex;
  gap: 10px;
  align-items:flex-start;
  margin-bottom: 14px;
}
.step-num{
  min-width: 28px;
  font-weight: 900;
  font-size: 16px;
  line-height: 1.2;
}
.step-label{
  font-weight: 900;
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: .01em;
}
.hint{
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* Upload */
.upload-card{
  display:block;
  width:100%;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  cursor:pointer;
}
.upload-card:hover{ border-color: #d1d5db; }
.upload-card input{ display:none; }
.upload-text{ color:#111; font-size:14px; line-height:1.4; }

/* Icons – desktop */
.icon-grid{
  display:flex;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 4px;
}
.icon-btn{
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition: transform .08s ease, box-shadow .15s ease, border-color .15s ease;
}
.icon-btn:hover{
  transform: translateY(-1px);
  border-color: #d1d5db;
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
}
.icon-btn img{
  width: 58px;
  height: 58px;
  border-radius: 999px;
  display:block;
}

/* Stage */
.stage-card{
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 14px;
  max-width: 100%;
}
.stage-wrap,
#stageWrap{
  width: min(500px, 100%);
  aspect-ratio: 1 / 1;
  height: auto;
  margin: 0 auto;
  max-width: 100%;
}
#stageWrap{
  overflow: hidden;
  position: relative;
}

/* Tools */
.tools{
  margin-top: 18px;
  padding: 18px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:#fff;
  max-width: 100%;
}
.tool-row{
  display:flex;
  align-items:center;
  gap: 14px;
}
.tool-row + .tool-row{ margin-top: 18px; }

.mini-btn{
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  cursor:pointer;
  font-size: 16px;
  line-height: 1;
  display:flex;
  align-items:center;
  justify-content:center;
  flex: 0 0 auto;
}
.mini-btn:hover{ background: var(--soft); }

.tool{ flex:1; min-width:0; }
.tool-label{ font-weight:800; font-size:13px; margin-bottom:10px; }
input[type="range"]{ width:100%; min-width:0; }

/* Mobile layout */
@media (max-width: 980px){
  .container{ width: calc(100% - 24px); }
  .header-inner{ width: calc(100% - 24px); height: 70px; }

  .grid{
    grid-template-columns: 1fr;
    grid-template-areas:
      "left"
      "right"
      "after";
    gap: 22px;
  }

  /* ikonok mobilon: 4 + 2 */
  .icon-grid{
    display:grid;
    grid-template-columns: repeat(4, 64px);
    justify-content:center;
    gap: 14px;
  }
  .icon-grid .icon-btn:nth-child(5){ grid-column: 2; }
  .icon-grid .icon-btn:nth-child(6){ grid-column: 3; }
}

@media (max-width: 540px){
  .step{ padding: 16px; }
  .tools{ padding: 16px; }
}
/* --- Icon buttons: force perfect circles on mobile too --- */
.icon-btn{
  appearance: none;
  -webkit-appearance: none;
  border-radius: 50%;
  padding: 0;
  line-height: 0;
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  overflow: hidden; /* ha a belső kép kilógna */
}

.icon-btn img{
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
}
/* Konva drag on mobile browsers (Brave/Chrome) */
#stageWrap, #stageWrap canvas{
  touch-action: none;
  -ms-touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
