/* RingCut: ringtone maker. Uses the shared RandomZone variables (--surface, --ink, --mut, --line, --a1, --a2 ...), so it follows the light/dark toggle. */
.rc { max-width: 1120px; padding-top: 26px; padding-bottom: 70px; --rc1: #ff5ecb; --rc2: #ff9f43; --sel: #2fd38a; }
.rc-head h1 { font-size: clamp(1.9rem, 4.6vw, 2.7rem); font-weight: 900; letter-spacing: -.03em; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rc-badge { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 5px 12px; border-radius: 999px; color: #fff; background: linear-gradient(135deg, var(--rc1), var(--rc2)); box-shadow: 0 6px 18px rgba(255, 94, 203, .35); -webkit-text-fill-color: #fff; }
.rc-head p { color: var(--mut); max-width: 700px; margin-top: 8px; }
.rc-head p b { color: var(--ink); }
.card h2 { font-size: 1.2rem; font-weight: 800; letter-spacing: -.01em; }
.msg { min-height: 1.3em; font-size: .88rem; color: var(--mut); margin-top: 8px; }
.msg.warn { color: #e0902b; font-weight: 700; }
.msg.err { color: #e5484d; font-weight: 700; }
.msg.ok { color: var(--good); font-weight: 700; }
.fine, .hint { color: var(--mut); font-size: .84rem; }
.btn.sm { min-height: 38px; padding: 0 14px; border-radius: 11px; font-size: .88rem; white-space: nowrap; }
.btn.big { min-height: 58px; padding: 0 30px; font-size: 1.1rem; border-radius: 16px; }
.btn.primary { background: linear-gradient(135deg, var(--rc1), var(--rc2)); box-shadow: 0 10px 26px rgba(255, 94, 203, .35); color: #2a0a1e; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
input.in, select.in { width: 100%; font: inherit; font-weight: 600; color: var(--ink); background: var(--surface2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
input.in:focus, select.in:focus, .tin input:focus { outline: 2px solid var(--a1); outline-offset: 1px; }
label.tf { display: grid; gap: 6px; font-weight: 700; font-size: .85rem; color: var(--mut); }
.chk { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.chk input { width: 18px; height: 18px; accent-color: var(--rc1); } .chk small { color: var(--mut); font-weight: 500; }
.chip { border: 1px solid var(--line); background: var(--surface2); color: var(--ink); font: 700 .85rem inherit; font-family: inherit; padding: 7px 14px; min-height: 36px; border-radius: 999px; cursor: pointer; transition: border-color .15s, background .15s; }
.chip:hover { border-color: var(--rc1); } .chip.on { background: linear-gradient(135deg, var(--rc1), var(--rc2)); color: #2a0a1e; border-color: transparent; }

/* drop zone */
.drop { padding: 22px; margin-top: 22px; }
.drop-zone { border: 2px dashed color-mix(in srgb, var(--rc1) 45%, var(--line)); border-radius: 20px; padding: 44px 20px; text-align: center; background: color-mix(in srgb, var(--rc1) 6%, transparent); transition: background .2s, border-color .2s, transform .2s; cursor: pointer; }
.drop-zone:hover, .drop-zone:focus-visible, .drop-zone.over { background: color-mix(in srgb, var(--rc1) 14%, transparent); border-color: var(--rc1); }
.drop-zone.over { transform: scale(1.01); }
.drop-ic { display: grid; place-items: center; margin-bottom: 8px; filter: drop-shadow(0 8px 18px rgba(255, 94, 203, .4)); animation: bob 3.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.drop-zone h2 { font-size: 1.6rem; font-weight: 900; } .drop-zone p { color: var(--mut); margin: 4px 0 18px; }
.drop-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.status { text-align: center; min-height: 1.4em; margin-top: 12px; font-weight: 600; color: var(--mut); }
.status.err { color: #e5484d; } .status.busy::before { content: ''; display: inline-block; width: 14px; height: 14px; margin-right: 8px; border-radius: 50%; border: 2px solid var(--rc1); border-top-color: transparent; vertical-align: -2px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.privacy { text-align: center; color: var(--mut); font-size: .86rem; margin-top: 4px; }
.rec-live { display: inline-flex; align-items: center; gap: 8px; color: #e5484d; font-weight: 800; }
.rec-live::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: #e5484d; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* layout */
.rc-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 18px; align-items: start; margin-top: 22px; }
.col-main, .col-side { display: grid; gap: 18px; min-width: 0; }
.col-side { position: sticky; top: 78px; }
.card.ed, .card.fx, .card.export, .card.howto, .card.phone { padding: 22px; }
@media (max-width: 900px) { .rc-grid { grid-template-columns: minmax(0, 1fr); } .col-side { position: static; } .rc-grid { display: flex; flex-direction: column; } .col-main, .col-side { display: contents; } .ed { order: 1; } .fx { order: 2; } .export { order: 3; } .phone { order: 4; } .howto { order: 5; } }
@media (max-width: 520px) { .card.ed, .card.fx, .card.export, .card.howto, .card.phone { padding: 16px; } }

/* editor */
.ed-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.song { color: var(--mut); font-size: .88rem; margin-top: 2px; overflow-wrap: anywhere; }
.wave-wrap { position: relative; height: 190px; border-radius: 16px; overflow: hidden; background: linear-gradient(180deg, color-mix(in srgb, var(--surface2) 80%, #000), var(--surface2)); border: 1px solid var(--line); touch-action: none; }
.wave-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#head { cursor: ew-resize; outline: none; } #head:focus-visible { box-shadow: inset 0 0 0 3px var(--a1); }
.viewbar { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.vb-btns { display: flex; gap: 6px; flex-wrap: wrap; }
#scroll { flex: 1 1 140px; min-width: 0; width: 100%; accent-color: var(--rc1); }
.transport { display: flex; align-items: center; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.transport .play { min-width: 190px; }
.clock { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 800; color: var(--mut); }
.times { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; align-items: end; }
.rc .card { min-width: 0; max-width: 100%; } .times > *, .tin { min-width: 0; }
.tin { display: flex; align-items: stretch; gap: 4px; }
.tin input { flex: 1; min-width: 0; width: 100%; text-align: center; font: 800 1.05rem inherit; font-family: inherit; font-variant-numeric: tabular-nums; color: var(--ink); background: var(--surface2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 4px; }
.tin button { width: 38px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 10px; font-size: 1.1rem; font-weight: 800; cursor: pointer; } .tin button:hover { background: var(--surface2); }
.lenv { font-weight: 900; font-size: 1.25rem; padding: 7px 4px; text-align: center; color: var(--ink); font-variant-numeric: tabular-nums; } .lenv.over { color: #e5484d; }
@media (max-width: 560px) { .times { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tf.len { grid-column: 1 / -1; } }
.presets { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; } .plabel { font-weight: 700; font-size: .85rem; color: var(--mut); }
.smart { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* polish panel */
.fx h2 { margin-bottom: 8px; }
.ctl { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; margin-top: 14px; align-items: center; }
.ctl label { font-weight: 700; font-size: .9rem; } .ctl output { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--mut); font-size: .88rem; }
.ctl input[type=range] { grid-column: 1 / -1; width: 100%; accent-color: var(--rc1); }
.ctl-row { margin-top: 12px; } .fx .hint { margin-top: 4px; }
.opts { display: grid; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.q { margin-top: 2px; }

/* export */
.nm { margin-top: 12px; }
.sum { list-style: none; display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.sum li { padding: 6px 12px; border-radius: 999px; background: var(--surface2); border: 1px solid var(--line); font-weight: 700; font-size: .84rem; }
.dl-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.more { margin-top: 12px; color: var(--mut); font-size: .88rem; display: flex; align-items: center; gap: 12px; }
.linkbtn { border: 0; background: none; font: inherit; font-weight: 800; color: var(--a1); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 6px 2px; }

/* how-to tabs */
.tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; background: var(--surface2); border-radius: 12px; padding: 5px; margin: 14px 0; }
.tab { border: 0; background: none; color: var(--mut); font: inherit; font-weight: 700; font-size: .9rem; padding: 10px 6px; border-radius: 9px; cursor: pointer; min-width: 0; }
.tab[aria-selected=true] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.how ol { margin-left: 1.2em; display: grid; gap: 10px; line-height: 1.6; } .how[hidden] { display: none; } .howto .fine { margin-top: 14px; }
.howto.glow { animation: glow 1.4s ease-out 2; } @keyframes glow { 50% { box-shadow: 0 0 0 4px var(--rc1), 0 0 40px rgba(255, 94, 203, .5); } }

/* phone mock-up */
.phone h2 { margin-bottom: 12px; }
.iphone { width: 190px; margin: 0 auto 14px; aspect-ratio: 9 / 18.5; border-radius: 34px; padding: 7px; background: linear-gradient(145deg, #3a3f55, #11131e); box-shadow: 0 22px 44px rgba(0, 0, 0, .35), inset 0 0 0 2px rgba(255, 255, 255, .12); position: relative; transition: transform .3s; }
.island { position: absolute; left: 50%; top: 14px; width: 54px; height: 16px; margin-left: -27px; border-radius: 10px; background: #000; z-index: 2; }
.scr { height: 100%; border-radius: 28px; overflow: hidden; background: radial-gradient(circle at 50% 0, #3b2d6e, #14102e 70%); color: #fff; display: flex; flex-direction: column; align-items: center; padding: 38px 10px 18px; text-align: center; }
.caller { display: grid; gap: 2px; } .who { font-weight: 800; font-size: 1.15rem; overflow-wrap: anywhere; } .what { font-size: .74rem; opacity: .75; }
.avatar { margin: 20px auto auto; width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; font-size: 1.7rem; background: linear-gradient(135deg, #7c6cff, #ff5ecb); box-shadow: 0 0 0 0 rgba(255, 94, 203, .6); }
.call-btns { display: flex; justify-content: space-between; width: 100%; padding: 0 8px; }
.cb { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 1.1rem; }
.cb.decline { background: #ff453a; } .cb.accept { background: #30d158; }
.iphone[data-state=ringing] { animation: ring 0.9s ease-in-out infinite; }
.iphone[data-state=ringing] .avatar { animation: ripple 1.4s ease-out infinite; } .iphone[data-state=ringing] .accept { animation: wob 0.9s ease-in-out infinite; }
@keyframes ring { 0%, 100% { transform: rotate(0); } 10%, 30%, 50% { transform: rotate(-3deg); } 20%, 40%, 60% { transform: rotate(3deg); } 70% { transform: rotate(0); } }
@keyframes ripple { to { box-shadow: 0 0 0 28px rgba(255, 94, 203, 0); } } @keyframes wob { 50% { transform: scale(1.15); } }
.phone .btn { width: 100%; margin-top: 12px; }
.iphone[data-state=ringing] ~ .btn { background: #ff453a; color: #fff; box-shadow: 0 10px 26px rgba(255, 69, 58, .4); }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 150%); background: #111a33; color: #fff; padding: 12px 20px; border-radius: 14px; font-weight: 700; z-index: 90; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); transition: transform .35s cubic-bezier(.2, .8, .2, 1); max-width: calc(100vw - 24px); text-align: center; }
.toast.show { transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .drop-ic, .iphone, .iphone * { animation: none !important; } }
